Fixed two leaks in file- and itemmoniker.
[wine] / dlls / advapi32 / eventlog.c
1 /*
2  * Win32 advapi functions
3  *
4  * Copyright 1995 Sven Verdoolaege, 1998 Juergen Schmied
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include "winbase.h"
22 #include "windef.h"
23 #include "winerror.h"
24 #include "heap.h"
25
26 #include "wine/debug.h"
27
28 WINE_DEFAULT_DEBUG_CHANNEL(advapi);
29
30 /******************************************************************************
31  * BackupEventLogA [ADVAPI32.@]
32  */
33 BOOL WINAPI BackupEventLogA( HANDLE hEventLog, LPCSTR lpBackupFileName )
34 {
35         FIXME("stub\n");
36         return TRUE;
37 }
38
39 /******************************************************************************
40  * BackupEventLogW [ADVAPI32.@]
41  *
42  * PARAMS
43  *   hEventLog        []
44  *   lpBackupFileName []
45  */
46 BOOL WINAPI
47 BackupEventLogW( HANDLE hEventLog, LPCWSTR lpBackupFileName )
48 {
49         FIXME("stub\n");
50         return TRUE;
51 }
52
53 /******************************************************************************
54  * ClearEventLogA [ADVAPI32.@]
55  */
56 BOOL WINAPI ClearEventLogA ( HANDLE hEventLog, LPCSTR lpBackupFileName )
57 {
58         FIXME("stub\n");
59         return TRUE;
60 }
61
62 /******************************************************************************
63  * ClearEventLogW [ADVAPI32.@]
64  */
65 BOOL WINAPI ClearEventLogW ( HANDLE hEventLog, LPCWSTR lpBackupFileName )
66 {
67         FIXME("stub\n");
68         return TRUE;
69 }
70
71 /******************************************************************************
72  * CloseEventLog [ADVAPI32.@]
73  */
74 BOOL WINAPI CloseEventLog ( HANDLE hEventLog )
75 {
76         FIXME("stub\n");
77         return TRUE;
78 }
79
80 /******************************************************************************
81  * DeregisterEventSource [ADVAPI32.@]
82  * Closes a handle to the specified event log
83  *
84  * PARAMS
85  *    hEventLog [I] Handle to event log
86  *
87  * RETURNS STD
88  */
89 BOOL WINAPI DeregisterEventSource( HANDLE hEventLog )
90 {
91     FIXME("(%d): stub\n",hEventLog);
92     return TRUE;
93 }
94
95 /******************************************************************************
96  * GetNumberOfEventLogRecords [ADVAPI32.@]
97  *
98  * PARAMS
99  *   hEventLog       []
100  *   NumberOfRecords []
101  */
102 BOOL WINAPI
103 GetNumberOfEventLogRecords( HANDLE hEventLog, PDWORD NumberOfRecords )
104 {
105         FIXME("stub\n");
106         return TRUE;
107 }
108
109 /******************************************************************************
110  * GetOldestEventLogRecord [ADVAPI32.@]
111  *
112  * PARAMS
113  *   hEventLog    []
114  *   OldestRecord []
115  */
116 BOOL WINAPI
117 GetOldestEventLogRecord( HANDLE hEventLog, PDWORD OldestRecord )
118 {
119         FIXME(":stub\n");
120         return TRUE;
121 }
122
123 /******************************************************************************
124  * NotifyChangeEventLog [ADVAPI32.@]
125  *
126  * PARAMS
127  *   hEventLog []
128  *   hEvent    []
129  */
130 BOOL WINAPI NotifyChangeEventLog( HANDLE hEventLog, HANDLE hEvent )
131 {
132         FIXME("stub\n");
133         return TRUE;
134 }
135
136 /******************************************************************************
137  * OpenBackupEventLogA [ADVAPI32.@]
138  */
139 HANDLE WINAPI
140 OpenBackupEventLogA( LPCSTR lpUNCServerName, LPCSTR lpFileName )
141 {
142         FIXME("stub\n");
143         return TRUE;
144 }
145
146 /******************************************************************************
147  * OpenBackupEventLogW [ADVAPI32.@]
148  *
149  * PARAMS
150  *   lpUNCServerName []
151  *   lpFileName      []
152  */
153 HANDLE WINAPI
154 OpenBackupEventLogW( LPCWSTR lpUNCServerName, LPCWSTR lpFileName )
155 {
156         FIXME("stub\n");
157         return TRUE;
158 }
159
160 /******************************************************************************
161  * OpenEventLogA [ADVAPI32.@]
162  */
163 HANDLE WINAPI OpenEventLogA(LPCSTR uncname,LPCSTR source)
164 {
165         FIXME("(%s,%s),stub!\n",uncname,source);
166         return 0xcafe4242;
167 }
168
169 /******************************************************************************
170  * OpenEventLogW [ADVAPI32.@]
171  *
172  * PARAMS
173  *   uncname []
174  *   source  []
175  */
176 HANDLE WINAPI
177 OpenEventLogW( LPCWSTR uncname, LPCWSTR source )
178 {
179         FIXME("stub\n");
180         return TRUE;
181 }
182
183 /******************************************************************************
184  * ReadEventLogA [ADVAPI32.@]
185  */
186 BOOL WINAPI ReadEventLogA( HANDLE hEventLog, DWORD dwReadFlags, DWORD dwRecordOffset,
187     LPVOID lpBuffer, DWORD nNumberOfBytesToRead, DWORD *pnBytesRead, DWORD *pnMinNumberOfBytesNeeded )
188 {
189         FIXME("stub\n");
190         return TRUE;
191 }
192
193 /******************************************************************************
194  * ReadEventLogW [ADVAPI32.@]
195  *
196  * PARAMS
197  *   hEventLog                []
198  *   dwReadFlags              []
199  *   dwRecordOffset           []
200  *   lpBuffer                 []
201  *   nNumberOfBytesToRead     []
202  *   pnBytesRead              []
203  *   pnMinNumberOfBytesNeeded []
204  */
205 BOOL WINAPI
206 ReadEventLogW( HANDLE hEventLog, DWORD dwReadFlags, DWORD dwRecordOffset,
207                  LPVOID lpBuffer, DWORD nNumberOfBytesToRead,
208                  DWORD *pnBytesRead, DWORD *pnMinNumberOfBytesNeeded )
209 {
210         FIXME("stub\n");
211         return TRUE;
212 }
213
214 /******************************************************************************
215  * RegisterEventSourceA [ADVAPI32.@]
216  */
217 HANDLE WINAPI RegisterEventSourceA( LPCSTR lpUNCServerName, LPCSTR lpSourceName )
218 {
219     LPWSTR lpUNCServerNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpUNCServerName);
220     LPWSTR lpSourceNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpSourceName);
221     HANDLE ret = RegisterEventSourceW(lpUNCServerNameW,lpSourceNameW);
222     HeapFree(GetProcessHeap(),0,lpSourceNameW);
223     HeapFree(GetProcessHeap(),0,lpUNCServerNameW);
224     return ret;
225 }
226
227 /******************************************************************************
228  * RegisterEventSourceW [ADVAPI32.@]
229  * Returns a registered handle to an event log
230  *
231  * PARAMS
232  *   lpUNCServerName [I] Server name for source
233  *   lpSourceName    [I] Source name for registered handle
234  *
235  * RETURNS
236  *    Success: Handle
237  *    Failure: NULL
238  */
239 HANDLE WINAPI
240 RegisterEventSourceW( LPCWSTR lpUNCServerName, LPCWSTR lpSourceName )
241 {
242     FIXME("(%s,%s): stub\n", debugstr_w(lpUNCServerName),
243           debugstr_w(lpSourceName));
244     return 1;
245 }
246
247 /******************************************************************************
248  * ReportEventA [ADVAPI32.@]
249  */
250 BOOL WINAPI ReportEventA ( HANDLE hEventLog, WORD wType, WORD wCategory, DWORD dwEventID,
251     PSID lpUserSid, WORD wNumStrings, DWORD dwDataSize, LPCSTR *lpStrings, LPVOID lpRawData)
252 {
253         FIXME("stub\n");
254         return TRUE;
255 }
256
257 /******************************************************************************
258  * ReportEventW [ADVAPI32.@]
259  *
260  * PARAMS
261  *   hEventLog   []
262  *   wType       []
263  *   wCategory   []
264  *   dwEventID   []
265  *   lpUserSid   []
266  *   wNumStrings []
267  *   dwDataSize  []
268  *   lpStrings   []
269  *   lpRawData   []
270  */
271 BOOL WINAPI
272 ReportEventW( HANDLE hEventLog, WORD wType, WORD wCategory,
273                 DWORD dwEventID, PSID lpUserSid, WORD wNumStrings,
274                 DWORD dwDataSize, LPCWSTR *lpStrings, LPVOID lpRawData )
275 {
276         FIXME("stub\n");
277         return TRUE;
278 }