# HG changeset patch # User ib # Date 1344690178 0 # Node ID 93a763f04563593105913df479e1ea8c01e0246e # Parent b8565c1d7db303f36b3fd75fd62157468a68b001 Fix bug with definition of IDPLAYDISK in Win32 GUI. Numeric identifiers starting from IDPLAYDISK are used for CDROM/DVD drive menu entries and there must be enough identifier for all drives available. Introduce IDPLAYDISK_LIMIT for a range of such identifiers. Additionally, add a check when creating menu entries and rework the condition for checking the play command for reasons of clarity. Reported by Stephen Sheldon, sfsheldo gmail com. diff -r b8565c1d7db3 -r 93a763f04563 gui/win32/dialogs.h --- a/gui/win32/dialogs.h Fri Aug 10 21:12:02 2012 +0000 +++ b/gui/win32/dialogs.h Sat Aug 11 13:02:58 2012 +0000 @@ -104,7 +104,6 @@ #define IDFILE_SAVE 72 #define IDHELP_ABOUT 73 #define IDSUBTITLE_OPEN 74 -#define IDPLAYDISK 75 #define ID_CONSOLE 76 #define ID_EQ0 77 #define ID_EQ1 78 @@ -121,6 +120,9 @@ #define ID_MUTE 89 #define ID_FULLSCREEN 90 #define ID_IDLE 91 +/* support for 64 drives */ +#define IDPLAYDISK 100 +#define IDPLAYDISK_LIMIT 164 /* gtk emulation */ #define GTK_MB_FATAL 0x1 diff -r b8565c1d7db3 -r 93a763f04563 gui/win32/gui.c --- a/gui/win32/gui.c Fri Aug 10 21:12:02 2012 +0000 +++ b/gui/win32/gui.c Sat Aug 11 13:02:58 2012 +0000 @@ -887,7 +887,7 @@ strcat(menuitem, volname); } AppendMenu(gui->diskmenu, flags, IDPLAYDISK + cdromdrive, menuitem); - cdromdrive++; + if (++cdromdrive == IDPLAYDISK_LIMIT - IDPLAYDISK) break; } pos += strlen(device + pos) + 1; } @@ -1029,7 +1029,7 @@ handlemsg(hWnd, evAbout); break; } - if((IDPLAYDISK <= LOWORD(wParam)) && (LOWORD(wParam) < (IDPLAYDISK + 100))) + if(LOWORD(wParam) >= IDPLAYDISK && LOWORD(wParam) < IDPLAYDISK_LIMIT) { char device[MAX_PATH]; char searchpath[MAX_PATH];