[FAULTREP] Sync with Wine Staging 4.18. CORE-16441
[reactos.git] / dll / win32 / faultrep / faultrep.c
index d4bd713..3191659 100644 (file)
@@ -24,7 +24,6 @@
 #include "winnls.h"
 #include "winreg.h"
 #include "wine/debug.h"
-#include "wine/unicode.h"
 
 #include "errorrep.h"
 
@@ -53,17 +52,16 @@ static const WCHAR SZ_EXCLUSIONLIST_KEY[] = {
  * Wine doesn't use this data but stores it in the registry (in the same place
  * as Windows would) in case it will be useful in a future version
  *
- * According to MSDN this function should succeed even if the user has no write
- * access to HKLM. This probably means that there is no error checking.
  */
 BOOL WINAPI AddERExcludedApplicationW(LPCWSTR lpAppFileName)
 {
     WCHAR *bslash;
     DWORD value = 1;
     HKEY hkey;
+    LONG res;
 
     TRACE("(%s)\n", wine_dbgstr_w(lpAppFileName));
-    bslash = strrchrW(lpAppFileName, '\\');
+    bslash = wcsrchr(lpAppFileName, '\\');
     if (bslash != NULL)
         lpAppFileName = bslash + 1;
     if (*lpAppFileName == '\0')
@@ -72,13 +70,14 @@ BOOL WINAPI AddERExcludedApplicationW(LPCWSTR lpAppFileName)
         return FALSE;
     }
 
-    if (!RegCreateKeyW(HKEY_LOCAL_MACHINE, SZ_EXCLUSIONLIST_KEY, &hkey))
+    res = RegCreateKeyW(HKEY_LOCAL_MACHINE, SZ_EXCLUSIONLIST_KEY, &hkey);
+    if (!res)
     {
         RegSetValueExW(hkey, lpAppFileName, 0, REG_DWORD, (LPBYTE)&value, sizeof(value));
         RegCloseKey(hkey);
     }
 
-    return TRUE;
+    return !res;
 }
 
 /*************************************************************************
@@ -123,8 +122,6 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved)
     case DLL_PROCESS_ATTACH:
         DisableThreadLibraryCalls(inst);
         break;
-    case DLL_PROCESS_DETACH:
-        break;
     }
     return TRUE;
 }