GetHGlobalFromStream function

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

Syntax

HRESULT GetHGlobalFromStream(
  LPSTREAM pstm,
  HGLOBAL  *phglobal
);

Parameters

pstm

IStream pointer to the stream object previously created by a call to the CreateStreamOnHGlobal function.

phglobal

Pointer to the current memory handle used by the specified stream object.

Return value

This function returns HRESULT.

Remarks

The handle GetHGlobalFromStream returns may be different from the original handle due to intervening GlobalReAlloc calls.

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

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header combaseapi.h
Library Ole32.lib
DLL Ole32.dll

See also

CreateStreamOnHGlobal

GlobalReAlloc