Compartilhar via


GetHGlobalFromStream (Windows Embedded CE 6.0)

1/6/2010

This function retrieves the global memory handle to a stream that was created through a call to the CreateStreamOnHGlobal function.

Syntax

WINOLEAPI GetHGlobalFromStream(
  IStream* pstm,
  HGLOBAL* phglobal
);

Parameters

  • pstm
    [in] IStream pointer to the stream object created by a call to the CreateStreamOnHGlobal function.
  • phglobal
    [out] Pointer to the current memory handle used by the specified stream object.

Return Value

The following HRESULT values can be returned.

Value Description

S_OK

Indicates that the handle was returned.

E_INVALIDARG

Indicates an invalid value specified for the pstm parameter.

It can also indicate that the stream object passed in is not one created by a call to the CreateStreamOnHGlobal function.

Remarks

The handle this function returns can differ from the original handle due to intervening LocalRealloc calls.

This function can be called only from within the same process that the byte array was created from.

To determine whether the platform supports this function, see Determining Supported COM APIs.

Requirements

Header ole2.h
Library ole32.lib
Windows Embedded CE Windows CE 2.0 and later

See Also

Reference

OLE Functions
Automation Functions
CreateStreamOnHGlobal
IStream

Concepts

Determining Supported COM APIs

Other Resources

LocalReAlloc