Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
6f2a071d
Commit
6f2a071d
authored
Jan 20, 2003
by
Matthew Davison
Committed by
Alexandre Julliard
Jan 20, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove some calls to HEAP_strdupAtoW from advapi32.
parent
0c391fe3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
36 deletions
+62
-36
eventlog.c
dlls/advapi32/eventlog.c
+10
-5
registry.c
dlls/advapi32/registry.c
+31
-16
security.c
dlls/advapi32/security.c
+7
-5
service.c
dlls/advapi32/service.c
+14
-10
No files found.
dlls/advapi32/eventlog.c
View file @
6f2a071d
...
...
@@ -22,6 +22,7 @@
#include "windef.h"
#include "winerror.h"
#include "heap.h"
#include "winternl.h"
#include "wine/debug.h"
...
...
@@ -216,11 +217,15 @@ ReadEventLogW( HANDLE hEventLog, DWORD dwReadFlags, DWORD dwRecordOffset,
*/
HANDLE
WINAPI
RegisterEventSourceA
(
LPCSTR
lpUNCServerName
,
LPCSTR
lpSourceName
)
{
LPWSTR
lpUNCServerNameW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
lpUNCServerName
);
LPWSTR
lpSourceNameW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
lpSourceName
);
HANDLE
ret
=
RegisterEventSourceW
(
lpUNCServerNameW
,
lpSourceNameW
);
HeapFree
(
GetProcessHeap
(),
0
,
lpSourceNameW
);
HeapFree
(
GetProcessHeap
(),
0
,
lpUNCServerNameW
);
UNICODE_STRING
lpUNCServerNameW
;
UNICODE_STRING
lpSourceNameW
;
HANDLE
ret
;
RtlCreateUnicodeStringFromAsciiz
(
&
lpUNCServerNameW
,
lpUNCServerName
);
RtlCreateUnicodeStringFromAsciiz
(
&
lpSourceNameW
,
lpSourceName
);
ret
=
RegisterEventSourceW
(
lpUNCServerNameW
.
Buffer
,
lpSourceNameW
.
Buffer
);
RtlFreeUnicodeString
(
&
lpUNCServerNameW
);
RtlFreeUnicodeString
(
&
lpSourceNameW
);
return
ret
;
}
...
...
dlls/advapi32/registry.c
View file @
6f2a071d
...
...
@@ -36,6 +36,7 @@
#include "heap.h"
#include "wine/server.h"
#include "wine/debug.h"
#include "winternl.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
reg
);
...
...
@@ -1636,9 +1637,12 @@ LONG WINAPI RegRestoreKeyW( HKEY hkey, LPCWSTR lpFile, DWORD dwFlags )
*/
LONG
WINAPI
RegRestoreKeyA
(
HKEY
hkey
,
LPCSTR
lpFile
,
DWORD
dwFlags
)
{
LPWSTR
lpFileW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
lpFile
);
LONG
ret
=
RegRestoreKeyW
(
hkey
,
lpFileW
,
dwFlags
);
HeapFree
(
GetProcessHeap
(),
0
,
lpFileW
);
UNICODE_STRING
lpFileW
;
LONG
ret
;
RtlCreateUnicodeStringFromAsciiz
(
&
lpFileW
,
lpFile
);
ret
=
RegRestoreKeyW
(
hkey
,
lpFileW
.
Buffer
,
dwFlags
);
RtlFreeUnicodeString
(
&
lpFileW
);
return
ret
;
}
...
...
@@ -1662,9 +1666,12 @@ LONG WINAPI RegUnLoadKeyW( HKEY hkey, LPCWSTR lpSubKey )
*/
LONG
WINAPI
RegUnLoadKeyA
(
HKEY
hkey
,
LPCSTR
lpSubKey
)
{
LPWSTR
lpSubKeyW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
lpSubKey
);
LONG
ret
=
RegUnLoadKeyW
(
hkey
,
lpSubKeyW
);
if
(
lpSubKeyW
)
HeapFree
(
GetProcessHeap
(),
0
,
lpSubKeyW
);
UNICODE_STRING
lpSubKeyW
;
LONG
ret
;
RtlCreateUnicodeStringFromAsciiz
(
&
lpSubKeyW
,
lpSubKey
);
ret
=
RegUnLoadKeyW
(
hkey
,
lpSubKeyW
.
Buffer
);
RtlFreeUnicodeString
(
&
lpSubKeyW
);
return
ret
;
}
...
...
@@ -1693,13 +1700,18 @@ LONG WINAPI RegReplaceKeyW( HKEY hkey, LPCWSTR lpSubKey, LPCWSTR lpNewFile,
LONG
WINAPI
RegReplaceKeyA
(
HKEY
hkey
,
LPCSTR
lpSubKey
,
LPCSTR
lpNewFile
,
LPCSTR
lpOldFile
)
{
LPWSTR
lpSubKeyW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
lpSubKey
);
LPWSTR
lpNewFileW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
lpNewFile
);
LPWSTR
lpOldFileW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
lpOldFile
);
LONG
ret
=
RegReplaceKeyW
(
hkey
,
lpSubKeyW
,
lpNewFileW
,
lpOldFileW
);
HeapFree
(
GetProcessHeap
(),
0
,
lpOldFileW
);
HeapFree
(
GetProcessHeap
(),
0
,
lpNewFileW
);
HeapFree
(
GetProcessHeap
(),
0
,
lpSubKeyW
);
UNICODE_STRING
lpSubKeyW
;
UNICODE_STRING
lpNewFileW
;
UNICODE_STRING
lpOldFileW
;
LONG
ret
;
RtlCreateUnicodeStringFromAsciiz
(
&
lpSubKeyW
,
lpSubKey
);
RtlCreateUnicodeStringFromAsciiz
(
&
lpOldFileW
,
lpOldFile
);
RtlCreateUnicodeStringFromAsciiz
(
&
lpNewFileW
,
lpNewFile
);
ret
=
RegReplaceKeyW
(
hkey
,
lpSubKeyW
.
Buffer
,
lpNewFileW
.
Buffer
,
lpOldFileW
.
Buffer
);
RtlFreeUnicodeString
(
&
lpOldFileW
);
RtlFreeUnicodeString
(
&
lpNewFileW
);
RtlFreeUnicodeString
(
&
lpSubKeyW
);
return
ret
;
}
...
...
@@ -1820,9 +1832,12 @@ LONG WINAPI RegConnectRegistryW( LPCWSTR lpMachineName, HKEY hKey,
*/
LONG
WINAPI
RegConnectRegistryA
(
LPCSTR
machine
,
HKEY
hkey
,
PHKEY
reskey
)
{
LPWSTR
machineW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
machine
);
DWORD
ret
=
RegConnectRegistryW
(
machineW
,
hkey
,
reskey
);
HeapFree
(
GetProcessHeap
(),
0
,
machineW
);
UNICODE_STRING
machineW
;
LONG
ret
;
RtlCreateUnicodeStringFromAsciiz
(
&
machineW
,
machine
);
ret
=
RegConnectRegistryW
(
machineW
.
Buffer
,
hkey
,
reskey
);
RtlFreeUnicodeString
(
&
machineW
);
return
ret
;
}
...
...
dlls/advapi32/security.c
View file @
6f2a071d
...
...
@@ -634,13 +634,15 @@ LookupPrivilegeValueW( LPCWSTR lpSystemName, LPCWSTR lpName, PLUID lpLuid )
BOOL
WINAPI
LookupPrivilegeValueA
(
LPCSTR
lpSystemName
,
LPCSTR
lpName
,
PLUID
lpLuid
)
{
LPWSTR
lpSystemNameW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
lpSystemName
)
;
LPWSTR
lpNameW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
lpName
)
;
UNICODE_STRING
lpSystemNameW
;
UNICODE_STRING
lpNameW
;
BOOL
ret
;
ret
=
LookupPrivilegeValueW
(
lpSystemNameW
,
lpNameW
,
lpLuid
);
HeapFree
(
GetProcessHeap
(),
0
,
lpNameW
);
HeapFree
(
GetProcessHeap
(),
0
,
lpSystemNameW
);
RtlCreateUnicodeStringFromAsciiz
(
&
lpSystemNameW
,
lpSystemName
);
RtlCreateUnicodeStringFromAsciiz
(
&
lpNameW
,
lpName
);
ret
=
LookupPrivilegeValueW
(
lpSystemNameW
.
Buffer
,
lpNameW
.
Buffer
,
lpLuid
);
RtlFreeUnicodeString
(
&
lpNameW
);
RtlFreeUnicodeString
(
&
lpSystemNameW
);
return
ret
;
}
...
...
dlls/advapi32/service.c
View file @
6f2a071d
...
...
@@ -28,6 +28,7 @@
#include "wine/unicode.h"
#include "heap.h"
#include "wine/debug.h"
#include "winternl.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
advapi
);
...
...
@@ -234,12 +235,15 @@ SC_HANDLE WINAPI
OpenSCManagerA
(
LPCSTR
lpMachineName
,
LPCSTR
lpDatabaseName
,
DWORD
dwDesiredAccess
)
{
LPWSTR
lpMachineNameW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
lpMachineName
);
LPWSTR
lpDatabaseNameW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
lpDatabaseName
);
SC_HANDLE
ret
=
OpenSCManagerW
(
lpMachineNameW
,
lpDatabaseNameW
,
dwDesiredAccess
);
HeapFree
(
GetProcessHeap
(),
0
,
lpDatabaseNameW
);
HeapFree
(
GetProcessHeap
(),
0
,
lpMachineNameW
);
UNICODE_STRING
lpMachineNameW
;
UNICODE_STRING
lpDatabaseNameW
;
SC_HANDLE
ret
;
RtlCreateUnicodeStringFromAsciiz
(
&
lpMachineNameW
,
lpMachineName
);
RtlCreateUnicodeStringFromAsciiz
(
&
lpDatabaseNameW
,
lpDatabaseName
);
ret
=
OpenSCManagerW
(
lpMachineNameW
.
Buffer
,
lpDatabaseNameW
.
Buffer
,
dwDesiredAccess
);
RtlFreeUnicodeString
(
&
lpDatabaseNameW
);
RtlFreeUnicodeString
(
&
lpMachineNameW
);
return
ret
;
}
...
...
@@ -347,15 +351,15 @@ SC_HANDLE WINAPI
OpenServiceA
(
SC_HANDLE
hSCManager
,
LPCSTR
lpServiceName
,
DWORD
dwDesiredAccess
)
{
LPWSTR
lpServiceNameW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
lpServiceName
)
;
UNICODE_STRING
lpServiceNameW
;
SC_HANDLE
ret
;
RtlCreateUnicodeStringFromAsciiz
(
&
lpServiceNameW
,
lpServiceName
);
if
(
lpServiceName
)
TRACE
(
"Request for service %s
\n
"
,
lpServiceName
);
else
return
FALSE
;
ret
=
OpenServiceW
(
hSCManager
,
lpServiceNameW
,
dwDesiredAccess
);
HeapFree
(
GetProcessHeap
(),
0
,
lpServiceNameW
);
ret
=
OpenServiceW
(
hSCManager
,
lpServiceNameW
.
Buffer
,
dwDesiredAccess
);
RtlFreeUnicodeString
(
&
lpServiceNameW
);
return
ret
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment