Debug Help Library allows to load symbols from external storages. You just call SymSetSearchPath, specifying symbol servers, and then SymLoadModuleExW loads symbols from the specified locations.
Downloading symbols may take some time and I am currently looking for a way to cancel downloading symbols. But suddenly I couldn't find any API for that.
Is there a way to cancel downloading symbols?
CodePudding user response:
You can althrough only at a specific times you have no control over.
To cancel the download you:
- Register for the callback funcation with SymRegisterCallback64 or SymRegisterCallbackW64 funcation.
- In the callback handle the CBA_DEFERRED_SYMBOL_LOAD_CANCEL message.
e.g.
SymRegisterCallbackW64(process, sym_register_callback_proc64, nullptr);
BOOL CALLBACK sym_register_callback_proc64(__in HANDLE h_process, __in ULONG const action_code, __in_opt ULONG64 const callback_data, __in_opt ULONG64 const user_context)
{
switch (action_code)
{
...
case CBA_DEFERRED_SYMBOL_LOAD_CANCEL:
if(<test for cancel now?>)
{
return TRUE;
}
break;
...
}
// Return false to any ActionCode we don't handle
// or we could generate some undesirable behavior.
return FALSE;
}