Export (0) Print
Expand All

StatusRoutine callback function

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


BOOL StatusRoutine(
  _In_  IMAGEHLP_STATUS_REASON Reason,
  _In_  PSTR ImageName,
  _In_  PSTR DllName,
  _In_  ULONG_PTR Va,
  _In_  ULONG_PTR Parameter
);

Parameters

Reason [in]

The current status of the bind operation. This parameter can be one of the following values.

ValueMeaning
BindOutOfMemory
0

Out of memory. The Parameter value is the number of bytes in the allocation attempt.

BindRvaToVaFailed
1

The relative virtual address is invalid for the image. The Parameter value is not used.

BindNoRoomInImage
2

No room in the image for new format import table. The Parameter value is not used.

BindImportModuleFailed
3

Module import failed. The Parameter value is not used.

BindImportProcedureFailed
4

Procedure import failed. The Parameter value is the name of the function.

BindImportModule
5

Module import is starting. The Parameter value is not used.

BindImportProcedure
6

Procedure import is starting. The Parameter value is the name of the function.

BindForwarder
7

The Parameter value is the name of the function forwarded.

BindForwarderNOT
8

The Parameter value is the name of the function not forwarded.

BindImageModified
9

Image modified. The Parameter value is not used.

BindExpandFileHeaders
10

File headers expanded. The Parameter value is the number of bytes

BindImageComplete
11

Binding is complete. For more information on the Parameter value, see the following Remarks section.

BindMismatchedSymbols
12

Checksum did not match. The Parameter value is the name of the symbol file.

BindSymbolsNotUpdated
13

Symbol file was not updated. The Parameter value is the name of the symbol file not updated.

 

ImageName [in]

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

DllName [in]

The name of the DLL.

Va [in]

The computed virtual address.

Parameter [in]

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

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Imagehlp.h

See also

ImageHlp Functions
BindImageEx

 

 

Community Additions

ADD
Show:
© 2014 Microsoft