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
bf039539
Commit
bf039539
authored
Nov 12, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Implement GetSystemWow64Directory2().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
eee3a4e8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
16 deletions
+58
-16
file.c
dlls/kernelbase/file.c
+52
-14
kernelbase.spec
dlls/kernelbase/kernelbase.spec
+2
-2
winbase.h
include/winbase.h
+3
-0
winnt.h
include/winnt.h
+1
-0
No files found.
dlls/kernelbase/file.c
View file @
bf039539
...
...
@@ -57,6 +57,19 @@ static void WINAPI read_write_apc( void *apc_user, PIO_STATUS_BLOCK io, ULONG re
func
(
RtlNtStatusToDosError
(
io
->
u
.
Status
),
io
->
Information
,
(
LPOVERLAPPED
)
io
);
}
static
const
WCHAR
*
get_machine_wow64_dir
(
WORD
machine
)
{
switch
(
machine
)
{
case
IMAGE_FILE_MACHINE_TARGET_HOST
:
return
system_dir
;
case
IMAGE_FILE_MACHINE_I386
:
return
L"C:
\\
windows
\\
syswow64"
;
case
IMAGE_FILE_MACHINE_ARMNT
:
return
L"C:
\\
windows
\\
sysarm32"
;
case
IMAGE_FILE_MACHINE_AMD64
:
return
L"C:
\\
windows
\\
sysx8664"
;
case
IMAGE_FILE_MACHINE_ARM64
:
return
L"C:
\\
windows
\\
sysarm64"
;
default:
return
NULL
;
}
}
/***********************************************************************
* Operations on file names
...
...
@@ -195,6 +208,21 @@ done:
/***********************************************************************
* copy_filename
*/
static
DWORD
copy_filename
(
const
WCHAR
*
name
,
WCHAR
*
buffer
,
DWORD
len
)
{
UINT
ret
=
lstrlenW
(
name
)
+
1
;
if
(
buffer
&&
len
>=
ret
)
{
lstrcpyW
(
buffer
,
name
);
ret
--
;
}
return
ret
;
}
/***********************************************************************
* copy_filename_WtoA
*
* copy a file name back to OEM/Ansi, but only if the buffer is large enough
...
...
@@ -1211,13 +1239,7 @@ UINT WINAPI DECLSPEC_HOTPATCH GetSystemDirectoryA( LPSTR path, UINT count )
*/
UINT
WINAPI
DECLSPEC_HOTPATCH
GetSystemDirectoryW
(
LPWSTR
path
,
UINT
count
)
{
UINT
len
=
lstrlenW
(
system_dir
)
+
1
;
if
(
path
&&
count
>=
len
)
{
lstrcpyW
(
path
,
system_dir
);
len
--
;
}
return
len
;
return
copy_filename
(
system_dir
,
path
,
count
);
}
...
...
@@ -1240,6 +1262,28 @@ UINT WINAPI DECLSPEC_HOTPATCH GetSystemWindowsDirectoryW( LPWSTR path, UINT coun
/***********************************************************************
* GetSystemWow64Directory2A (kernelbase.@)
*/
UINT
WINAPI
DECLSPEC_HOTPATCH
GetSystemWow64Directory2A
(
LPSTR
path
,
UINT
count
,
WORD
machine
)
{
const
WCHAR
*
dir
=
get_machine_wow64_dir
(
machine
);
return
dir
?
copy_filename_WtoA
(
dir
,
path
,
count
)
:
0
;
}
/***********************************************************************
* GetSystemWow64Directory2W (kernelbase.@)
*/
UINT
WINAPI
DECLSPEC_HOTPATCH
GetSystemWow64Directory2W
(
LPWSTR
path
,
UINT
count
,
WORD
machine
)
{
const
WCHAR
*
dir
=
get_machine_wow64_dir
(
machine
);
return
dir
?
copy_filename
(
dir
,
path
,
count
)
:
0
;
}
/***********************************************************************
* GetTempFileNameA (kernelbase.@)
*/
UINT
WINAPI
DECLSPEC_HOTPATCH
GetTempFileNameA
(
LPCSTR
path
,
LPCSTR
prefix
,
UINT
unique
,
LPSTR
buffer
)
...
...
@@ -1413,13 +1457,7 @@ UINT WINAPI DECLSPEC_HOTPATCH GetWindowsDirectoryA( LPSTR path, UINT count )
*/
UINT
WINAPI
DECLSPEC_HOTPATCH
GetWindowsDirectoryW
(
LPWSTR
path
,
UINT
count
)
{
UINT
len
=
lstrlenW
(
windows_dir
)
+
1
;
if
(
path
&&
count
>=
len
)
{
lstrcpyW
(
path
,
windows_dir
);
len
--
;
}
return
len
;
return
copy_filename
(
windows_dir
,
path
,
count
);
}
...
...
dlls/kernelbase/kernelbase.spec
View file @
bf039539
...
...
@@ -701,8 +701,8 @@
@ stdcall GetSystemTimes(ptr ptr ptr) kernel32.GetSystemTimes
@ stdcall GetSystemWindowsDirectoryA(ptr long)
@ stdcall GetSystemWindowsDirectoryW(ptr long)
# @ stub GetSystemWow64Directory2A
# @ stub GetSystemWow64Directory2W
@ stdcall GetSystemWow64Directory2A(ptr long long)
@ stdcall GetSystemWow64Directory2W(ptr long long)
@ stdcall GetSystemWow64DirectoryA(ptr long) kernel32.GetSystemWow64DirectoryA
@ stdcall GetSystemWow64DirectoryW(ptr long) kernel32.GetSystemWow64DirectoryW
# @ stub GetTargetPlatformContext
...
...
include/winbase.h
View file @
bf039539
...
...
@@ -2289,6 +2289,9 @@ WINBASEAPI VOID WINAPI GetSystemTimePreciseAsFileTime(LPFILETIME);
WINBASEAPI
UINT
WINAPI
GetSystemWindowsDirectoryA
(
LPSTR
,
UINT
);
WINBASEAPI
UINT
WINAPI
GetSystemWindowsDirectoryW
(
LPWSTR
,
UINT
);
#define GetSystemWindowsDirectory WINELIB_NAME_AW(GetSystemWindowsDirectory)
WINBASEAPI
UINT
WINAPI
GetSystemWow64Directory2A
(
LPSTR
,
UINT
,
WORD
);
WINBASEAPI
UINT
WINAPI
GetSystemWow64Directory2W
(
LPWSTR
,
UINT
,
WORD
);
#define GetSystemWow64Directory2 WINELIB_NAME_AW(GetSystemWow64Directory2)
WINBASEAPI
UINT
WINAPI
GetSystemWow64DirectoryA
(
LPSTR
,
UINT
);
WINBASEAPI
UINT
WINAPI
GetSystemWow64DirectoryW
(
LPWSTR
,
UINT
);
#define GetSystemWow64Directory WINELIB_NAME_AW(GetSystemWow64Directory)
...
...
include/winnt.h
View file @
bf039539
...
...
@@ -2874,6 +2874,7 @@ typedef struct _IMAGE_VXD_HEADER {
/* These are the settings of the Machine field. */
#define IMAGE_FILE_MACHINE_UNKNOWN 0
#define IMAGE_FILE_MACHINE_TARGET_HOST 0x0001
#define IMAGE_FILE_MACHINE_I860 0x014d
#define IMAGE_FILE_MACHINE_I386 0x014c
#define IMAGE_FILE_MACHINE_R3000 0x0162
...
...
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