Ejemplo n.º 1
0
    public HResult DetachObject()
    {
        lock (m_Obj)
        {
            m_IcyHandler = null;
        }

        return(HResult.S_OK);
    }
Ejemplo n.º 2
0
    public HResult ShutdownObject()
    {
        lock (m_Obj)
        {
            if (m_IcyHandler != null)
            {
                // Shut it down
                (m_IcyHandler as IDisposable).Dispose();

                // Reset for next time
                m_IcyHandler = null;
            }
        }

        return(HResult.S_OK);
    }
Ejemplo n.º 3
0
    // We can't just return an object.  It must be the specified interface.
    public HResult ActivateObject(Guid riid, out IntPtr ppv)
    {
        HResult hr;

        lock (m_Obj)
        {
            if (m_IcyHandler == null)
            {
                m_IcyHandler = new IcySchemeHandler() as IMFSchemeHandler;
            }

            // Note that if we don't support the requested riid, this is
            // essentially a noop.
            ppv = Marshal.GetIUnknownForObject(m_IcyHandler);
            hr  = (HResult)Marshal.QueryInterface(ppv, ref riid, out ppv);

            //Release 1 of the 2 refs we just added.
            Marshal.Release(ppv);
        }

        return(hr);
    }