ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

faultrep.c
Go to the documentation of this file.
00001 /* Fault report handling
00002  *
00003  * Copyright 2007 Peter Dons Tychsen
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Lesser General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2.1 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this library; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00018  */
00019 
00020 #include <stdarg.h>
00021 
00022 #include "windef.h"
00023 #include "winbase.h"
00024 #include "winnls.h"
00025 #include "winreg.h"
00026 #include "wine/debug.h"
00027 #include "wine/unicode.h"
00028 
00029 #include "errorrep.h"
00030 
00031 WINE_DEFAULT_DEBUG_CHANNEL(faultrep);
00032 
00033 static const WCHAR SZ_EXCLUSIONLIST_KEY[] = {
00034     'S','o','f','t','w','a','r','e','\\',
00035     'M','i','c','r','o','s','o','f','t','\\',
00036     'P','C','H','e','a','l','t','h','\\',
00037     'E','r','r','o','r','R','e','p','o','r','t','i','n','g','\\',
00038     'E','x','c','l','u','s','i','o','n','L','i','s','t', 0};
00039 
00040 /*************************************************************************
00041  * AddERExcludedApplicationW  [FAULTREP.@]
00042  *
00043  * Adds an application to a list of applications for which fault reports
00044  * shouldn't be generated
00045  *
00046  * PARAMS
00047  * lpAppFileName  [I] The filename of the application executable
00048  *
00049  * RETURNS
00050  * TRUE on success, FALSE of failure
00051  *
00052  * NOTES
00053  * Wine doesn't use this data but stores it in the registry (in the same place
00054  * as Windows would) in case it will be useful in a future version
00055  *
00056  * According to MSDN this function should succeed even if the user has no write
00057  * access to HKLM. This probably means that there is no error checking.
00058  */
00059 BOOL WINAPI AddERExcludedApplicationW(LPCWSTR lpAppFileName)
00060 {
00061     WCHAR *bslash;
00062     DWORD value = 1;
00063     HKEY hkey;
00064 
00065     TRACE("(%s)\n", wine_dbgstr_w(lpAppFileName));
00066     bslash = strrchrW(lpAppFileName, '\\');
00067     if (bslash != NULL)
00068         lpAppFileName = bslash + 1;
00069     if (*lpAppFileName == '\0')
00070     {
00071         SetLastError(ERROR_INVALID_PARAMETER);
00072         return FALSE;
00073     }
00074 
00075     if (!RegCreateKeyW(HKEY_LOCAL_MACHINE, SZ_EXCLUSIONLIST_KEY, &hkey))
00076     {
00077         RegSetValueExW(hkey, lpAppFileName, 0, REG_DWORD, (LPBYTE)&value, sizeof(value));
00078         RegCloseKey(hkey);
00079     }
00080 
00081     return TRUE;
00082 }
00083 
00084 /*************************************************************************
00085  * AddERExcludedApplicationA  [FAULTREP.@]
00086  *
00087  * See AddERExcludedApplicationW
00088  */
00089 BOOL WINAPI AddERExcludedApplicationA(LPCSTR lpAppFileName)
00090 {
00091     int len = MultiByteToWideChar(CP_ACP, 0, lpAppFileName, -1, NULL, 0);
00092     WCHAR *wstr;
00093     BOOL ret;
00094 
00095     TRACE("(%s)\n", wine_dbgstr_a(lpAppFileName));
00096     if (len == 0)
00097         return FALSE;
00098     wstr = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*len);
00099     MultiByteToWideChar(CP_ACP, 0, lpAppFileName, -1, wstr, len);
00100     ret = AddERExcludedApplicationW(wstr);
00101     HeapFree(GetProcessHeap(), 0, wstr);
00102     return ret;
00103 }
00104 
00105 /*************************************************************************
00106  * ReportFault  [FAULTREP.@]
00107  */
00108 EFaultRepRetVal WINAPI ReportFault(LPEXCEPTION_POINTERS pep, DWORD dwOpt)
00109 {
00110     FIXME("%p 0x%x stub\n", pep, dwOpt);
00111     return frrvOk;
00112 }
00113 
00114 /***********************************************************************
00115  * DllMain.
00116  */
00117 BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved)
00118 {
00119     switch(reason)
00120     {
00121     case DLL_WINE_PREATTACH:
00122         return FALSE;
00123     case DLL_PROCESS_ATTACH:
00124         DisableThreadLibraryCalls(inst);
00125         break;
00126     case DLL_PROCESS_DETACH:
00127         break;
00128     }
00129     return TRUE;
00130 }

Generated on Mon May 28 2012 04:23:09 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.