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
9dfebb52
Commit
9dfebb52
authored
Jul 26, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wow64: Add thunks for the section object syscalls.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b047b66a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
167 additions
and
0 deletions
+167
-0
struct32.h
dlls/wow64/struct32.h
+28
-0
sync.c
dlls/wow64/sync.c
+128
-0
syscall.h
dlls/wow64/syscall.h
+3
-0
wow64_private.h
dlls/wow64/wow64_private.h
+8
-0
No files found.
dlls/wow64/struct32.h
View file @
9dfebb52
...
...
@@ -39,6 +39,34 @@ typedef struct
typedef
struct
{
ULONG
BaseAddress
;
ULONG
Attributes
;
LARGE_INTEGER
Size
;
}
SECTION_BASIC_INFORMATION32
;
typedef
struct
{
ULONG
TransferAddress
;
ULONG
ZeroBits
;
ULONG
MaximumStackSize
;
ULONG
CommittedStackSize
;
ULONG
SubSystemType
;
USHORT
MinorSubsystemVersion
;
USHORT
MajorSubsystemVersion
;
USHORT
MajorOperatingSystemVersion
;
USHORT
MinorOperatingSystemVersion
;
USHORT
ImageCharacteristics
;
USHORT
DllCharacteristics
;
USHORT
Machine
;
BOOLEAN
ImageContainsCode
;
UCHAR
ImageFlags
;
ULONG
LoaderFlags
;
ULONG
ImageFileSize
;
ULONG
CheckSum
;
}
SECTION_IMAGE_INFORMATION32
;
typedef
struct
{
DBG_STATE
NewState
;
CLIENT_ID32
AppClientId
;
union
...
...
dlls/wow64/sync.c
View file @
9dfebb52
...
...
@@ -32,6 +32,37 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
wow
);
void
put_section_image_info
(
SECTION_IMAGE_INFORMATION32
*
info32
,
const
SECTION_IMAGE_INFORMATION
*
info
)
{
if
(
info
->
Machine
==
IMAGE_FILE_MACHINE_AMD64
||
info
->
Machine
==
IMAGE_FILE_MACHINE_ARM64
)
{
info32
->
TransferAddress
=
0x81231234
;
/* sic */
info32
->
MaximumStackSize
=
0x100000
;
info32
->
CommittedStackSize
=
0x10000
;
}
else
{
info32
->
TransferAddress
=
PtrToUlong
(
info
->
TransferAddress
);
info32
->
MaximumStackSize
=
info
->
MaximumStackSize
;
info32
->
CommittedStackSize
=
info
->
CommittedStackSize
;
}
info32
->
ZeroBits
=
info
->
ZeroBits
;
info32
->
SubSystemType
=
info
->
SubSystemType
;
info32
->
MinorSubsystemVersion
=
info
->
MinorSubsystemVersion
;
info32
->
MajorSubsystemVersion
=
info
->
MajorSubsystemVersion
;
info32
->
MajorOperatingSystemVersion
=
info
->
MajorOperatingSystemVersion
;
info32
->
MinorOperatingSystemVersion
=
info
->
MinorOperatingSystemVersion
;
info32
->
ImageCharacteristics
=
info
->
ImageCharacteristics
;
info32
->
DllCharacteristics
=
info
->
DllCharacteristics
;
info32
->
Machine
=
info
->
Machine
;
info32
->
ImageContainsCode
=
info
->
ImageContainsCode
;
info32
->
ImageFlags
=
info
->
ImageFlags
;
info32
->
LoaderFlags
=
info
->
LoaderFlags
;
info32
->
ImageFileSize
=
info
->
ImageFileSize
;
info32
->
CheckSum
=
info
->
CheckSum
;
}
/**********************************************************************
* wow64_NtCancelTimer
*/
...
...
@@ -202,6 +233,30 @@ NTSTATUS WINAPI wow64_NtCreateMutant( UINT *args )
/**********************************************************************
* wow64_NtCreateSection
*/
NTSTATUS
WINAPI
wow64_NtCreateSection
(
UINT
*
args
)
{
ULONG
*
handle_ptr
=
get_ptr
(
&
args
);
ACCESS_MASK
access
=
get_ulong
(
&
args
);
OBJECT_ATTRIBUTES32
*
attr32
=
get_ptr
(
&
args
);
const
LARGE_INTEGER
*
size
=
get_ptr
(
&
args
);
ULONG
protect
=
get_ulong
(
&
args
);
ULONG
flags
=
get_ulong
(
&
args
);
HANDLE
file
=
get_handle
(
&
args
);
struct
object_attr64
attr
;
HANDLE
handle
=
0
;
NTSTATUS
status
;
*
handle_ptr
=
0
;
status
=
NtCreateSection
(
&
handle
,
access
,
objattr_32to64
(
&
attr
,
attr32
),
size
,
protect
,
flags
,
file
);
put_handle
(
handle_ptr
,
handle
);
return
status
;
}
/**********************************************************************
* wow64_NtCreateSemaphore
*/
NTSTATUS
WINAPI
wow64_NtCreateSemaphore
(
UINT
*
args
)
...
...
@@ -415,6 +470,26 @@ NTSTATUS WINAPI wow64_NtOpenMutant( UINT *args )
/**********************************************************************
* wow64_NtOpenSection
*/
NTSTATUS
WINAPI
wow64_NtOpenSection
(
UINT
*
args
)
{
ULONG
*
handle_ptr
=
get_ptr
(
&
args
);
ACCESS_MASK
access
=
get_ulong
(
&
args
);
OBJECT_ATTRIBUTES32
*
attr32
=
get_ptr
(
&
args
);
struct
object_attr64
attr
;
HANDLE
handle
=
0
;
NTSTATUS
status
;
*
handle_ptr
=
0
;
status
=
NtOpenSection
(
&
handle
,
access
,
objattr_32to64
(
&
attr
,
attr32
));
put_handle
(
handle_ptr
,
handle
);
return
status
;
}
/**********************************************************************
* wow64_NtOpenSemaphore
*/
NTSTATUS
WINAPI
wow64_NtOpenSemaphore
(
UINT
*
args
)
...
...
@@ -581,6 +656,59 @@ NTSTATUS WINAPI wow64_NtQueryPerformanceCounter( UINT *args )
/**********************************************************************
* wow64_NtQuerySection
*/
NTSTATUS
WINAPI
wow64_NtQuerySection
(
UINT
*
args
)
{
HANDLE
handle
=
get_handle
(
&
args
);
SECTION_INFORMATION_CLASS
class
=
get_ulong
(
&
args
);
void
*
ptr
=
get_ptr
(
&
args
);
SIZE_T
size
=
get_ulong
(
&
args
);
ULONG
*
ret_ptr
=
get_ptr
(
&
args
);
NTSTATUS
status
;
SIZE_T
ret_size
=
0
;
switch
(
class
)
{
case
SectionBasicInformation
:
{
SECTION_BASIC_INFORMATION
info
;
SECTION_BASIC_INFORMATION32
*
info32
=
ptr
;
if
(
size
<
sizeof
(
*
info32
))
return
STATUS_INFO_LENGTH_MISMATCH
;
if
(
!
(
status
=
NtQuerySection
(
handle
,
class
,
&
info
,
sizeof
(
info
),
&
ret_size
)))
{
info32
->
BaseAddress
=
PtrToUlong
(
info
.
BaseAddress
);
info32
->
Attributes
=
info
.
Attributes
;
info32
->
Size
=
info
.
Size
;
ret_size
=
sizeof
(
*
info32
);
}
break
;
}
case
SectionImageInformation
:
{
SECTION_IMAGE_INFORMATION
info
;
SECTION_IMAGE_INFORMATION32
*
info32
=
ptr
;
if
(
size
<
sizeof
(
*
info32
))
return
STATUS_INFO_LENGTH_MISMATCH
;
if
(
!
(
status
=
NtQuerySection
(
handle
,
class
,
&
info
,
sizeof
(
info
),
&
ret_size
)))
{
put_section_image_info
(
info32
,
&
info
);
ret_size
=
sizeof
(
*
info32
);
}
break
;
}
default:
FIXME
(
"class %u not implemented
\n
"
,
class
);
return
STATUS_NOT_IMPLEMENTED
;
}
put_size
(
ret_ptr
,
ret_size
);
return
status
;
}
/**********************************************************************
* wow64_NtQuerySemaphore
*/
NTSTATUS
WINAPI
wow64_NtQuerySemaphore
(
UINT
*
args
)
...
...
dlls/wow64/syscall.h
View file @
9dfebb52
...
...
@@ -35,6 +35,7 @@
SYSCALL_ENTRY( NtCreateJobObject ) \
SYSCALL_ENTRY( NtCreateKeyedEvent ) \
SYSCALL_ENTRY( NtCreateMutant ) \
SYSCALL_ENTRY( NtCreateSection ) \
SYSCALL_ENTRY( NtCreateSemaphore ) \
SYSCALL_ENTRY( NtCreateSymbolicLinkObject ) \
SYSCALL_ENTRY( NtCreateTimer ) \
...
...
@@ -49,6 +50,7 @@
SYSCALL_ENTRY( NtOpenJobObject ) \
SYSCALL_ENTRY( NtOpenKeyedEvent ) \
SYSCALL_ENTRY( NtOpenMutant ) \
SYSCALL_ENTRY( NtOpenSection ) \
SYSCALL_ENTRY( NtOpenSemaphore ) \
SYSCALL_ENTRY( NtOpenSymbolicLinkObject ) \
SYSCALL_ENTRY( NtOpenTimer ) \
...
...
@@ -62,6 +64,7 @@
SYSCALL_ENTRY( NtQueryIoCompletion ) \
SYSCALL_ENTRY( NtQueryMutant ) \
SYSCALL_ENTRY( NtQueryPerformanceCounter ) \
SYSCALL_ENTRY( NtQuerySection ) \
SYSCALL_ENTRY( NtQuerySemaphore ) \
SYSCALL_ENTRY( NtQuerySymbolicLinkObject ) \
SYSCALL_ENTRY( NtQueryTimer ) \
...
...
dlls/wow64/wow64_private.h
View file @
9dfebb52
...
...
@@ -137,4 +137,12 @@ static inline void put_handle( ULONG *handle32, HANDLE handle )
*
handle32
=
HandleToULong
(
handle
);
}
static
inline
void
put_size
(
ULONG
*
size32
,
SIZE_T
size
)
{
if
(
size32
)
*
size32
=
min
(
size
,
MAXDWORD
);
}
extern
void
put_section_image_info
(
SECTION_IMAGE_INFORMATION32
*
info32
,
const
SECTION_IMAGE_INFORMATION
*
info
)
DECLSPEC_HIDDEN
;
#endif
/* __WOW64_PRIVATE_H */
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