cmd: Fix German translation.
[wine/hramrach.git] / dlls / faultrep / faultrep.c
blobd4bd7131bbbb41f8d71b85b8bb2c45147f836ea4
1 /* Fault report handling
3 * Copyright 2007 Peter Dons Tychsen
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include <stdarg.h>
22 #include "windef.h"
23 #include "winbase.h"
24 #include "winnls.h"
25 #include "winreg.h"
26 #include "wine/debug.h"
27 #include "wine/unicode.h"
29 #include "errorrep.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(faultrep);
33 static const WCHAR SZ_EXCLUSIONLIST_KEY[] = {
34 'S','o','f','t','w','a','r','e','\\',
35 'M','i','c','r','o','s','o','f','t','\\',
36 'P','C','H','e','a','l','t','h','\\',
37 'E','r','r','o','r','R','e','p','o','r','t','i','n','g','\\',
38 'E','x','c','l','u','s','i','o','n','L','i','s','t', 0};
40 /*************************************************************************
41 * AddERExcludedApplicationW [FAULTREP.@]
43 * Adds an application to a list of applications for which fault reports
44 * shouldn't be generated
46 * PARAMS
47 * lpAppFileName [I] The filename of the application executable
49 * RETURNS
50 * TRUE on success, FALSE of failure
52 * NOTES
53 * Wine doesn't use this data but stores it in the registry (in the same place
54 * as Windows would) in case it will be useful in a future version
56 * According to MSDN this function should succeed even if the user has no write
57 * access to HKLM. This probably means that there is no error checking.
59 BOOL WINAPI AddERExcludedApplicationW(LPCWSTR lpAppFileName)
61 WCHAR *bslash;
62 DWORD value = 1;
63 HKEY hkey;
65 TRACE("(%s)\n", wine_dbgstr_w(lpAppFileName));
66 bslash = strrchrW(lpAppFileName, '\\');
67 if (bslash != NULL)
68 lpAppFileName = bslash + 1;
69 if (*lpAppFileName == '\0')
71 SetLastError(ERROR_INVALID_PARAMETER);
72 return FALSE;
75 if (!RegCreateKeyW(HKEY_LOCAL_MACHINE, SZ_EXCLUSIONLIST_KEY, &hkey))
77 RegSetValueExW(hkey, lpAppFileName, 0, REG_DWORD, (LPBYTE)&value, sizeof(value));
78 RegCloseKey(hkey);
81 return TRUE;
84 /*************************************************************************
85 * AddERExcludedApplicationA [FAULTREP.@]
87 * See AddERExcludedApplicationW
89 BOOL WINAPI AddERExcludedApplicationA(LPCSTR lpAppFileName)
91 int len = MultiByteToWideChar(CP_ACP, 0, lpAppFileName, -1, NULL, 0);
92 WCHAR *wstr;
93 BOOL ret;
95 TRACE("(%s)\n", wine_dbgstr_a(lpAppFileName));
96 if (len == 0)
97 return FALSE;
98 wstr = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*len);
99 MultiByteToWideChar(CP_ACP, 0, lpAppFileName, -1, wstr, len);
100 ret = AddERExcludedApplicationW(wstr);
101 HeapFree(GetProcessHeap(), 0, wstr);
102 return ret;
105 /*************************************************************************
106 * ReportFault [FAULTREP.@]
108 EFaultRepRetVal WINAPI ReportFault(LPEXCEPTION_POINTERS pep, DWORD dwOpt)
110 FIXME("%p 0x%x stub\n", pep, dwOpt);
111 return frrvOk;
114 /***********************************************************************
115 * DllMain.
117 BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved)
119 switch(reason)
121 case DLL_WINE_PREATTACH:
122 return FALSE;
123 case DLL_PROCESS_ATTACH:
124 DisableThreadLibraryCalls(inst);
125 break;
126 case DLL_PROCESS_DETACH:
127 break;
129 return TRUE;