Export (0) Print
Expand All
Expand Minimize

GlobalFlags function

Retrieves information about the specified global memory object.

Note  This function is provided only for compatibility with 16-bit versions of Windows. New applications should use the heap functions. For more information, see Remarks.

Syntax


UINT WINAPI GlobalFlags(
  _In_  HGLOBAL hMem
);

Parameters

hMem [in]

A handle to the global memory object. This handle is returned by either the GlobalAlloc or GlobalReAlloc function.

Return value

If the function succeeds, the return value specifies the allocation values and the lock count for the memory object.

If the function fails, the return value is GMEM_INVALID_HANDLE, indicating that the global handle is not valid. To get extended error information, call GetLastError.

Remarks

The low-order byte of the low-order word of the return value contains the lock count of the object. To retrieve the lock count from the return value, use the GMEM_LOCKCOUNT mask with the bitwise AND (&) operator. The lock count of memory objects allocated with GMEM_FIXED is always zero.

The high-order byte of the low-order word of the return value indicates the allocation values of the memory object. It can be zero or GMEM_DISCARDED.

The global functions have greater overhead and provide fewer features than other memory management functions. New applications should use the heap functions unless documentation states that a global function should be used. For more information, see Global and Local Functions.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

WinBase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

Global and Local Functions
GlobalAlloc
GlobalDiscard
GlobalReAlloc
Memory Management Functions

 

 

Community Additions

ADD
Show:
© 2014 Microsoft