BindImageEx function (imagehlp.h)

Computes the virtual address of each function that is imported.

Syntax

BOOL IMAGEAPI BindImageEx(
  [in] DWORD                    Flags,
  [in] PCSTR                    ImageName,
  [in] PCSTR                    DllPath,
  [in] PCSTR                    SymbolPath,
  [in] PIMAGEHLP_STATUS_ROUTINE StatusRoutine
);

Parameters

[in] Flags

The bind options. This parameter can be a combination of the following values.

Value Meaning
BIND_ALL_IMAGES
0x00000004
Bind all images in the call tree for this file.
BIND_CACHE_IMPORT_DLLS
0x00000008
Do not discard DLL information in the cache between calls. This improves performance when binding a large number of images.
BIND_NO_BOUND_IMPORTS
0x00000001
Do not generate a new import address table.
BIND_NO_UPDATE
0x00000002
Do not make changes to the file.

[in] ImageName

The name of the file to be bound. This value can be a file name, a partial path, or a full path.

[in] DllPath

The root of the search path to use if the file specified by the ImageName parameter cannot be opened.

[in] SymbolPath

The root of the path to search for the file's corresponding symbol file.

[in] StatusRoutine

A pointer to a status routine. The status routine is called during the progress of the image binding. For more information, see StatusRoutine.

Return value

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE. To retrieve extended error information, call GetLastError.

Remarks

The process of binding an image consists of computing the virtual address of each imported function. The computed virtual address is then saved in the importing image's Import Address Table (IAT). As a result, the image is loaded much faster, particularly if it uses many DLLs, because the system loader does not have to compute the address of each imported function.

If a corresponding symbol file can be located, its time stamp and checksum are updated.

All ImageHlp functions, such as this one, are single threaded. Therefore, calls from more than one thread to this function will likely result in unexpected behavior or memory corruption. To avoid this, you must synchronize all concurrent calls from more than one thread to this function.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header imagehlp.h
Library Imagehlp.lib
DLL Imagehlp.dll

See also

ImageHlp Functions

StatusRoutine