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
769a84fa
Commit
769a84fa
authored
Mar 14, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid GetProcessHeap() inside ntdll.
parent
cfd8bb8c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
16 deletions
+24
-16
reg.c
dlls/ntdll/reg.c
+1
-1
rtl.c
dlls/ntdll/rtl.c
+2
-1
rtlstr.c
dlls/ntdll/rtlstr.c
+18
-12
sec.c
dlls/ntdll/sec.c
+3
-2
No files found.
dlls/ntdll/reg.c
View file @
769a84fa
...
...
@@ -591,7 +591,7 @@ NTSTATUS WINAPI RtlFormatCurrentUserKeyPath( IN OUT PUNICODE_STRING KeyPath)
ANSI_STRING
AnsiPath
;
NTSTATUS
ret
;
if
(
!
(
buffer
=
RtlAllocateHeap
(
GetProcessH
eap
(),
0
,
strlen
(
user
)
+
16
)))
if
(
!
(
buffer
=
RtlAllocateHeap
(
ntdll_get_process_h
eap
(),
0
,
strlen
(
user
)
+
16
)))
return
STATUS_NO_MEMORY
;
strcpy
(
buffer
,
"
\\
Registry
\\
User
\\
"
);
...
...
dlls/ntdll/rtl.c
View file @
769a84fa
...
...
@@ -30,6 +30,7 @@
#include "winreg.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "ntdll_misc.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
ntdll
);
...
...
@@ -358,7 +359,7 @@ BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(
length
=
strlenW
(
szwDosPath
)
*
sizeof
(
WCHAR
)
+
sizeof
szPrefix
;
ntpath
->
Buffer
=
RtlAllocateHeap
(
GetProcessH
eap
(),
0
,
length
);
ntpath
->
Buffer
=
RtlAllocateHeap
(
ntdll_get_process_h
eap
(),
0
,
length
);
ntpath
->
Length
=
0
;
ntpath
->
MaximumLength
=
length
;
...
...
dlls/ntdll/rtlstr.c
View file @
769a84fa
...
...
@@ -30,6 +30,7 @@
#include "winternl.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "ntdll_misc.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
ntdll
);
...
...
@@ -94,7 +95,7 @@ void WINAPI RtlInitString( PSTRING target, LPCSTR source )
*/
void
WINAPI
RtlFreeAnsiString
(
PSTRING
str
)
{
if
(
str
->
Buffer
)
RtlFreeHeap
(
GetProcessH
eap
(),
0
,
str
->
Buffer
);
if
(
str
->
Buffer
)
RtlFreeHeap
(
ntdll_get_process_h
eap
(),
0
,
str
->
Buffer
);
}
...
...
@@ -142,7 +143,7 @@ void WINAPI RtlInitUnicodeString( PUNICODE_STRING target, LPCWSTR source )
BOOLEAN
WINAPI
RtlCreateUnicodeString
(
PUNICODE_STRING
target
,
LPCWSTR
src
)
{
int
len
=
(
strlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
);
if
(
!
(
target
->
Buffer
=
RtlAllocateHeap
(
GetProcessH
eap
(),
0
,
len
)))
return
FALSE
;
if
(
!
(
target
->
Buffer
=
RtlAllocateHeap
(
ntdll_get_process_h
eap
(),
0
,
len
)))
return
FALSE
;
memcpy
(
target
->
Buffer
,
src
,
len
);
target
->
MaximumLength
=
len
;
target
->
Length
=
len
-
sizeof
(
WCHAR
);
...
...
@@ -166,7 +167,7 @@ BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz( PUNICODE_STRING target, LPCSTR
*/
void
WINAPI
RtlFreeUnicodeString
(
PUNICODE_STRING
str
)
{
if
(
str
->
Buffer
)
RtlFreeHeap
(
GetProcessH
eap
(),
0
,
str
->
Buffer
);
if
(
str
->
Buffer
)
RtlFreeHeap
(
ntdll_get_process_h
eap
(),
0
,
str
->
Buffer
);
}
...
...
@@ -352,7 +353,8 @@ NTSTATUS WINAPI RtlAnsiStringToUnicodeString( PUNICODE_STRING uni,
if
(
doalloc
)
{
uni
->
MaximumLength
=
total
;
if
(
!
(
uni
->
Buffer
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
total
)))
return
STATUS_NO_MEMORY
;
if
(
!
(
uni
->
Buffer
=
RtlAllocateHeap
(
ntdll_get_process_heap
(),
0
,
total
)))
return
STATUS_NO_MEMORY
;
}
else
if
(
total
>
uni
->
MaximumLength
)
return
STATUS_BUFFER_OVERFLOW
;
...
...
@@ -380,7 +382,8 @@ NTSTATUS WINAPI RtlOemStringToUnicodeString( UNICODE_STRING *uni,
if
(
doalloc
)
{
uni
->
MaximumLength
=
total
;
if
(
!
(
uni
->
Buffer
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
total
)))
return
STATUS_NO_MEMORY
;
if
(
!
(
uni
->
Buffer
=
RtlAllocateHeap
(
ntdll_get_process_heap
(),
0
,
total
)))
return
STATUS_NO_MEMORY
;
}
else
if
(
total
>
uni
->
MaximumLength
)
return
STATUS_BUFFER_OVERFLOW
;
...
...
@@ -408,7 +411,8 @@ NTSTATUS WINAPI RtlUnicodeStringToAnsiString( STRING *ansi,
if
(
doalloc
)
{
ansi
->
MaximumLength
=
len
;
if
(
!
(
ansi
->
Buffer
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
len
)))
return
STATUS_NO_MEMORY
;
if
(
!
(
ansi
->
Buffer
=
RtlAllocateHeap
(
ntdll_get_process_heap
(),
0
,
len
)))
return
STATUS_NO_MEMORY
;
}
else
if
(
ansi
->
MaximumLength
<
len
)
{
...
...
@@ -441,7 +445,8 @@ NTSTATUS WINAPI RtlUnicodeStringToOemString( STRING *oem,
if
(
doalloc
)
{
oem
->
MaximumLength
=
len
;
if
(
!
(
oem
->
Buffer
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
len
)))
return
STATUS_NO_MEMORY
;
if
(
!
(
oem
->
Buffer
=
RtlAllocateHeap
(
ntdll_get_process_heap
(),
0
,
len
)))
return
STATUS_NO_MEMORY
;
}
else
if
(
oem
->
MaximumLength
<
len
)
{
...
...
@@ -570,7 +575,8 @@ NTSTATUS WINAPI RtlUpcaseUnicodeString( UNICODE_STRING *dest,
if
(
doalloc
)
{
dest
->
MaximumLength
=
len
;
if
(
!
(
dest
->
Buffer
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
len
)))
return
STATUS_NO_MEMORY
;
if
(
!
(
dest
->
Buffer
=
RtlAllocateHeap
(
ntdll_get_process_heap
(),
0
,
len
)))
return
STATUS_NO_MEMORY
;
}
else
if
(
len
>
dest
->
MaximumLength
)
return
STATUS_BUFFER_OVERFLOW
;
...
...
@@ -634,10 +640,10 @@ NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN( LPSTR dst, DWORD dstlen, LPDWORD r
LPWSTR
upcase
;
DWORD
i
;
if
(
!
(
upcase
=
RtlAllocateHeap
(
GetProcessH
eap
(),
0
,
srclen
)))
return
STATUS_NO_MEMORY
;
if
(
!
(
upcase
=
RtlAllocateHeap
(
ntdll_get_process_h
eap
(),
0
,
srclen
)))
return
STATUS_NO_MEMORY
;
for
(
i
=
0
;
i
<
srclen
/
sizeof
(
WCHAR
);
i
++
)
upcase
[
i
]
=
toupperW
(
src
[
i
]);
ret
=
RtlUnicodeToMultiByteN
(
dst
,
dstlen
,
reslen
,
upcase
,
srclen
);
RtlFreeHeap
(
GetProcessH
eap
(),
0
,
upcase
);
RtlFreeHeap
(
ntdll_get_process_h
eap
(),
0
,
upcase
);
return
ret
;
}
...
...
@@ -652,10 +658,10 @@ NTSTATUS WINAPI RtlUpcaseUnicodeToOemN( LPSTR dst, DWORD dstlen, LPDWORD reslen,
LPWSTR
upcase
;
DWORD
i
;
if
(
!
(
upcase
=
RtlAllocateHeap
(
GetProcessH
eap
(),
0
,
srclen
)))
return
STATUS_NO_MEMORY
;
if
(
!
(
upcase
=
RtlAllocateHeap
(
ntdll_get_process_h
eap
(),
0
,
srclen
)))
return
STATUS_NO_MEMORY
;
for
(
i
=
0
;
i
<
srclen
/
sizeof
(
WCHAR
);
i
++
)
upcase
[
i
]
=
toupperW
(
src
[
i
]);
ret
=
RtlUnicodeToOemN
(
dst
,
dstlen
,
reslen
,
upcase
,
srclen
);
RtlFreeHeap
(
GetProcessH
eap
(),
0
,
upcase
);
RtlFreeHeap
(
ntdll_get_process_h
eap
(),
0
,
upcase
);
return
ret
;
}
...
...
dlls/ntdll/sec.c
View file @
769a84fa
...
...
@@ -78,7 +78,8 @@ BOOLEAN WINAPI RtlAllocateAndInitializeSid (
nSubAuthority0
,
nSubAuthority1
,
nSubAuthority2
,
nSubAuthority3
,
nSubAuthority4
,
nSubAuthority5
,
nSubAuthority6
,
nSubAuthority7
,
pSid
);
if
(
!
(
*
pSid
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
RtlLengthRequiredSid
(
nSubAuthorityCount
))))
if
(
!
(
*
pSid
=
RtlAllocateHeap
(
ntdll_get_process_heap
(),
0
,
RtlLengthRequiredSid
(
nSubAuthorityCount
))))
return
FALSE
;
(
*
pSid
)
->
Revision
=
SID_REVISION
;
...
...
@@ -148,7 +149,7 @@ BOOL WINAPI RtlEqualPrefixSid (PSID pSid1, PSID pSid2)
DWORD
WINAPI
RtlFreeSid
(
PSID
pSid
)
{
TRACE
(
"(%p)
\n
"
,
pSid
);
RtlFreeHeap
(
GetProcessH
eap
(),
0
,
pSid
);
RtlFreeHeap
(
ntdll_get_process_h
eap
(),
0
,
pSid
);
return
STATUS_SUCCESS
;
}
...
...
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