PIMAGEHLP_STATUS_ROUTINE callback function (imagehlp.h)
An application-defined callback function used with the BindImageEx function. The status routine is called during the process of the image binding.
The PIMAGEHLP_STATUS_ROUTINE type defines a pointer to this callback function. StatusRoutine is a placeholder for the application-defined function name.
Syntax
PIMAGEHLP_STATUS_ROUTINE PimagehlpStatusRoutine;
BOOL PimagehlpStatusRoutine(
[in] IMAGEHLP_STATUS_REASON Reason,
[in] PCSTR ImageName,
[in] PCSTR DllName,
[in] ULONG_PTR Va,
[in] ULONG_PTR Parameter
)
{...}
Parameters
[in] Reason
The current status of the bind operation. This parameter can be one of the following values.
[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] DllName
The name of the DLL.
[in] Va
The computed virtual address.
[in] Parameter
Any additional status information. This value depends on the value of the Reason parameter. For more information, see the code fragment in the following Remarks section.
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
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.
The following code fragment describes how to use the Va value when the status is BindImageComplete.
case BindImageComplete:
if (fVerbose) {
fprintf(stderr, "BIND: Details of binding %s\n", ImageName );
NewImports = (PIMAGE_BOUND_IMPORT_DESCRIPTOR)Va;
NewImport = NewImports;
while (NewImport->OffsetModuleName) {
fprintf( stderr, " Import from %s [%x]",
(LPSTR)NewImports + NewImport->OffsetModuleName,
NewImport->TimeDateStamp
);
if (NewImport->NumberOfModuleForwarderRefs != 0) {
fprintf( stderr, " with %u forwarders", NewImport->
NumberOfModuleForwarderRefs );
}
fprintf( stderr, "\n" );
NewForwarder = (PIMAGE_BOUND_FORWARDER_REF)(NewImport+1);
for (i=0; i<NewImport->NumberOfModuleForwarderRefs; i++)
{
fprintf( stderr, " Forward to %s [%x]\n",
(LPSTR)NewImports + NewForwarder->OffsetModuleName,
NewForwarder->TimeDateStamp);
NewForwarder += 1;
}
NewImport = (PIMAGE_BOUND_IMPORT_DESCRIPTOR)NewForwarder;
}
}
break;
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 |