Commits

Brian Curtin committed 2d6b7f8

Set a proper return code in the exception filter.
Set proper exception messages for enable() exceptions.
Fix enable to actually work...

  • Participants
  • Parent commits 58752f2

Comments (0)

Files changed (1)

File minidumper.c

                            0 /* Callback */);
     CloseHandle(file);
 
-    return rv;
+    return EXCEPTION_EXECUTE_HANDLER;
 }
 
 PyDoc_STRVAR(enable_doc,
     char *keywords[] = {"dir", "name", "type", NULL};
 
     if (DbgHelp == NULL) {
-        if ((DbgHelp = LoadLibraryW(L"DbgHelp.dll")) != NULL)
+        if ((DbgHelp = LoadLibraryW(L"DbgHelp.dll")) == NULL) {
+            PyErr_SetString(PyExc_OSError, "Unable to load DbgHelp");
             return NULL;
+        }
     }
 
-    if (!GetCurrentDirectoryW(/* buffer size*/ MAX_PATH, pydir))
+    if (!GetCurrentDirectoryW(/* buffer size*/ MAX_PATH, pydir)) {
+        PyErr_SetString(PyExc_OSError, "Unable to get the current directory");
         return NULL;
+    }
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|uui:enable", keywords,
-                                     &pydir, &pyname, &type))
+                                     &pydir, &pyname, &type)) {
         return NULL;
+    }
 
     dump_details.dir = pydir;
     dump_details.app_name = pyname;