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
26 #include "wine/debug.h"
27 #include "wine/unicode.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
47 * lpAppFileName [I] The filename of the application executable
50 * TRUE on success, FALSE of failure
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
57 BOOL WINAPI
AddERExcludedApplicationW(LPCWSTR lpAppFileName
)
64 TRACE("(%s)\n", wine_dbgstr_w(lpAppFileName
));
65 bslash
= strrchrW(lpAppFileName
, '\\');
67 lpAppFileName
= bslash
+ 1;
68 if (*lpAppFileName
== '\0')
70 SetLastError(ERROR_INVALID_PARAMETER
);
74 res
= RegCreateKeyW(HKEY_LOCAL_MACHINE
, SZ_EXCLUSIONLIST_KEY
, &hkey
);
77 RegSetValueExW(hkey
, lpAppFileName
, 0, REG_DWORD
, (LPBYTE
)&value
, sizeof(value
));
84 /*************************************************************************
85 * AddERExcludedApplicationA [FAULTREP.@]
87 * See AddERExcludedApplicationW
89 BOOL WINAPI
AddERExcludedApplicationA(LPCSTR lpAppFileName
)
91 int len
= MultiByteToWideChar(CP_ACP
, 0, lpAppFileName
, -1, NULL
, 0);
95 TRACE("(%s)\n", wine_dbgstr_a(lpAppFileName
));
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
);
105 /*************************************************************************
106 * ReportFault [FAULTREP.@]
108 EFaultRepRetVal WINAPI
ReportFault(LPEXCEPTION_POINTERS pep
, DWORD dwOpt
)
110 FIXME("%p 0x%x stub\n", pep
, dwOpt
);
114 /***********************************************************************
117 BOOL WINAPI
DllMain(HINSTANCE inst
, DWORD reason
, LPVOID reserved
)
121 case DLL_WINE_PREATTACH
:
123 case DLL_PROCESS_ATTACH
:
124 DisableThreadLibraryCalls(inst
);