2 * Win32 advapi functions
4 * Copyright 1995 Sven Verdoolaege
5 * Copyright 1998 Juergen Schmied
6 * Copyright 2003 Mike Hearn
7 * Copyright 2007 Hervé Poussineau
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 WINE_DEFAULT_DEBUG_CHANNEL(advapi
);
27 static RPC_UNICODE_STRING EmptyStringU
= { 0, 0, L
"" };
28 static RPC_STRING EmptyStringA
= { 0, 0, "" };
32 EVENTLOG_HANDLE_A_bind(EVENTLOG_HANDLE_A UNCServerName
)
34 handle_t hBinding
= NULL
;
35 UCHAR
*pszStringBinding
;
38 TRACE("EVENTLOG_HANDLE_A_bind() called\n");
40 status
= RpcStringBindingComposeA(NULL
,
42 (UCHAR
*)UNCServerName
,
43 (UCHAR
*)"\\pipe\\EventLog",
45 (UCHAR
**)&pszStringBinding
);
48 ERR("RpcStringBindingCompose returned 0x%x\n", status
);
52 /* Set the binding handle that will be used to bind to the server. */
53 status
= RpcBindingFromStringBindingA(pszStringBinding
,
57 ERR("RpcBindingFromStringBinding returned 0x%x\n", status
);
60 status
= RpcStringFreeA(&pszStringBinding
);
63 ERR("RpcStringFree returned 0x%x\n", status
);
71 EVENTLOG_HANDLE_A_unbind(EVENTLOG_HANDLE_A UNCServerName
,
76 TRACE("EVENTLOG_HANDLE_A_unbind() called\n");
78 status
= RpcBindingFree(&hBinding
);
81 ERR("RpcBindingFree returned 0x%x\n", status
);
87 EVENTLOG_HANDLE_W_bind(EVENTLOG_HANDLE_W UNCServerName
)
89 handle_t hBinding
= NULL
;
90 LPWSTR pszStringBinding
;
93 TRACE("EVENTLOG_HANDLE_W_bind() called\n");
95 status
= RpcStringBindingComposeW(NULL
,
97 (LPWSTR
)UNCServerName
,
103 ERR("RpcStringBindingCompose returned 0x%x\n", status
);
107 /* Set the binding handle that will be used to bind to the server. */
108 status
= RpcBindingFromStringBindingW(pszStringBinding
,
112 ERR("RpcBindingFromStringBinding returned 0x%x\n", status
);
115 status
= RpcStringFreeW(&pszStringBinding
);
118 ERR("RpcStringFree returned 0x%x\n", status
);
126 EVENTLOG_HANDLE_W_unbind(EVENTLOG_HANDLE_W UNCServerName
,
131 TRACE("EVENTLOG_HANDLE_W_unbind() called\n");
133 status
= RpcBindingFree(&hBinding
);
136 ERR("RpcBindingFree returned 0x%x\n", status
);
141 /******************************************************************************
142 * BackupEventLogA [ADVAPI32.@]
145 BackupEventLogA(IN HANDLE hEventLog
,
146 IN LPCSTR lpBackupFileName
)
148 ANSI_STRING BackupFileName
;
151 TRACE("%p, %s\n", hEventLog
, lpBackupFileName
);
153 RtlInitAnsiString(&BackupFileName
, lpBackupFileName
);
157 Status
= ElfrBackupELFA(hEventLog
,
158 (PRPC_STRING
)&BackupFileName
);
160 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
162 Status
= I_RpcMapWin32Status(RpcExceptionCode());
166 if (!NT_SUCCESS(Status
))
168 SetLastError(RtlNtStatusToDosError(Status
));
175 /******************************************************************************
176 * BackupEventLogW [ADVAPI32.@]
180 * lpBackupFileName []
183 BackupEventLogW(IN HANDLE hEventLog
,
184 IN LPCWSTR lpBackupFileName
)
186 UNICODE_STRING BackupFileName
;
189 TRACE("%p, %s\n", hEventLog
, debugstr_w(lpBackupFileName
));
191 RtlInitUnicodeString(&BackupFileName
, lpBackupFileName
);
195 Status
= ElfrBackupELFW(hEventLog
,
196 (PRPC_UNICODE_STRING
)&BackupFileName
);
198 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
200 Status
= I_RpcMapWin32Status(RpcExceptionCode());
204 if (!NT_SUCCESS(Status
))
206 SetLastError(RtlNtStatusToDosError(Status
));
214 /******************************************************************************
215 * ClearEventLogA [ADVAPI32.@]
218 ClearEventLogA(IN HANDLE hEventLog
,
219 IN LPCSTR lpBackupFileName
)
221 ANSI_STRING BackupFileName
;
224 TRACE("%p, %s\n", hEventLog
, lpBackupFileName
);
226 RtlInitAnsiString(&BackupFileName
, lpBackupFileName
);
230 Status
= ElfrClearELFA(hEventLog
,
231 (PRPC_STRING
)&BackupFileName
);
233 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
235 Status
= I_RpcMapWin32Status(RpcExceptionCode());
239 if (!NT_SUCCESS(Status
))
241 SetLastError(RtlNtStatusToDosError(Status
));
249 /******************************************************************************
250 * ClearEventLogW [ADVAPI32.@]
253 ClearEventLogW(IN HANDLE hEventLog
,
254 IN LPCWSTR lpBackupFileName
)
256 UNICODE_STRING BackupFileName
;
259 TRACE("%p, %s\n", hEventLog
, debugstr_w(lpBackupFileName
));
261 RtlInitUnicodeString(&BackupFileName
,lpBackupFileName
);
265 Status
= ElfrClearELFW(hEventLog
,
266 (PRPC_UNICODE_STRING
)&BackupFileName
);
268 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
270 Status
= I_RpcMapWin32Status(RpcExceptionCode());
274 if (!NT_SUCCESS(Status
))
276 SetLastError(RtlNtStatusToDosError(Status
));
284 /******************************************************************************
285 * CloseEventLog [ADVAPI32.@]
288 CloseEventLog(IN HANDLE hEventLog
)
292 TRACE("%p\n", hEventLog
);
296 Status
= ElfrCloseEL(&hEventLog
);
298 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
300 Status
= I_RpcMapWin32Status(RpcExceptionCode());
304 if (!NT_SUCCESS(Status
))
306 SetLastError(RtlNtStatusToDosError(Status
));
314 /******************************************************************************
315 * DeregisterEventSource [ADVAPI32.@]
316 * Closes a handle to the specified event log
319 * hEventLog [I] Handle to event log
324 DeregisterEventSource(IN HANDLE hEventLog
)
328 TRACE("%p\n", hEventLog
);
332 Status
= ElfrDeregisterEventSource(&hEventLog
);
334 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
336 Status
= I_RpcMapWin32Status(RpcExceptionCode());
340 if (!NT_SUCCESS(Status
))
342 SetLastError(RtlNtStatusToDosError(Status
));
350 /******************************************************************************
351 * GetEventLogInformation [ADVAPI32.@]
354 * hEventLog [I] Handle to event log
355 * dwInfoLevel [I] Level of event log information to return
356 * lpBuffer [O] Buffer that receives the event log information
357 * cbBufSize [I] Size of the lpBuffer buffer
358 * pcbBytesNeeded [O] Required buffer size
361 GetEventLogInformation(IN HANDLE hEventLog
,
362 IN DWORD dwInfoLevel
,
365 OUT LPDWORD pcbBytesNeeded
)
369 if (dwInfoLevel
!= EVENTLOG_FULL_INFO
)
371 SetLastError(ERROR_INVALID_LEVEL
);
377 Status
= ElfrGetLogInformation(hEventLog
,
383 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
385 Status
= I_RpcMapWin32Status(RpcExceptionCode());
389 if (!NT_SUCCESS(Status
))
391 SetLastError(RtlNtStatusToDosError(Status
));
399 /******************************************************************************
400 * GetNumberOfEventLogRecords [ADVAPI32.@]
407 GetNumberOfEventLogRecords(IN HANDLE hEventLog
,
408 OUT PDWORD NumberOfRecords
)
413 TRACE("%p, %p\n", hEventLog
, NumberOfRecords
);
417 SetLastError(ERROR_INVALID_PARAMETER
);
423 Status
= ElfrNumberOfRecords(hEventLog
,
426 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
428 Status
= I_RpcMapWin32Status(RpcExceptionCode());
432 if (!NT_SUCCESS(Status
))
434 SetLastError(RtlNtStatusToDosError(Status
));
438 *NumberOfRecords
= Records
;
444 /******************************************************************************
445 * GetOldestEventLogRecord [ADVAPI32.@]
452 GetOldestEventLogRecord(IN HANDLE hEventLog
,
453 OUT PDWORD OldestRecord
)
458 TRACE("%p, %p\n", hEventLog
, OldestRecord
);
462 SetLastError(ERROR_INVALID_PARAMETER
);
468 Status
= ElfrOldestRecord(hEventLog
,
471 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
473 Status
= I_RpcMapWin32Status(RpcExceptionCode());
477 if (!NT_SUCCESS(Status
))
479 SetLastError(RtlNtStatusToDosError(Status
));
483 *OldestRecord
= Oldest
;
489 /******************************************************************************
490 * NotifyChangeEventLog [ADVAPI32.@]
497 NotifyChangeEventLog(IN HANDLE hEventLog
,
500 /* Use ElfrChangeNotify */
502 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
507 /******************************************************************************
508 * OpenBackupEventLogA [ADVAPI32.@]
511 OpenBackupEventLogA(IN LPCSTR lpUNCServerName
,
512 IN LPCSTR lpFileName
)
514 ANSI_STRING FileName
;
515 IELF_HANDLE LogHandle
;
518 TRACE("%s, %s\n", lpUNCServerName
, lpFileName
);
520 RtlInitAnsiString(&FileName
, lpFileName
);
524 Status
= ElfrOpenBELA((LPSTR
)lpUNCServerName
,
525 (PRPC_STRING
)&FileName
,
530 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
532 Status
= I_RpcMapWin32Status(RpcExceptionCode());
536 if (!NT_SUCCESS(Status
))
538 SetLastError(RtlNtStatusToDosError(Status
));
542 return (HANDLE
)LogHandle
;
546 /******************************************************************************
547 * OpenBackupEventLogW [ADVAPI32.@]
554 OpenBackupEventLogW(IN LPCWSTR lpUNCServerName
,
555 IN LPCWSTR lpFileName
)
557 UNICODE_STRING FileName
;
558 IELF_HANDLE LogHandle
;
561 TRACE("%s, %s\n", debugstr_w(lpUNCServerName
), debugstr_w(lpFileName
));
563 RtlInitUnicodeString(&FileName
, lpFileName
);
567 Status
= ElfrOpenBELW((LPWSTR
)lpUNCServerName
,
568 (PRPC_UNICODE_STRING
)&FileName
,
573 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
575 Status
= I_RpcMapWin32Status(RpcExceptionCode());
579 if (!NT_SUCCESS(Status
))
581 SetLastError(RtlNtStatusToDosError(Status
));
585 return (HANDLE
)LogHandle
;
589 /******************************************************************************
590 * OpenEventLogA [ADVAPI32.@]
592 * Opens a handle to the specified event log.
595 * lpUNCServerName [I] UNC name of the server on which the event log is
597 * lpSourceName [I] Name of the log.
600 * Success: Handle to an event log.
604 OpenEventLogA(IN LPCSTR lpUNCServerName
,
605 IN LPCSTR lpSourceName
)
608 ANSI_STRING SourceName
;
609 IELF_HANDLE LogHandle
= NULL
;
612 TRACE("%s, %s\n", lpUNCServerName
, lpSourceName
);
614 if (lpSourceName
== NULL
)
616 SetLastError(ERROR_INVALID_PARAMETER
);
620 if (lpUNCServerName
== NULL
|| *lpUNCServerName
== 0)
621 UNCServerName
= NULL
;
623 UNCServerName
= (LPSTR
)lpUNCServerName
;
625 RtlInitAnsiString(&SourceName
, lpSourceName
);
629 Status
= ElfrOpenELA(UNCServerName
,
630 (PRPC_STRING
)&SourceName
,
636 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
638 Status
= I_RpcMapWin32Status(RpcExceptionCode());
642 if (!NT_SUCCESS(Status
))
644 SetLastError(RtlNtStatusToDosError(Status
));
648 return (HANDLE
)LogHandle
;
652 /******************************************************************************
653 * OpenEventLogW [ADVAPI32.@]
660 OpenEventLogW(IN LPCWSTR lpUNCServerName
,
661 IN LPCWSTR lpSourceName
)
663 LPWSTR UNCServerName
;
664 UNICODE_STRING SourceName
;
665 IELF_HANDLE LogHandle
;
668 TRACE("%s, %s\n", debugstr_w(lpUNCServerName
), debugstr_w(lpSourceName
));
670 if (lpSourceName
== NULL
)
672 SetLastError(ERROR_INVALID_PARAMETER
);
676 if (lpUNCServerName
== NULL
|| *lpUNCServerName
== 0)
677 UNCServerName
= NULL
;
679 UNCServerName
= (LPWSTR
)lpUNCServerName
;
681 RtlInitUnicodeString(&SourceName
, lpSourceName
);
685 Status
= ElfrOpenELW(UNCServerName
,
686 (PRPC_UNICODE_STRING
)&SourceName
,
692 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
694 Status
= I_RpcMapWin32Status(RpcExceptionCode());
698 if (!NT_SUCCESS(Status
))
700 SetLastError(RtlNtStatusToDosError(Status
));
704 return (HANDLE
)LogHandle
;
708 /******************************************************************************
709 * ReadEventLogA [ADVAPI32.@]
712 ReadEventLogA(IN HANDLE hEventLog
,
713 IN DWORD dwReadFlags
,
714 IN DWORD dwRecordOffset
,
716 IN DWORD nNumberOfBytesToRead
,
717 OUT DWORD
*pnBytesRead
,
718 OUT DWORD
*pnMinNumberOfBytesNeeded
)
721 DWORD bytesRead
, minNumberOfBytesNeeded
;
723 TRACE("%p, %lu, %lu, %p, %lu, %p, %p\n",
724 hEventLog
, dwReadFlags
, dwRecordOffset
, lpBuffer
,
725 nNumberOfBytesToRead
, pnBytesRead
, pnMinNumberOfBytesNeeded
);
727 if(!pnBytesRead
|| !pnMinNumberOfBytesNeeded
)
729 SetLastError(ERROR_INVALID_PARAMETER
);
733 /* If buffer is NULL set nNumberOfBytesToRead to 0 to prevent rpcrt4 from
734 trying to access a null pointer */
737 nNumberOfBytesToRead
= 0;
742 Status
= ElfrReadELA(hEventLog
,
745 nNumberOfBytesToRead
,
748 &minNumberOfBytesNeeded
);
750 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
752 Status
= I_RpcMapWin32Status(RpcExceptionCode());
756 *pnBytesRead
= (DWORD
)bytesRead
;
757 *pnMinNumberOfBytesNeeded
= (DWORD
)minNumberOfBytesNeeded
;
759 if (!NT_SUCCESS(Status
))
761 SetLastError(RtlNtStatusToDosError(Status
));
769 /******************************************************************************
770 * ReadEventLogW [ADVAPI32.@]
777 * nNumberOfBytesToRead []
779 * pnMinNumberOfBytesNeeded []
782 ReadEventLogW(IN HANDLE hEventLog
,
783 IN DWORD dwReadFlags
,
784 IN DWORD dwRecordOffset
,
786 IN DWORD nNumberOfBytesToRead
,
787 OUT DWORD
*pnBytesRead
,
788 OUT DWORD
*pnMinNumberOfBytesNeeded
)
791 DWORD bytesRead
, minNumberOfBytesNeeded
;
793 TRACE("%p, %lu, %lu, %p, %lu, %p, %p\n",
794 hEventLog
, dwReadFlags
, dwRecordOffset
, lpBuffer
,
795 nNumberOfBytesToRead
, pnBytesRead
, pnMinNumberOfBytesNeeded
);
797 if(!pnBytesRead
|| !pnMinNumberOfBytesNeeded
)
799 SetLastError(ERROR_INVALID_PARAMETER
);
803 /* If buffer is NULL set nNumberOfBytesToRead to 0 to prevent rpcrt4 from
804 trying to access a null pointer */
807 nNumberOfBytesToRead
= 0;
812 Status
= ElfrReadELW(hEventLog
,
815 nNumberOfBytesToRead
,
818 &minNumberOfBytesNeeded
);
820 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
822 Status
= I_RpcMapWin32Status(RpcExceptionCode());
826 *pnBytesRead
= (DWORD
)bytesRead
;
827 *pnMinNumberOfBytesNeeded
= (DWORD
)minNumberOfBytesNeeded
;
829 if (!NT_SUCCESS(Status
))
831 SetLastError(RtlNtStatusToDosError(Status
));
839 /******************************************************************************
840 * RegisterEventSourceA [ADVAPI32.@]
843 RegisterEventSourceA(IN LPCSTR lpUNCServerName
,
844 IN LPCSTR lpSourceName
)
846 ANSI_STRING SourceName
;
847 IELF_HANDLE LogHandle
;
850 TRACE("%s, %s\n", lpUNCServerName
, lpSourceName
);
852 RtlInitAnsiString(&SourceName
, lpSourceName
);
856 Status
= ElfrRegisterEventSourceA((LPSTR
)lpUNCServerName
,
857 (PRPC_STRING
)&SourceName
,
863 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
865 Status
= I_RpcMapWin32Status(RpcExceptionCode());
869 if (!NT_SUCCESS(Status
))
871 SetLastError(RtlNtStatusToDosError(Status
));
875 return (HANDLE
)LogHandle
;
879 /******************************************************************************
880 * RegisterEventSourceW [ADVAPI32.@]
881 * Returns a registered handle to an event log
884 * lpUNCServerName [I] Server name for source
885 * lpSourceName [I] Source name for registered handle
892 RegisterEventSourceW(IN LPCWSTR lpUNCServerName
,
893 IN LPCWSTR lpSourceName
)
895 UNICODE_STRING SourceName
;
896 IELF_HANDLE LogHandle
;
899 TRACE("%s, %s\n", debugstr_w(lpUNCServerName
), debugstr_w(lpSourceName
));
901 RtlInitUnicodeString(&SourceName
, lpSourceName
);
905 Status
= ElfrRegisterEventSourceW((LPWSTR
)lpUNCServerName
,
906 (PRPC_UNICODE_STRING
)&SourceName
,
912 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
914 Status
= I_RpcMapWin32Status(RpcExceptionCode());
918 if (!NT_SUCCESS(Status
))
920 SetLastError(RtlNtStatusToDosError(Status
));
924 return (HANDLE
)LogHandle
;
928 /******************************************************************************
929 * ReportEventA [ADVAPI32.@]
932 ReportEventA(IN HANDLE hEventLog
,
939 IN LPCSTR
*lpStrings
,
943 PANSI_STRING
*Strings
;
944 ANSI_STRING ComputerName
;
946 CHAR szComputerName
[MAX_COMPUTERNAME_LENGTH
+ 1];
948 LARGE_INTEGER SystemTime
;
951 TRACE("%p, %u, %u, %lu, %p, %u, %lu, %p, %p\n",
952 hEventLog
, wType
, wCategory
, dwEventID
, lpUserSid
,
953 wNumStrings
, dwDataSize
, lpStrings
, lpRawData
);
955 Strings
= HeapAlloc(GetProcessHeap(),
957 wNumStrings
* sizeof(PANSI_STRING
));
960 SetLastError(ERROR_NOT_ENOUGH_MEMORY
);
964 for (i
= 0; i
< wNumStrings
; i
++)
966 Strings
[i
] = HeapAlloc(GetProcessHeap(),
968 sizeof(ANSI_STRING
));
971 RtlInitAnsiString(Strings
[i
], lpStrings
[i
]);
975 dwSize
= MAX_COMPUTERNAME_LENGTH
+ 1;
976 GetComputerNameA(szComputerName
, &dwSize
);
977 RtlInitAnsiString(&ComputerName
, szComputerName
);
979 NtQuerySystemTime(&SystemTime
);
980 RtlTimeToSecondsSince1970(&SystemTime
, &Seconds
);
984 Status
= ElfrReportEventA(hEventLog
,
991 (PRPC_STRING
)&ComputerName
,
993 (PRPC_STRING
*)Strings
,
999 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
1001 Status
= I_RpcMapWin32Status(RpcExceptionCode());
1005 for (i
= 0; i
< wNumStrings
; i
++)
1007 if (Strings
[i
] != NULL
)
1008 HeapFree(GetProcessHeap(), 0, Strings
[i
]);
1011 HeapFree(GetProcessHeap(), 0, Strings
);
1013 if (!NT_SUCCESS(Status
))
1015 SetLastError(RtlNtStatusToDosError(Status
));
1023 /******************************************************************************
1024 * ReportEventW [ADVAPI32.@]
1038 ReportEventW(IN HANDLE hEventLog
,
1043 IN WORD wNumStrings
,
1044 IN DWORD dwDataSize
,
1045 IN LPCWSTR
*lpStrings
,
1046 IN LPVOID lpRawData
)
1049 PUNICODE_STRING
*Strings
;
1050 UNICODE_STRING ComputerName
;
1052 WCHAR szComputerName
[MAX_COMPUTERNAME_LENGTH
+ 1];
1054 LARGE_INTEGER SystemTime
;
1057 TRACE("%p, %u, %u, %lu, %p, %u, %lu, %p, %p\n",
1058 hEventLog
, wType
, wCategory
, dwEventID
, lpUserSid
,
1059 wNumStrings
, dwDataSize
, lpStrings
, lpRawData
);
1061 Strings
= HeapAlloc(GetProcessHeap(),
1063 wNumStrings
* sizeof(PUNICODE_STRING
));
1066 SetLastError(ERROR_NOT_ENOUGH_MEMORY
);
1070 for (i
= 0; i
< wNumStrings
; i
++)
1072 Strings
[i
] = HeapAlloc(GetProcessHeap(),
1074 sizeof(ANSI_STRING
));
1077 RtlInitUnicodeString(Strings
[i
], lpStrings
[i
]);
1081 dwSize
= MAX_COMPUTERNAME_LENGTH
+ 1;
1082 GetComputerNameW(szComputerName
, &dwSize
);
1083 RtlInitUnicodeString(&ComputerName
, szComputerName
);
1085 NtQuerySystemTime(&SystemTime
);
1086 RtlTimeToSecondsSince1970(&SystemTime
, &Seconds
);
1090 Status
= ElfrReportEventW(hEventLog
,
1097 (PRPC_UNICODE_STRING
)&ComputerName
,
1099 (PRPC_UNICODE_STRING
*)Strings
,
1105 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
1107 Status
= I_RpcMapWin32Status(RpcExceptionCode());
1111 for (i
= 0; i
< wNumStrings
; i
++)
1113 if (Strings
[i
] != NULL
)
1114 HeapFree(GetProcessHeap(), 0, Strings
[i
]);
1117 HeapFree(GetProcessHeap(), 0, Strings
);
1119 if (!NT_SUCCESS(Status
))
1121 SetLastError(RtlNtStatusToDosError(Status
));