wow32: Use spec file imports.
[wine.git] / dlls / faultrep / faultrep.c
blobb9207426970e5ef18eb7e5b7e4154630aaa32ec8
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"
28 #include "errorrep.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(faultrep);
32 /*************************************************************************
33 * AddERExcludedApplicationW [FAULTREP.@]
35 * Adds an application to a list of applications for which fault reports
36 * shouldn't be generated
38 * PARAMS
39 * lpAppFileName [I] The filename of the application executable
41 * RETURNS
42 * TRUE on success, FALSE of failure
44 * NOTES
45 * Wine doesn't use this data but stores it in the registry (in the same place
46 * as Windows would) in case it will be useful in a future version
49 BOOL WINAPI AddERExcludedApplicationW(LPCWSTR lpAppFileName)
51 WCHAR *bslash;
52 DWORD value = 1;
53 HKEY hkey;
54 LONG res;
56 TRACE("(%s)\n", wine_dbgstr_w(lpAppFileName));
57 bslash = wcsrchr(lpAppFileName, '\\');
58 if (bslash != NULL)
59 lpAppFileName = bslash + 1;
60 if (*lpAppFileName == '\0')
62 SetLastError(ERROR_INVALID_PARAMETER);
63 return FALSE;
66 res = RegCreateKeyW(HKEY_LOCAL_MACHINE,
67 L"Software\\Microsoft\\PCHealth\\ErrorReporting\\ExclusionList", &hkey);
68 if (!res)
70 RegSetValueExW(hkey, lpAppFileName, 0, REG_DWORD, (LPBYTE)&value, sizeof(value));
71 RegCloseKey(hkey);
74 return !res;
77 /*************************************************************************
78 * AddERExcludedApplicationA [FAULTREP.@]
80 * See AddERExcludedApplicationW
82 BOOL WINAPI AddERExcludedApplicationA(LPCSTR lpAppFileName)
84 int len = MultiByteToWideChar(CP_ACP, 0, lpAppFileName, -1, NULL, 0);
85 WCHAR *wstr;
86 BOOL ret;
88 TRACE("(%s)\n", wine_dbgstr_a(lpAppFileName));
89 if (len == 0)
90 return FALSE;
91 wstr = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*len);
92 MultiByteToWideChar(CP_ACP, 0, lpAppFileName, -1, wstr, len);
93 ret = AddERExcludedApplicationW(wstr);
94 HeapFree(GetProcessHeap(), 0, wstr);
95 return ret;
98 /*************************************************************************
99 * ReportFault [FAULTREP.@]
101 EFaultRepRetVal WINAPI ReportFault(LPEXCEPTION_POINTERS pep, DWORD dwOpt)
103 FIXME("%p 0x%lx stub\n", pep, dwOpt);
104 return frrvOk;