Marshals an HRESULT to the specified stream, from which it can be unmarshaled using the CoUnmarshalHresult function.
STDAPI CoMarshalHresult(
IStream * pStm, //Pointer to the marshaling stream
HRESULT hresult //HRESULT to be marshaled
);
This function supports the standard return values E_OUTOFMEMORY and E_UNEXPECTED, as well as the following:
An HRESULT is process-specific, so an HRESULT that is valid in one process might not be valid in another. If you are writing your own implementation of IMarshal and need to marshal an HRESULT from one process to another, either as a parameter or a return code, you must call this function. In other circumstances, you will have no need to call this function.
This function perfoms the following tasks:
Windows NT: Use version 3.1 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in objbase.h.
Import Library: Included as a resource in ole32.dll.