BindImageEx Function

Debug Help Library

BindImageEx Function

Computes the virtual address of each function that is imported.

BOOL BindImageEx(
  __in          DWORD Flags,
  __in          PSTR ImageName,
  __in          PSTR DllPath,
  __in          PSTR SymbolPath,
  __in          PIMAGEHLP_STATUS_ROUTINE StatusRoutine
);

Parameters

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.

Windows Me/98/95:  This flag is required.

BIND_NO_UPDATE
0x00000002

Do not make changes to the file.

ImageName

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

DllPath

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

SymbolPath

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

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

Client

Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 4.0, Windows Me, Windows 98, or Windows 95.

Server

Requires Windows Server 2008, Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.

Header

Declared in Imagehlp.h.

Library

Use Imagehlp.lib.

DLL

Requires Imagehlp.dll.

See Also

ImageHlp Functions
StatusRoutine


Send comments about this topic to Microsoft

Build date: 9/25/2007

© 2007 Microsoft Corporation. All rights reserved.