[1/3] winedbg: Remove unused debug menu
André Hentschel
nerv at dawncrow.de
Mon Oct 24 12:51:09 CDT 2011
I'm getting busy next days/weeks and most likely have only the weekends, so i hurried up and here is another try of the patchset i just cleaned up.
It's nearly http://dawncrow.de/crash.png , i only changed details
---
programs/winedbg/crashdlg.c | 29 ++++-------------------------
programs/winedbg/debugger.h | 2 +-
programs/winedbg/resource.h | 2 --
programs/winedbg/tgt_active.c | 6 +-----
programs/winedbg/winedbg.rc | 8 --------
5 files changed, 6 insertions(+), 41 deletions(-)
diff --git a/programs/winedbg/crashdlg.c b/programs/winedbg/crashdlg.c
index 4a24dcc..71c1b4b 100644
--- a/programs/winedbg/crashdlg.c
+++ b/programs/winedbg/crashdlg.c
@@ -82,7 +82,6 @@ static WCHAR *get_program_name(HANDLE hProcess)
static LPWSTR g_ProgramName;
static HFONT g_hBoldFont;
-static HMENU g_hDebugMenu = NULL;
static void set_bold_font(HWND hDlg)
{
@@ -125,24 +124,11 @@ static INT_PTR WINAPI DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return FALSE;
}
- case WM_RBUTTONDOWN:
- {
- POINT mousePos;
- if (!(wParam & MK_SHIFT))
- return FALSE;
- if (g_hDebugMenu == NULL)
- g_hDebugMenu = LoadMenuW(GetModuleHandleW(NULL), MAKEINTRESOURCEW(IDM_DEBUG_POPUP));
- GetCursorPos(&mousePos);
- TrackPopupMenu(GetSubMenu(g_hDebugMenu, 0), TPM_RIGHTBUTTON, mousePos.x, mousePos.y,
- 0, hwnd, NULL);
- return TRUE;
- }
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDOK:
case IDCANCEL:
- case ID_DEBUG:
EndDialog(hwnd, LOWORD(wParam));
return TRUE;
}
@@ -151,25 +137,18 @@ static INT_PTR WINAPI DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return FALSE;
}
-BOOL display_crash_dialog(void)
+void display_crash_dialog(void)
{
static const WCHAR winedeviceW[] = {'w','i','n','e','d','e','v','i','c','e','.','e','x','e',0};
- INT_PTR result;
/* dbg_curr_process->handle is not set */
HANDLE hProcess;
- if (!DBG_IVAR(ShowCrashDialog))
- return TRUE;
+ if (!DBG_IVAR(ShowCrashDialog)) return;
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, dbg_curr_pid);
g_ProgramName = get_program_name(hProcess);
CloseHandle(hProcess);
- if (!strcmpW( g_ProgramName, winedeviceW )) return TRUE;
- result = DialogBoxW(GetModuleHandleW(NULL), MAKEINTRESOURCEW(IDD_CRASH_DLG), NULL, DlgProc);
- if (result == ID_DEBUG) {
- AllocConsole();
- return FALSE;
- }
- return TRUE;
+ if (!strcmpW( g_ProgramName, winedeviceW )) return;
+ DialogBoxW(GetModuleHandleW(NULL), MAKEINTRESOURCEW(IDD_CRASH_DLG), NULL, DlgProc);
}
diff --git a/programs/winedbg/debugger.h b/programs/winedbg/debugger.h
index 9c72916..fc3aada 100644
--- a/programs/winedbg/debugger.h
+++ b/programs/winedbg/debugger.h
@@ -308,7 +308,7 @@ extern void break_restart_execution(int count);
extern int break_add_condition(int bpnum, struct expr* exp);
/* crashdlg.c */
-extern BOOL display_crash_dialog(void);
+extern void display_crash_dialog(void);
extern int msgbox_res_id(HWND hwnd, UINT textId, UINT captionId, UINT uType);
/* dbg.y */
diff --git a/programs/winedbg/resource.h b/programs/winedbg/resource.h
index 11c2cb9..c99f0f4 100644
--- a/programs/winedbg/resource.h
+++ b/programs/winedbg/resource.h
@@ -29,8 +29,6 @@
#define IDM_DEBUG_POPUP 100
-#define ID_DEBUG 200
-
#define IDS_AUTO_CAPTION 16
#define IDS_INVALID_PARAMS 17
#define IDS_UNIDENTIFIED 18
diff --git a/programs/winedbg/tgt_active.c b/programs/winedbg/tgt_active.c
index 376ee22..099b353 100644
--- a/programs/winedbg/tgt_active.c
+++ b/programs/winedbg/tgt_active.c
@@ -766,11 +766,7 @@ enum dbg_start dbg_active_auto(int argc, char* argv[])
msgbox_res_id(NULL, IDS_INVALID_PARAMS, IDS_AUTO_CAPTION, MB_OK);
return ds;
}
- if (!display_crash_dialog()) {
- dbg_init_console();
- dbg_start_interactive(INVALID_HANDLE_VALUE);
- return start_ok;
- }
+ display_crash_dialog();
hFile = parser_generate_command_file("echo Modules:", "info share",
"echo Threads:", "info threads",
diff --git a/programs/winedbg/winedbg.rc b/programs/winedbg/winedbg.rc
index 97740a6..9bcdab5 100644
--- a/programs/winedbg/winedbg.rc
+++ b/programs/winedbg/winedbg.rc
@@ -22,14 +22,6 @@
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
-IDM_DEBUG_POPUP MENU
-BEGIN
- POPUP ""
- BEGIN
- MENUITEM "&Debug", ID_DEBUG
- END
-END
-
STRINGTABLE
BEGIN
IDS_AUTO_CAPTION "Wine program crash"
--
Best Regards, André Hentschel
More information about the wine-patches
mailing list