Platform SDK: Debugging and Error Handling

SymbolRegisteredCallback

The SymbolRegisteredCallback function is an application-defined callback function used with the SymRegisterCallback function. It is called by the symbol handler.

The PSYMBOL_REGISTERED_CALLBACK type defines a pointer to this callback function. SymbolRegisteredCallback is a placeholder for the application-defined function name.

BOOL CALLBACK SymbolRegisteredCallback(
  HANDLE hProcess,     
  ULONG ActionCode,    
  PVOID CallbackData,  
  PVOID UserContext    
);

The PSYMBOL_REGISTERED_CALLBACK64 type defines a pointer to this callback function. SymbolRegisteredCallback64 is a placeholder for the application-defined function name.

BOOL CALLBACK SymbolRegisteredCallback64(
  HANDLE hProcess,     
  ULONG ActionCode,    
  ULONG64 CallbackData,  
  ULONG64 UserContext    
);

Parameters

hProcess
[in] Handle to the process that was originally passed to the SymInitialize function.
ActionCode
[in] Specifies the reason for the callback. The valid values are described in the following table.
Value Meaning
CBA_DEFERRED_SYMBOL_LOAD_START Deferred symbol load started. The CallbackData parameter is a pointer to a IMAGEHLP_DEFERRED_SYMBOL_LOAD structure.
CBA_DEFERRED_SYMBOL_LOAD_COMPLETE Deferred symbol load completed. The CallbackData parameter is a pointer to a IMAGEHLP_DEFERRED_SYMBOL_LOAD structure.
CBA_DEFERRED_SYMBOL_LOAD_FAILURE Deferred symbol load failure. The CallbackData parameter is a pointer to a IMAGEHLP_DEFERRED_SYMBOL_LOAD structure.
CBA_SYMBOLS_UNLOADED Symbols unloaded. The CallbackData parameter is NULL.
CBA_DUPLICATE_SYMBOL Duplicate symbol. The CallbackData parameter is a pointer to a IMAGEHLP_DUPLICATE_SYMBOL structure.
CBA_READ_MEMORY Read loaded image. The CallbackData parameter is a pointer to a IMAGEHLP_CBA_READ_MEMORY structure.
CBA_DEBUG_INFO Display verbose information. The CallbackData parameter is a pointer to a string.

CallbackData
[in] Specifies data for the operation. The format of this data depends on the value of the ActionCode parameter.
UserContext
[in] A user-defined value specified in SymRegisterCallback, or NULL. Typically, this parameter is used by an application to pass a pointer to a data structure that lets the callback function establish some context.

Return Values

Returning the value TRUE indicates success.

Returning the value FALSE indicates failure.

Remarks

The calling application gets called through the registered callback function as a result of another call to one of the symbol handler functions. The calling application must be prepared for the possible side effects that this can cause. If the application has only one callback function that is being used by multiple threads, then care may be necessary to synchronize some types of data access while in the context of the callback function.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in Dbghelp.h.

See Also

Debug Help Library Overview, DbgHelp Functions, IMAGEHLP_CBA_READ_MEMORY, IMAGEHLP_DEFERRED_SYMBOL_LOAD, IMAGEHLP_DUPLICATE_SYMBOL, SymRegisterCallback