Skip to content

Latest commit

 

History

History
174 lines (145 loc) · 6.07 KB

nf-combaseapi-counmarshalinterface.md

File metadata and controls

174 lines (145 loc) · 6.07 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:combaseapi.CoUnmarshalInterface
CoUnmarshalInterface function (combaseapi.h)
Initializes a newly created proxy using data written into the stream by a previous call to the CoMarshalInterface function, and returns an interface pointer to that proxy.
CoUnmarshalInterface
CoUnmarshalInterface function [COM]
_com_CoUnmarshalInterface
com.counmarshalinterface
combaseapi/CoUnmarshalInterface
com\counmarshalinterface.htm
com
d0eac0da-2f41-40c4-b756-31bc22752c17
12/05/2018
CoUnmarshalInterface, CoUnmarshalInterface function [COM], _com_CoUnmarshalInterface, com.counmarshalinterface, combaseapi/CoUnmarshalInterface
combaseapi.h
Objbase.h
Windows
Windows 2000 Professional [desktop apps \| UWP apps]
Windows 2000 Server [desktop apps \| UWP apps]
Ole32.lib
Ole32.dll
Windows
19H1
CoUnmarshalInterface
combaseapi/CoUnmarshalInterface
c++
APIRef
kbSyntax
DllExport
Ole32.dll
API-MS-Win-Core-Com-l1-1-0.dll
ComBase.dll
API-MS-Win-Core-Com-l1-1-1.dll
API-MS-Win-DownLevel-Ole32-l1-1-0.dll
API-MS-Win-DownLevel-Ole32-l1-1-1.dll
CoUnmarshalInterface

CoUnmarshalInterface function

-description

Initializes a newly created proxy using data written into the stream by a previous call to the CoMarshalInterface function, and returns an interface pointer to that proxy.

-parameters

-param pStm [in]

A pointer to the stream from which the interface is to be unmarshaled.

-param riid [in]

A reference to the identifier of the interface to be unmarshaled. For IID_NULL, the returned interface is the one defined by the stream, objref.iid.

-param ppv [out]

The address of pointer variable that receives the interface pointer requested in riid. Upon successful return, *ppv contains the requested interface pointer for the unmarshaled interface.

-returns

This function can return the standard return value E_FAIL, errors returned by CoCreateInstance, and the following values.

Return code Description
S_OK
The interface pointer was unmarshaled successfully.
STG_E_INVALIDPOINTER
pStm is an invalid pointer.
CO_E_NOTINITIALIZED
The CoInitialize or OleInitialize function was not called on the current thread before this function was called.
CO_E_OBJNOTCONNECTED
The object application has been disconnected from the remoting system (for example, as a result of a call to the CoDisconnectObject function).
REGDB_E_CLASSNOTREG
An error occurred reading the registration database.
E_NOINTERFACE
The final QueryInterface of this function for the requested interface returned E_NOINTERFACE.

-remarks

Important  

Security Note: Calling this method with untrusted data is a security risk. Call this method only with trusted data.

 
The CoUnmarshalInterface function performs the following tasks:
  1. Reads from the stream the CLSID to be used to create an instance of the proxy.
  2. Gets an IMarshal pointer to the proxy that is to do the unmarshaling. If the object uses COM's default marshaling implementation, the pointer thus obtained is to an instance of the generic proxy object. If the marshaling is occurring between two threads in the same process, the pointer is to an instance of the in-process free threaded marshaler. If the object provides its own marshaling code, CoUnmarshalInterface calls the CoCreateInstance function, passing the CLSID it read from the marshaling stream. CoCreateInstance creates an instance of the object's proxy and returns an IMarshal interface pointer to the proxy.
  3. Using whichever IMarshal interface pointer it has acquired, the function then calls IMarshal::UnmarshalInterface and, if appropriate, IMarshal::ReleaseMarshalData.
The primary caller of this function is COM itself, from within interface proxies or stubs that unmarshal an interface pointer. There are, however, some situations in which you might call CoUnmarshalInterface. For example, if you are implementing a stub, your implementation would call CoUnmarshalInterface when the stub receives an interface pointer as a parameter in a method call.

-see-also

CoMarshalInterface

IMarshal::UnmarshalInterface