DefineHandleTable

Version 3.0

Syntax

BOOL DefineHandleTable(wOffset)

This function creates a private handle table in an application's default data segment. The application stores in the table the segment addresses of global memory objects returned by the GlobalLock function. In real mode, Windows updates the corresponding address in the private handle table when it moves a global memory object. When Windows discards an object with a corresponding table entry, Windows replaces the address of the object in the table with the object's handle. Windows does not update addresses in the private handle table in protected (standard or 386 enhanced) mode.

Parameter Type/Description  

wOffset WORD Specifies the offset from the beginning of the data segment to the beginning of the private handle table. If wOffset is zero, Windows no longer updates the private handle table.  

Return Value

The return value is nonzero if the function was successful. Otherwise, it is zero.

Comments

The private handle table has the following format:

Count

Clear_Number

Entry[0]

.

.

.

Entry[Count–1]

The first WORD (Count) in the table specifies the number of entries in the table. The second WORD (Clear_Number) specifies the number of entries (from the beginning of the table) which Windows will set to zero when Windows updates its least-recently-used (LRU) memory list. The remainder of the table consists of an array of addresses returned by GlobalLock.

The application must initialize the Count field in the table before calling DefineHandleTable. The application can change either the Count or Clearn_Number fields at any time.