src/win32.cpp
branchcpp_gui
changeset 6308 646711c5feaa
parent 6307 f40e88cff863
equal deleted inserted replaced
6307:f40e88cff863 6308:646711c5feaa
   333 
   333 
   334 static const TCHAR * const _expand_texts[] = {_T("S&how report >>"), _T("&Hide report <<") };
   334 static const TCHAR * const _expand_texts[] = {_T("S&how report >>"), _T("&Hide report <<") };
   335 
   335 
   336 static void SetWndSize(HWND wnd, int mode)
   336 static void SetWndSize(HWND wnd, int mode)
   337 {
   337 {
   338 	RECT r,r2;
   338 	RECT r, r2;
   339 	int offs;
   339 	int offs;
   340 
   340 
   341 	GetWindowRect(wnd, &r);
   341 	GetWindowRect(wnd, &r);
   342 
   342 
   343 	SetDlgItemText(wnd, 15, _expand_texts[mode == 1]);
   343 	SetDlgItemText(wnd, 15, _expand_texts[mode == 1]);
   366 		b = EmergencySave();
   366 		b = EmergencySave();
   367 	} __except (1) {}
   367 	} __except (1) {}
   368 	return b;
   368 	return b;
   369 }
   369 }
   370 
   370 
   371 static INT_PTR CALLBACK CrashDialogFunc(HWND wnd,UINT msg,WPARAM wParam,LPARAM lParam)
   371 static INT_PTR CALLBACK CrashDialogFunc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
   372 {
   372 {
   373 	switch (msg) {
   373 	switch (msg) {
   374 		case WM_INITDIALOG: {
   374 		case WM_INITDIALOG: {
   375 #if defined(UNICODE)
   375 #if defined(UNICODE)
   376 			/* We need to put the crash-log in a seperate buffer because the default
   376 			/* We need to put the crash-log in a seperate buffer because the default
   416 						SubmitFile(wnd, buf);
   416 						SubmitFile(wnd, buf);
   417 					}
   417 					}
   418 					EnableWindow(GetDlgItem(wnd, 14), FALSE);
   418 					EnableWindow(GetDlgItem(wnd, 14), FALSE);
   419 					SetCursor(LoadCursor(NULL, IDC_ARROW));
   419 					SetCursor(LoadCursor(NULL, IDC_ARROW));
   420 					MessageBox(wnd, _T("Crash report submitted. Thank you."), _T("Crash Report"), MB_ICONINFORMATION);
   420 					MessageBox(wnd, _T("Crash report submitted. Thank you."), _T("Crash Report"), MB_ICONINFORMATION);
   421 				}	break;
   421 				} break;
   422 #endif /* Disabled crash-submit procedures */
   422 #endif /* Disabled crash-submit procedures */
   423 				case 15: /* Expand window to show crash-message */
   423 				case 15: /* Expand window to show crash-message */
   424 					_expanded ^= 1;
   424 					_expanded ^= 1;
   425 					SetWndSize(wnd, _expanded);
   425 					SetWndSize(wnd, _expanded);
   426 					break;
   426 					break;
   547 			"\r\nStack trace: \r\n"
   547 			"\r\nStack trace: \r\n"
   548 		);
   548 		);
   549 	}
   549 	}
   550 
   550 
   551 	{
   551 	{
   552 		int i,j;
   552 		int i, j;
   553 #ifdef _M_AMD64
   553 #ifdef _M_AMD64
   554 		uint32 *b = (uint32*)ep->ContextRecord->Rsp;
   554 		uint32 *b = (uint32*)ep->ContextRecord->Rsp;
   555 #else
   555 #else
   556 		uint32 *b = (uint32*)ep->ContextRecord->Esp;
   556 		uint32 *b = (uint32*)ep->ContextRecord->Esp;
   557 #endif
   557 #endif
   558 		for (j = 0; j != 24; j++) {
   558 		for (j = 0; j != 24; j++) {
   559 			for (i = 0; i != 8; i++) {
   559 			for (i = 0; i != 8; i++) {
   560 				if (IsBadReadPtr(b,sizeof(uint32))) {
   560 				if (IsBadReadPtr(b, sizeof(uint32))) {
   561 					output += sprintf(output, " ????????"); //OCR: WAS - , 0);
   561 					output += sprintf(output, " ????????"); //OCR: WAS - , 0);
   562 				} else {
   562 				} else {
   563 					output += sprintf(output, " %.8X", *b);
   563 					output += sprintf(output, " %.8X", *b);
   564 				}
   564 				}
   565 				b++;
   565 				b++;