Home COM GDI+ WebBrowser Data Access

IMarshal Interface

 

IID_IMarshal

{00000003-0000-0000-C000-000000000046}

 

 

The IMarshal interface enables a COM object to define and manage the marshaling of its interface pointers. The alternative is to use the COM default implementation, the preferred choice in all but a few special cases.

 

Marshaling is the process of packaging data into packets for transmission to a different process or machine. Unmarshaling is the process of recovering that data at the receiving end. In any given call, method arguments are marshaled and unmarshaled in one direction, while return values are marshaled and unmarshaled in the other.

 

COM calls this interface as part of system-provided marshaling support. The COM calls are wrapped in calls to CoMarshalInterface and CoUnmarshalInterface. Your code typically will not need to call this interface.

 

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

IMarshal Methods

Description

GetUnmarshalClass

Returns CLSID of unmarshaling code.

GetMarshalSizeMax

Returns size of buffer needed during marshaling.

MarshalInterface

Marshals an interface pointer.

UnmarshalInterface

Unmarshals an interface pointer.

ReleaseMarshalData

Destroys a marshaled data packet.

DisconnectObject

Releases all connections.

 

GetUnmarshalClass

 

FUNCTION IMarshal_GetUnmarshalClass ( _

  BYVAL pthis AS DWORD PTR _

, BYREF riid AS GUID _

, BYVAL pv AS DWORD _

, BYVAL dwDestContext AS DWORD _

, BYVAL pvDestContext AS DWORD _

, BYVAL mshlflags AS DWORD _

, BYREF pCid AS GUID _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[3] USING IMarshal_GetUnmarshalClass (pthis, riid, pv, dwDestContext, pvDestContext, mshlflags, pCid) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

 

FUNCTION IMarshal_GetUnmarshalClass ( _

  BYVAL pthis AS DWORD PTR _

, BYREF riid AS GUID _

, BYVAL pv AS DWORD _

, BYVAL dwDestContext AS DWORD _

, BYVAL pvDestContext AS DWORD _

, BYVAL mshlflags AS DWORD _

, BYREF pCid AS GUID _

  ) AS LONG
 

  ! mov  eax, pCid

  ! push eax

  ! push mshlflags
  ! push pvDestContext

  ! push dwDestContext
  ! push pv
  ! mov  eax, riid

  ! push eax

  ! mov  eax, pthis
  ! push eax
  ! mov  eax, dword ptr[eax]
  ! call dword ptr[eax+12]
  ! mov  FUNCTION, eax


END FUNCTION

 

 

GetMarshalSizeMax

 

FUNCTION IMarshal_GetMarshalSizeMax ( _

  BYVAL pthis AS DWORD PTR _

, BYREF riid AS GUID _

, BYVAL pv AS DWORD _

, BYVAL dwDestContext AS DWORD _

, BYVAL pvDestContext AS DWORD -

, BYVAL mshlflags AS DWORD _

, BYREF pSize AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[4] USING IMarshal_GetMarshalSizeMax (pthis, riid, pv, dwDestContext, pvDestContext, mshlflags, pSize) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

 

FUNCTION IMarshal_GetMarshalSizeMax ( _

  BYVAL pthis AS DWORD PTR _

, BYREF riid AS GUID _

, BYVAL pv AS DWORD _

, BYVAL dwDestContext AS DWORD _

, BYVAL pvDestContext AS DWORD -

, BYVAL mshlflags AS DWORD _

, BYREF pSize AS DWORD _

  ) AS LONG
 

  ! push pSize

  ! push mshlflags
  ! push pvDestContext

  ! push dwDestContext
  ! push pv
  ! mov  eax, riid

  ! push eax

  ! mov  eax, pthis
  ! push eax
  ! mov  eax, dword ptr[eax]
  ! call dword ptr[eax+16]
  ! mov  FUNCTION, eax


END FUNCTION

 

 

MarshalInterface

 

FUNCTION IMarshal_MarshalInterface ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL pStm AS DWORD _

, BYREF riid AS GUID _

, BYVAL pv AS DWORD _

, BYVAL dwDestContext AS DWORD _

, BYVAL pvDestContext AS DWORD _

, BYVAL mshlflags AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[5] USING IMarshal_MarshalInterface (pthis, pStm, riid, pv, dwDestContext, pvDestContext, mshlflags) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

 

FUNCTION IMarshal_MarshalInterface ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL pStm AS DWORD _

, BYREF riid AS GUID _

, BYVAL pv AS DWORD _

, BYVAL dwDestContext AS DWORD _

, BYVAL pvDestContext AS DWORD _

, BYVAL mshlflags AS DWORD _

  ) AS LONG
 

  ! push mshlflags
  ! push pvDestContext

  ! push dwDestContext
  ! push pv
  ! mov  eax, riid

  ! push eax

  ! push pStm

  ! mov  eax, pthis
  ! push eax
  ! mov  eax, dword ptr[eax]
  ! call dword ptr[eax+20]
  ! mov  FUNCTION, eax


END FUNCTION

 

 

UnmarshalInterface

 

FUNCTION IMarshal_UnmarshalInterface ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL pStm AS DWORD _

, BYREF riid AS GUID _

, BYREF ppv AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[6] USING IMarshal_UnmarshalInterface (pthis, pStm, riid, ppv) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

 

FUNCTION IMarshal_UnmarshalInterface ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL pStm AS DWORD _

, BYREF riid AS GUID _

, BYREF ppv AS DWORD _

  ) AS LONG

  ! push ppv
  ! mov  eax, riid

  ! push eax

  ! push pStm

  ! mov  eax, pthis
  ! push eax
  ! mov  eax, dword ptr[eax]
  ! call dword ptr[eax+24]
  ! mov  FUNCTION, eax


END FUNCTION

 

 

ReleaseMarshalData

 

FUNCTION IMarshal_ReleaseMarshalData ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL pStm AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[7] USING IMarshal_ReleaseMarshalData (pthis, pStm) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

 

FUNCTION IMarshal_ReleaseMarshalData ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL pStm AS DWORD _

  ) AS LONG
 

  ! push pStm

  ! mov  eax, pthis
  ! push eax
  ! mov  eax, dword ptr[eax]
  ! call dword ptr[eax+28]
  ! mov  FUNCTION, eax


END FUNCTION

 

 

DisconnectObject

 

FUNCTION IMarshal_DisconnectObject ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL dwReserved AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[8] USING IMarshal_DisconnectObject (pthis, dwReserved) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

 

FUNCTION IMarshal_DisconnectObject ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL dwReserved AS DWORD _

  ) AS LONG

  ! push dwReserved

  ! mov  eax, pthis
  ! push eax
  ! mov  eax, dword ptr[eax]
  ! call dword ptr[eax+32]
  ! mov  FUNCTION, eax


END FUNCTION

 

 

Page last updated on Friday, 17 March 2006 08:25:16 +0100