//---------------------------------------------------------------------------------------- BOOL CALLBACK MiniDumpCallback( PVOID pParam, const PMINIDUMP_CALLBACK_INPUT pInput, PMINIDUMP_CALLBACK_OUTPUT pOutput ) { BOOL bRet = FALSE; // Check parameters if( pInput == 0 ) return FALSE; if( pOutput == 0 ) return FALSE; // Process the callbacks switch( pInput->CallbackType ) { case IncludeModuleCallback: { // Include the module into the dump bRet = TRUE; } break; case IncludeThreadCallback: { // Include the thread into the dump bRet = TRUE; } break; case ModuleCallback: { if(s_MinidupmLvl == eMinidumpLevel::Low) { // Does the module have ModuleReferencedByMemory flag set ? if( !(pOutput->ModuleWriteFlags & ModuleReferencedByMemory) ) { // No, it does not - exclude it pOutput->ModuleWriteFlags &= (~ModuleWriteModule); } } if(s_MinidupmLvl == eMinidumpLevel::Med) { // Are data sections available for this module ? if( pOutput->ModuleWriteFlags & ModuleWriteDataSeg ) { // Yes, they are, but do we need them? if( !IsDataSectionNeeded( pInput->Module.FullPath ) ) { pOutput->ModuleWriteFlags &= (~ModuleWriteDataSeg); } } } bRet = TRUE; } break; case ThreadCallback: { // Include all thread information into the minidump bRet = TRUE; } break; case ThreadExCallback: { // Include this information bRet = TRUE; } break; case MemoryCallback: { // We do not include any information here -> return FALSE bRet = FALSE; } break; case CancelCallback: break; } return bRet; }
static BOOL CALLBACK MyMiniDumpCallback ( PVOID pParam, const PMINIDUMP_CALLBACK_INPUT pInput, PMINIDUMP_CALLBACK_OUTPUT pOutput ) { BOOL bRet = FALSE; if ( !pInput || !pOutput ) return FALSE; switch ( pInput->CallbackType ) { case IncludeModuleCallback: { // Include the module into the dump bRet = TRUE; } break; case IncludeThreadCallback: { // Include the thread into the dump bRet = TRUE; } break; case ModuleCallback: { // Are data sections available for this module ? if ( pOutput->ModuleWriteFlags & ModuleWriteDataSeg ) { // Yes, but do we really need them? if ( !IsDataSectionNeeded( pInput->Module.FullPath ) ) pOutput->ModuleWriteFlags &= (~ModuleWriteDataSeg); } bRet = TRUE; } break; case ThreadCallback: { // Include all thread information into the minidump bRet = TRUE; } break; case ThreadExCallback: { // Include this information bRet = TRUE; } break; /* NOTE About MemoryCallback : * This is defined for DbgHelp > 6.1.. * Since "false" is returned, it has been commented out. * * Additionally, false is now returned by default. This * ensures that the callback function will operate correctly * even with future versions of the DbhHelp DLL. * -- Ivan */ // case MemoryCallback: // { // // We do not include any information here -> return FALSE // bRet = FALSE; // } // break; // Following default block added by ISW 2005/05/06 default: { // Do not return any information for unrecognized // callback types. bRet=FALSE; } break; // case CancelCallback: // break; } return bRet; }