GlobalEntryModule

3.1

  #include <toolhelp.h>    

  BOOL GlobalEntryModule(lpge, hmod, wSeg)    
  GLOBALENTRY FAR* lpge; /* address of structure for segment */
  HMODULE hmod; /* handle of module, */  
  WORD wSeg; /* segment to describe, */  

The GlobalEntryModule function fills the specified structure by lpge with information about the specified module segment.

Parameters

lpge

Points to a GLOBALENTRY structure that receives information about the segment specified in the wSeg parameter. The GLOBALENTRY structure has the following form:

#include <toolhelp.h>

typedef struct tagGLOBALENTRY {  /* ge */
    DWORD   dwSize;
    DWORD   dwAddress;
    DWORD   dwBlockSize;
    HGLOBAL hBlock;
    WORD    wcLock;
    WORD    wcPageLock;
    WORD    wFlags;
    BOOL    wHeapPresent;
    HGLOBAL hOwner;
    WORD    wType;
    WORD    wData;
    DWORD   dwNext;
    DWORD   dwNextAlt;
} GLOBALENTRY;

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

hmod

Identifies the module that owns the segment.

wSeg

Specifies the segment to be described in the GLOBALENTRY structure. The number of the first segment in the module is 1. Segment numbers are always contiguous, so if the last valid segment number is 10, all segment numbers 1 through 10 are also valid.

Return Value

The return value is nonzero if the function is successful. Otherwise, it is zero. This function fails if the segment in the wSeg parameter does not exist in the module specified in the hmod parameter.

Comments

Debuggers can use the GlobalEntryModule function to retrieve global heap information about a specific segment loaded from an executable file. Typically, the debugger will have symbols that refer to segment numbers; this function translates the segment numbers to heap information.

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

See Also

GlobalEntryHandle, GlobalFirst, GlobalInfo, GlobalNext