hlink: Site data should only be set if the hlink has an HlinkSite.
[wine] / dlls / wer / main.c
1 /*
2  * Copyright 2010 Louis Lenders
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18
19 #include "config.h"
20
21 #include <stdarg.h>
22
23 #include "windef.h"
24 #include "winbase.h"
25 #include "werapi.h"
26 #include "wine/debug.h"
27
28 WINE_DEFAULT_DEBUG_CHANNEL(wer);
29
30 HRESULT WINAPI WerAddExcludedApplication(PCWSTR exeName, BOOL allUsers)
31 {
32     FIXME("(%s, %d) stub\n",debugstr_w(exeName), allUsers);
33     return E_NOTIMPL;
34 }
35
36 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
37 {
38     TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
39
40     switch (fdwReason)
41     {
42         case DLL_WINE_PREATTACH:
43             return FALSE;    /* prefer native version */
44         case DLL_PROCESS_ATTACH:
45             DisableThreadLibraryCalls(hinstDLL);
46             break;
47         case DLL_PROCESS_DETACH:
48             break;
49     }
50
51     return TRUE;
52 }
53
54 /***********************************************************************
55  * WerRemoveExcludedApplication (wer.@)
56  *
57  * remove an application from the exclusion list
58  *
59  * PARAMS
60  *  exeName  [i] The application name
61  *  allUsers [i] for all users (TRUE) or for the current user (FALSE)
62  *
63  * RESULTS
64  *  SUCCESS  S_OK
65  *  FAILURE  A HRESULT error code
66  *
67  */
68 HRESULT WINAPI WerRemoveExcludedApplication(PCWSTR exeName, BOOL allUsers)
69 {
70     FIXME("(%s, %d) :stub\n",debugstr_w(exeName), allUsers);
71     return E_NOTIMPL;
72 }
73
74 /***********************************************************************
75  * WerReportCloseHandle (wer.@)
76  *
77  * Close an error reporting handle and free associated resources
78  *
79  * PARAMS
80  *  hreport [i] error reporting handle to close
81  *
82  * RETURNS
83  *  Success: S_OK
84  *  Failure: A HRESULT error code
85  *
86  */
87 HRESULT WINAPI WerReportCloseHandle(HREPORT hreport)
88 {
89     FIXME("(%p) :stub\n", hreport);
90
91     return E_NOTIMPL;
92 }
93
94 /***********************************************************************
95  * WerReportCreate (wer.@)
96  *
97  * Create an error report in memory and return a related HANDLE
98  *
99  * PARAMS
100  *  eventtype  [i] a name for the event type
101  *  reporttype [i] what type of report should be created
102  *  reportinfo [i] NULL or a ptr to a struct with some detailed information
103  *  phandle    [o] ptr, where the resulting handle should be saved
104  *
105  * RETURNS
106  *  Success: S_OK
107  *  Failure: A HRESULT error code
108  *
109  * NOTES
110  *  The event type must be registered at microsoft. Predefined types are
111  *  "APPCRASH" as the default on Windows, "Crash32" and "Crash64"
112  *
113  */
114 HRESULT WINAPI WerReportCreate(PCWSTR eventtype, WER_REPORT_TYPE reporttype, PWER_REPORT_INFORMATION reportinfo, HREPORT *phandle)
115 {
116
117     FIXME("(%s, %d, %p, %p) :stub\n", debugstr_w(eventtype), reporttype, reportinfo, phandle);
118     if (reportinfo) {
119         TRACE(".wzFriendlyEventName: %s\n", debugstr_w(reportinfo->wzFriendlyEventName));
120         TRACE(".wzApplicationName: %s\n", debugstr_w(reportinfo->wzApplicationName));
121     }
122
123     if (phandle)  *phandle = NULL;
124     if (!eventtype || !eventtype[0] || !phandle) {
125         return E_INVALIDARG;
126     }
127
128     return E_NOTIMPL;
129 }
130
131 /***********************************************************************
132  * WerReportSetParameter (wer.@)
133  *
134  * Set one of 10 parameter / value pairs for a report handle
135  *
136  * PARAMS
137  *  hreport [i] error reporting handle to add the parameter
138  *  id      [i] parameter to set (WER_P0 upto WER_P9)
139  *  name    [i] optional name of the parameter
140  *  value   [i] value of the parameter
141  *
142  * RETURNS
143  *  Success: S_OK
144  *  Failure: A HRESULT error code
145  *
146  */
147 HRESULT WINAPI WerReportSetParameter(HREPORT hreport, DWORD id, PCWSTR name, PCWSTR value)
148 {
149     FIXME("(%p, %d, %s, %s) :stub\n", hreport, id, debugstr_w(name), debugstr_w(value));
150
151     return E_NOTIMPL;
152 }