LocalFirst

3.1

  #include <toolhelp.h>    

  BOOL LocalFirst(lple, hglbHeap)    
  LOCALENTRY FAR* lple; /* address of LOCALENTRY structure */
  HGLOBAL hglbHeap; /* handle of local heap */

The LocalFirst function fills the specified structure with information that describes the first object on the local heap.

Parameters

lple

Points to a LOCALENTRY structure that will receive information about the local memory object. The LOCALENTRY structure has the following form:

#include <toolhelp.h>

typedef struct tagLOCALENTRY {  /* le */
    DWORD   dwSize;
    HLOCAL  hHandle;
    WORD    wAddress;
    WORD    wSize;
    WORD    wFlags;
    WORD    wcLock;
    WORD    wType;
    WORD    hHeap;
    WORD    wHeapType;
    WORD    wNext;
} LOCALENTRY;

For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.

hglbHeap

Identifies the local heap.

Return Value

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

Comments

The LocalFirst function can be used to begin a local heap walk. An application can examine subsequent objects on the local heap by using the LocalNext function.

Before calling LocalFirst, an application must initialize the LOCALENTRY structure and specify its size, in bytes, in the dwSize member.

See Also

LocalInfo, LocalNext