Commit 26342c98 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Fixed segv when debugger registry key doesn't exist.

parent 0a892727
...@@ -67,7 +67,14 @@ static BOOL DEBUG_IntVarsRW(int read) ...@@ -67,7 +67,14 @@ static BOOL DEBUG_IntVarsRW(int read)
#undef INTERNAL_VAR #undef INTERNAL_VAR
} }
if (!RegOpenKey(HKEY_CURRENT_USER, "Software\\Wine\\WineDbg", &hkey)) { if (RegOpenKey(HKEY_CURRENT_USER, "Software\\Wine\\WineDbg", &hkey) &&
RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine\\WineDbg", &hkey)) {
/* since the IVars are not yet setup, DEBUG_Printf doesn't work,
* so don't use it */
fprintf(stderr, "Cannot create WineDbg key in registry\n");
return FALSE;
}
for (i = 0; i < DBG_IV_LAST; i++) { for (i = 0; i < DBG_IV_LAST; i++) {
if (read) { if (read) {
if (!DEBUG_IntVars[i].pval) { if (!DEBUG_IntVars[i].pval) {
...@@ -86,7 +93,6 @@ static BOOL DEBUG_IntVarsRW(int read) ...@@ -86,7 +93,6 @@ static BOOL DEBUG_IntVarsRW(int read)
} }
} }
RegCloseKey(hkey); RegCloseKey(hkey);
}
return TRUE; return TRUE;
} }
...@@ -549,9 +555,7 @@ static DWORD DEBUG_MainLoop(DWORD pid) ...@@ -549,9 +555,7 @@ static DWORD DEBUG_MainLoop(DWORD pid)
int DEBUG_main(int argc, char** argv) int DEBUG_main(int argc, char** argv)
{ {
DWORD pid = 0, retv = 0; DWORD pid = 0, retv = 0;
int i;
for (i = 0; i < argc; i++) fprintf(stderr, "argv[%d]=%s\n", i, argv[i]);
#ifdef DBG_need_heap #ifdef DBG_need_heap
/* Initialize the debugger heap. */ /* Initialize the debugger heap. */
dbg_heap = HeapCreate(HEAP_NO_SERIALIZE, 0x1000, 0x8000000); /* 128MB */ dbg_heap = HeapCreate(HEAP_NO_SERIALIZE, 0x1000, 0x8000000); /* 128MB */
...@@ -562,7 +566,7 @@ int DEBUG_main(int argc, char** argv) ...@@ -562,7 +566,7 @@ int DEBUG_main(int argc, char** argv)
DEBUG_InitCVDataTypes(); DEBUG_InitCVDataTypes();
/* Initialize internal vars */ /* Initialize internal vars */
DEBUG_IntVarsRW(TRUE); if (!DEBUG_IntVarsRW(TRUE)) return -1;
/* keep it as a guiexe for now, so that Wine won't touch the Unix stdin, /* keep it as a guiexe for now, so that Wine won't touch the Unix stdin,
* stdout and stderr streams * stdout and stderr streams
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment