Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
1798bcd5
Commit
1798bcd5
authored
Feb 14, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Feb 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wow64: Avoid calling RtlInitUnicodeString on a static constant.
parent
956005d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
file.c
dlls/wow64/file.c
+4
-4
syscall.c
dlls/wow64/syscall.c
+1
-2
No files found.
dlls/wow64/file.c
View file @
1798bcd5
...
...
@@ -59,12 +59,12 @@ static inline ULONG starts_with_path( const WCHAR *name, ULONG name_len, const W
void
init_file_redirects
(
void
)
{
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
nameW
;
UNICODE_STRING
windows
=
RTL_CONSTANT_STRING
(
L"
\\
??
\\
C:
\\
windows"
);
UNICODE_STRING
system32
=
RTL_CONSTANT_STRING
(
L"
\\
??
\\
C:
\\
windows
\\
system32"
);
IO_STATUS_BLOCK
io
;
HANDLE
handle
;
InitializeObjectAttributes
(
&
attr
,
&
nameW
,
OBJ_CASE_INSENSITIVE
,
0
,
NULL
);
RtlInitUnicodeString
(
&
nameW
,
L"
\\
??
\\
C:
\\
windows"
);
InitializeObjectAttributes
(
&
attr
,
&
windows
,
OBJ_CASE_INSENSITIVE
,
0
,
NULL
);
if
(
!
NtOpenFile
(
&
handle
,
SYNCHRONIZE
|
FILE_LIST_DIRECTORY
,
&
attr
,
&
io
,
FILE_SHARE_READ
,
FILE_SYNCHRONOUS_IO_NONALERT
|
FILE_OPEN_FOR_BACKUP_INTENT
|
FILE_DIRECTORY_FILE
))
...
...
@@ -72,7 +72,7 @@ void init_file_redirects(void)
get_file_id
(
handle
,
&
windir_id
);
NtClose
(
handle
);
}
RtlInitUnicodeString
(
&
nameW
,
L"
\\
??
\\
C:
\\
windows
\\
system32"
)
;
attr
.
ObjectName
=
&
system32
;
if
(
!
NtOpenFile
(
&
handle
,
SYNCHRONIZE
|
FILE_LIST_DIRECTORY
,
&
attr
,
&
io
,
FILE_SHARE_READ
,
FILE_SYNCHRONOUS_IO_NONALERT
|
FILE_OPEN_FOR_BACKUP_INTENT
|
FILE_DIRECTORY_FILE
))
...
...
dlls/wow64/syscall.c
View file @
1798bcd5
...
...
@@ -696,7 +696,7 @@ static const WCHAR *get_cpu_dll_name(void)
static
DWORD
WINAPI
process_init
(
RTL_RUN_ONCE
*
once
,
void
*
param
,
void
**
context
)
{
HMODULE
module
;
UNICODE_STRING
str
;
UNICODE_STRING
str
=
RTL_CONSTANT_STRING
(
L"ntdll.dll"
)
;
SYSTEM_BASIC_INFORMATION
info
;
RtlWow64GetProcessMachines
(
GetCurrentProcess
(),
&
current_machine
,
&
native_machine
);
...
...
@@ -708,7 +708,6 @@ static DWORD WINAPI process_init( RTL_RUN_ONCE *once, void *param, void **contex
#define GET_PTR(name) p ## name = RtlFindExportedRoutineByName( module, #name )
RtlInitUnicodeString
(
&
str
,
L"ntdll.dll"
);
LdrGetDllHandle
(
NULL
,
0
,
&
str
,
&
module
);
GET_PTR
(
LdrSystemDllInitBlock
);
...
...
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