Bazaar developer reference

CreateMiniDump(EXCEPTION_POINTERS *)

Defined in
CvGlobals.cpp, line 1957
Hook name
CivHooks::CreateMiniDump

Hooks

static bool BeforeCreateMiniDump(EXCEPTION_POINTERS * pep);static void AfterCreateMiniDump(EXCEPTION_POINTERS * pep);static void ReplaceCreateMiniDump(void (*original)(EXCEPTION_POINTERS *), EXCEPTION_POINTERS * pep);CivRegisterBefore<CivHooks::CreateMiniDump>(host, &BeforeCreateMiniDump);CivRegisterAfter<CivHooks::CreateMiniDump>(host, &AfterCreateMiniDump);CivRegisterReplace<CivHooks::CreateMiniDump>(host, &ReplaceCreateMiniDump);

Code

1957void CreateMiniDump(EXCEPTION_POINTERS *pep)1958{1959	/* Open a file to store the minidump. */1960	HANDLE hFile = CreateFile(_T("CvMiniDump.dmp"), GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);1961	if((hFile == NULL) || (hFile == INVALID_HANDLE_VALUE)) {1962		_tprintf(_T("CreateFile failed. Error: %u \n"), GetLastError());1963		return;1964	}19651966	/* Create the minidump. */1967	MINIDUMP_EXCEPTION_INFORMATION mdei;1968	mdei.ThreadId           = GetCurrentThreadId();1969	mdei.ExceptionPointers  = pep;1970	mdei.ClientPointers     = FALSE;19711972	MINIDUMP_TYPE mdt       = MiniDumpNormal;19731974	MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, mdt, (pep != NULL) ? &mdei : NULL, NULL, NULL);19751976	CloseHandle(hFile);1977}

Calls

Called by