From cc0d65e0db4c45fa7191ec8fe71999958ec6f3ac Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 8 Nov 2005 22:14:59 +0000 Subject: [PATCH] remove product name from vdi contents differentiate between "can't open .vdi" and "can't parse .vdi" --- stepmania/src/archutils/Win32/Crash.cpp | 16 ++++++++++++---- stepmania/src/archutils/Win32/mapconv.cpp | 2 +- stepmania/src/archutils/Win32/mapconv.exe | Bin 57344 -> 57344 bytes 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/stepmania/src/archutils/Win32/Crash.cpp b/stepmania/src/archutils/Win32/Crash.cpp index f06a37f283..b5554aaa9f 100644 --- a/stepmania/src/archutils/Win32/Crash.cpp +++ b/stepmania/src/archutils/Win32/Crash.cpp @@ -80,6 +80,7 @@ struct VDDebugInfoContext const unsigned long (*pSegments)[2]; int nSegments; char sFilename[1024]; + char szError[1024]; }; @@ -445,8 +446,12 @@ bool VDDebugInfoInitFromMemory(VDDebugInfoContext *pctx, const void *_src) { pctx->pRVAHeap = NULL; - if (memcmp((char *)src, PRODUCT_NAME " symbolic debug information", 36)) + static const char *header = "symbolic debug information"; + if (memcmp((char *)src, header, strlen(header))) + { + strcpy( pctx->szError, "header doesn't match" ); return false; + } // Extract fields @@ -474,15 +479,18 @@ bool VDDebugInfoInitFromFile( VDDebugInfoContext *pctx ) if( pctx->Loaded() ) return true; - GetVDIPath( pctx->sFilename, sizeof(pctx->sFilename) ); - pctx->pRawBlock = NULL; pctx->pRVAHeap = NULL; + GetVDIPath( pctx->sFilename, ARRAYSIZE(pctx->sFilename) ); + pctx->szError[0] = 0; HANDLE h = CreateFile(pctx->sFilename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (INVALID_HANDLE_VALUE == h) + { + strcpy( pctx->szError, "CreateFile failed" ); return false; + } do { DWORD dwFileSize = GetFileSize(h, NULL); @@ -751,7 +759,7 @@ static bool ReportCallStack( HWND hwnd, HANDLE hFile, const void **Backtrace ) VDDebugInfoInitFromFile( &g_debugInfo ); if( !g_debugInfo.Loaded() ) { - Report( hwnd, hFile, "Could not open debug resource file (%s).", g_debugInfo.sFilename ); + Report( hwnd, hFile, "debug resource file '%s': %s.", g_debugInfo.sFilename, g_debugInfo.szError ); return false; } diff --git a/stepmania/src/archutils/Win32/mapconv.cpp b/stepmania/src/archutils/Win32/mapconv.cpp index 177e83990a..2ca9e8f472 100644 --- a/stepmania/src/archutils/Win32/mapconv.cpp +++ b/stepmania/src/archutils/Win32/mapconv.cpp @@ -267,7 +267,7 @@ int main(int argc, char **argv) { // dump data - static const char header[64]="StepMania symbolic debug information\r\n\x1A"; + static const char header[64]="symbolic debug information\r\n\x1A"; fwrite(header, 64, 1, fo); diff --git a/stepmania/src/archutils/Win32/mapconv.exe b/stepmania/src/archutils/Win32/mapconv.exe index ccf021b4e4398442cd3bbff62e8f63840dc23bbc..26b6f688949d92bce94a4f491a676fbf1455916f 100644 GIT binary patch delta 58 zcmZoTz}#?vdBOvh>+*%p8=nYl05c~4*f3-Atc_+94Y)R6*r>oOU}Ky!Ymc_J=c=>* N`}67o{TA(41OO0}8Z7_- delta 66 zcmZoTz}#?vdBOvhKP3;HHa-#90A@`7v0(;Ra7k)`Z(?3%qQc|}8_hOf*r>oO;IDHd VfBk+HuX*bC?w)zTvv<*cMF2$wAc+6~