# CoUnmarshalHresult

Unmarshals an HRESULT type from the specified stream.

STDAPI CoUnmarshalHresult(

LPSTREAM pStm, | //Pointer to stream used for unmarshaling
HRESULT * phresult | //Pointer to the HRESULT
); |

Parameters

pStm
  [in] Pointer to the stream from which the HRESULT is to be unmarshaled.
phresult
  [out] Pointer to the unmarshaled HRESULT.

Return Values

This function supports the standard return values E_OUTOFMEMORY and E_UNEXPECTED, as well as the following:

S_OK
  The HRESULT was unmarshaled successfully.
STG_E_INVALIDPOINTER
  pStm is an invalid pointer.

Remarks

You do not explicitly call this function unless you are performing custom marshaling (that is, writing your own implementation of IMarshal), and your implementation needs to unmarshal an HRESULT.

You must use CoUnmarshalHresult to unmarshal HRESULTs previously marshaled by a call to the CoMarshalHresult function.

This function performs the following tasks:

1. Reads an HRESULT from a stream.

2. Returns the HRESULT.

See Also

CoMarshalHresult, IStream