This topic has not yet been rated - Rate this topic

CoMarshalHresult function

Applies to: desktop apps only

Marshals an HRESULT to the specified stream, from which it can be unmarshaled using the CoUnmarshalHresult function.

Syntax

HRESULT CoMarshalHresult(
  __in  LPSTREAM pstm,
  __in  HRESULT hresult
);

Parameters

pstm [in]

A pointer to the marshaling stream. See IStream.

hresult [in]

The HRESULT in the originating process.

Return value

This function can return the standard return values E_OUTOFMEMORY and E_UNEXPECTED, as well as the following values.

Return codeDescription
S_OK

The HRESULT was marshaled successfully.

STG_E_INVALIDPOINTER

A bad pointer was specified for pstm.

STG_E_MEDIUMFULL

The medium is full.

 

Remarks

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 performs the following tasks:

  1. Writes an HRESULT to a stream.
  2. Returns an IStream pointer to that stream.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Objbase.h

Library

Ole32.lib

DLL

Ole32.dll

See also

CoUnmarshalHresult
IStream

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ