GlobalPageLock

3.0

  UINT GlobalPageLock(hglb)    
  HGLOBAL hglb; /* selector of global memory to lock */

The GlobalPageLock function increments (increases by one) the page-lock count for the memory associated with the given global selector. As long as its page-lock count is nonzero, the data that the selector references is guaranteed to remain in memory at the same physical address.

Parameters

hglb

Specifies the selector of the memory to be page-locked.

Return Value

The return value specifies the page-lock count after the function has incremented it. If the function fails, the return value is zero.

Comments

Because using this function violates preferred Windows programming practices, an application should not use it unless absolutely necessary. The function is

intended to be used for dynamically allocated data that must be accessed at interrupt time. For this reason, it must be called only from a dynamic-link library (DLL).

The GlobalPageLock function increments the page-lock count for the block of memory, and the GlobalPageUnlock function decrements (decreases by one) the page-lock count. Page-locking operations can be nested, but each page-locking must be balanced by a corresponding unlocking.

See Also

GlobalPageUnlock