Commit ae1d5912 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

advapi32: Switch to heap helpers in the rest of the code.

parent 5f52333d
...@@ -59,7 +59,7 @@ GetUserNameA( LPSTR lpszName, LPDWORD lpSize ) ...@@ -59,7 +59,7 @@ GetUserNameA( LPSTR lpszName, LPDWORD lpSize )
BOOL ret; BOOL ret;
DWORD sizeW = *lpSize; DWORD sizeW = *lpSize;
if (!(buffer = HeapAlloc( GetProcessHeap(), 0, sizeW * sizeof(WCHAR) ))) if (!(buffer = heap_alloc( sizeW * sizeof(WCHAR) )))
{ {
SetLastError( ERROR_NOT_ENOUGH_MEMORY ); SetLastError( ERROR_NOT_ENOUGH_MEMORY );
return FALSE; return FALSE;
...@@ -71,7 +71,7 @@ GetUserNameA( LPSTR lpszName, LPDWORD lpSize ) ...@@ -71,7 +71,7 @@ GetUserNameA( LPSTR lpszName, LPDWORD lpSize )
else else
*lpSize = sizeW; *lpSize = sizeW;
HeapFree( GetProcessHeap(), 0, buffer ); heap_free( buffer );
return ret; return ret;
} }
......
...@@ -59,7 +59,7 @@ BOOL WINAPI BackupEventLogA( HANDLE hEventLog, LPCSTR lpBackupFileName ) ...@@ -59,7 +59,7 @@ BOOL WINAPI BackupEventLogA( HANDLE hEventLog, LPCSTR lpBackupFileName )
backupW = SERV_dup(lpBackupFileName); backupW = SERV_dup(lpBackupFileName);
ret = BackupEventLogW(hEventLog, backupW); ret = BackupEventLogW(hEventLog, backupW);
HeapFree(GetProcessHeap(), 0, backupW); heap_free(backupW);
return ret; return ret;
} }
...@@ -116,7 +116,7 @@ BOOL WINAPI ClearEventLogA( HANDLE hEventLog, LPCSTR lpBackupFileName ) ...@@ -116,7 +116,7 @@ BOOL WINAPI ClearEventLogA( HANDLE hEventLog, LPCSTR lpBackupFileName )
backupW = SERV_dup(lpBackupFileName); backupW = SERV_dup(lpBackupFileName);
ret = ClearEventLogW(hEventLog, backupW); ret = ClearEventLogW(hEventLog, backupW);
HeapFree(GetProcessHeap(), 0, backupW); heap_free(backupW);
return ret; return ret;
} }
...@@ -447,8 +447,8 @@ HANDLE WINAPI OpenBackupEventLogA( LPCSTR lpUNCServerName, LPCSTR lpFileName ) ...@@ -447,8 +447,8 @@ HANDLE WINAPI OpenBackupEventLogA( LPCSTR lpUNCServerName, LPCSTR lpFileName )
uncnameW = SERV_dup(lpUNCServerName); uncnameW = SERV_dup(lpUNCServerName);
filenameW = SERV_dup(lpFileName); filenameW = SERV_dup(lpFileName);
handle = OpenBackupEventLogW(uncnameW, filenameW); handle = OpenBackupEventLogW(uncnameW, filenameW);
HeapFree(GetProcessHeap(), 0, uncnameW); heap_free(uncnameW);
HeapFree(GetProcessHeap(), 0, filenameW); heap_free(filenameW);
return handle; return handle;
} }
...@@ -506,8 +506,8 @@ HANDLE WINAPI OpenEventLogA( LPCSTR uncname, LPCSTR source ) ...@@ -506,8 +506,8 @@ HANDLE WINAPI OpenEventLogA( LPCSTR uncname, LPCSTR source )
uncnameW = SERV_dup(uncname); uncnameW = SERV_dup(uncname);
sourceW = SERV_dup(source); sourceW = SERV_dup(source);
handle = OpenEventLogW(uncnameW, sourceW); handle = OpenEventLogW(uncnameW, sourceW);
HeapFree(GetProcessHeap(), 0, uncnameW); heap_free(uncnameW);
HeapFree(GetProcessHeap(), 0, sourceW); heap_free(sourceW);
return handle; return handle;
} }
...@@ -688,7 +688,7 @@ BOOL WINAPI ReportEventA ( HANDLE hEventLog, WORD wType, WORD wCategory, DWORD d ...@@ -688,7 +688,7 @@ BOOL WINAPI ReportEventA ( HANDLE hEventLog, WORD wType, WORD wCategory, DWORD d
if (wNumStrings == 0) return TRUE; if (wNumStrings == 0) return TRUE;
if (!lpStrings) return TRUE; if (!lpStrings) return TRUE;
wideStrArray = HeapAlloc(GetProcessHeap(), 0, sizeof(LPWSTR) * wNumStrings); wideStrArray = heap_alloc(sizeof(LPWSTR) * wNumStrings);
for (i = 0; i < wNumStrings; i++) for (i = 0; i < wNumStrings; i++)
{ {
RtlCreateUnicodeStringFromAsciiz(&str, lpStrings[i]); RtlCreateUnicodeStringFromAsciiz(&str, lpStrings[i]);
...@@ -697,10 +697,8 @@ BOOL WINAPI ReportEventA ( HANDLE hEventLog, WORD wType, WORD wCategory, DWORD d ...@@ -697,10 +697,8 @@ BOOL WINAPI ReportEventA ( HANDLE hEventLog, WORD wType, WORD wCategory, DWORD d
ret = ReportEventW(hEventLog, wType, wCategory, dwEventID, lpUserSid, ret = ReportEventW(hEventLog, wType, wCategory, dwEventID, lpUserSid,
wNumStrings, dwDataSize, (LPCWSTR *)wideStrArray, lpRawData); wNumStrings, dwDataSize, (LPCWSTR *)wideStrArray, lpRawData);
for (i = 0; i < wNumStrings; i++) for (i = 0; i < wNumStrings; i++)
{ heap_free( wideStrArray[i] );
HeapFree( GetProcessHeap(), 0, wideStrArray[i] ); heap_free(wideStrArray);
}
HeapFree(GetProcessHeap(), 0, wideStrArray);
return ret; return ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment