WORD GlobalFlags(hMem)
This function returns information about the global memory block specified by the hMem parameter.
| Parameter | Type/Description |
| hMem | HANDLE Identifies the global memory block. |
The return value specifies a memory-allocation flag in the high byte. The flag will be one of the following values:
| Value | Meaning |
| GMEM_DDESHARE | The block can be shared. This is used for dynamic data exchange (DDE) only. |
| GMEM_DISCARDABLE | The block can be discarded. |
| GMEM_DISCARDED | The block has been discarded. |
| GMEM_NOT_BANKED | The block cannot be banked. |
The low byte of the return value contains the lock count of the block. Use the GMEM_LOCKCOUNT mask to retrieve the lock-count value from the return value.
To test whether or not an object can be discarded, AND the return value of GlobalFlags with GMEM_DISCARDABLE.
The following functions can affect the lock count of a global memory block:
| Increases Lock Count | Decreases Lock Count |
| GlobalFix | GlobalUnfix |
| GlobalLock | GlobalUnlock |
| GlobalWire | GlobalUnWire |
| LockSegment | UnlockSegment |