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
ba74c5c6
Commit
ba74c5c6
authored
Jul 29, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wow64: Add thunks for the process/thread set information syscalls.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ebb4d388
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
175 additions
and
0 deletions
+175
-0
process.c
dlls/wow64/process.c
+150
-0
struct32.h
dlls/wow64/struct32.h
+23
-0
syscall.h
dlls/wow64/syscall.h
+2
-0
No files found.
dlls/wow64/process.c
View file @
ba74c5c6
...
...
@@ -817,6 +817,156 @@ NTSTATUS WINAPI wow64_NtSetContextThread( UINT *args )
/**********************************************************************
* wow64_NtSetInformationProcess
*/
NTSTATUS
WINAPI
wow64_NtSetInformationProcess
(
UINT
*
args
)
{
HANDLE
handle
=
get_handle
(
&
args
);
PROCESSINFOCLASS
class
=
get_ulong
(
&
args
);
void
*
ptr
=
get_ptr
(
&
args
);
ULONG
len
=
get_ulong
(
&
args
);
NTSTATUS
status
;
switch
(
class
)
{
case
ProcessDefaultHardErrorMode
:
/* ULONG */
case
ProcessPriorityClass
:
/* PROCESS_PRIORITY_CLASS */
return
NtSetInformationProcess
(
handle
,
class
,
ptr
,
len
);
case
ProcessAffinityMask
:
/* ULONG_PTR */
if
(
len
==
sizeof
(
ULONG
))
{
ULONG_PTR
mask
=
*
(
ULONG
*
)
ptr
;
return
NtSetInformationProcess
(
handle
,
class
,
&
mask
,
sizeof
(
mask
)
);
}
else
return
STATUS_INVALID_PARAMETER
;
case
ProcessExecuteFlags
:
/* ULONG */
return
STATUS_ACCESS_DENIED
;
case
ProcessInstrumentationCallback
:
/* PROCESS_INSTRUMENTATION_CALLBACK_INFORMATION */
if
(
len
==
sizeof
(
PROCESS_INSTRUMENTATION_CALLBACK_INFORMATION32
))
{
FIXME
(
"ProcessInstrumentationCallback stub
\n
"
);
return
STATUS_SUCCESS
;
}
else
return
STATUS_INFO_LENGTH_MISMATCH
;
case
ProcessThreadStackAllocation
:
/* PROCESS_STACK_ALLOCATION_INFORMATION(_EX) */
if
(
len
==
sizeof
(
PROCESS_STACK_ALLOCATION_INFORMATION_EX32
))
{
PROCESS_STACK_ALLOCATION_INFORMATION_EX32
*
stack
=
ptr
;
PROCESS_STACK_ALLOCATION_INFORMATION_EX
info
;
info
.
PreferredNode
=
stack
->
PreferredNode
;
info
.
Reserved0
=
stack
->
Reserved0
;
info
.
Reserved1
=
stack
->
Reserved1
;
info
.
Reserved2
=
stack
->
Reserved2
;
info
.
AllocInfo
.
ReserveSize
=
stack
->
AllocInfo
.
ReserveSize
;
info
.
AllocInfo
.
ZeroBits
=
get_zero_bits
(
stack
->
AllocInfo
.
ZeroBits
);
if
(
!
(
status
=
NtSetInformationProcess
(
handle
,
class
,
&
info
,
sizeof
(
info
)
)))
stack
->
AllocInfo
.
StackBase
=
PtrToUlong
(
info
.
AllocInfo
.
StackBase
);
return
status
;
}
else
if
(
len
==
sizeof
(
PROCESS_STACK_ALLOCATION_INFORMATION32
))
{
PROCESS_STACK_ALLOCATION_INFORMATION32
*
stack
=
ptr
;
PROCESS_STACK_ALLOCATION_INFORMATION
info
;
info
.
ReserveSize
=
stack
->
ReserveSize
;
info
.
ZeroBits
=
stack
->
ZeroBits
?
stack
->
ZeroBits
:
0x7fffffff
;
if
(
!
(
status
=
NtSetInformationProcess
(
handle
,
class
,
&
info
,
sizeof
(
info
)
)))
stack
->
StackBase
=
PtrToUlong
(
info
.
StackBase
);
return
status
;
}
else
return
STATUS_INFO_LENGTH_MISMATCH
;
case
ProcessWineMakeProcessSystem
:
/* HANDLE* */
if
(
len
==
sizeof
(
ULONG
))
{
HANDLE
event
=
0
;
status
=
NtSetInformationProcess
(
handle
,
class
,
&
event
,
sizeof
(
HANDLE
*
)
);
put_handle
(
ptr
,
event
);
return
status
;
}
else
return
STATUS_INFO_LENGTH_MISMATCH
;
default:
FIXME
(
"unsupported class %u
\n
"
,
class
);
return
STATUS_INVALID_INFO_CLASS
;
}
}
/**********************************************************************
* wow64_NtSetInformationThread
*/
NTSTATUS
WINAPI
wow64_NtSetInformationThread
(
UINT
*
args
)
{
HANDLE
handle
=
get_handle
(
&
args
);
THREADINFOCLASS
class
=
get_ulong
(
&
args
);
void
*
ptr
=
get_ptr
(
&
args
);
ULONG
len
=
get_ulong
(
&
args
);
switch
(
class
)
{
case
ThreadZeroTlsCell
:
/* ULONG */
case
ThreadBasePriority
:
/* ULONG */
case
ThreadHideFromDebugger
:
/* void */
case
ThreadEnableAlignmentFaultFixup
:
/* BOOLEAN */
return
NtSetInformationThread
(
handle
,
class
,
ptr
,
len
);
case
ThreadImpersonationToken
:
/* HANDLE */
if
(
len
==
sizeof
(
ULONG
))
{
HANDLE
token
=
LongToHandle
(
*
(
ULONG
*
)
ptr
);
return
NtSetInformationThread
(
handle
,
class
,
&
token
,
sizeof
(
token
)
);
}
else
return
STATUS_INVALID_PARAMETER
;
case
ThreadAffinityMask
:
/* ULONG_PTR */
case
ThreadQuerySetWin32StartAddress
:
/* PRTL_THREAD_START_ROUTINE */
if
(
len
==
sizeof
(
ULONG
))
{
ULONG_PTR
mask
=
*
(
ULONG
*
)
ptr
;
return
NtSetInformationThread
(
handle
,
class
,
&
mask
,
sizeof
(
mask
)
);
}
else
return
STATUS_INVALID_PARAMETER
;
case
ThreadWow64Context
:
/* WOW64_CONTEXT* */
return
STATUS_INVALID_INFO_CLASS
;
case
ThreadGroupInformation
:
/* GROUP_AFFINITY */
if
(
len
==
sizeof
(
GROUP_AFFINITY32
))
{
GROUP_AFFINITY32
*
info32
=
ptr
;
GROUP_AFFINITY
info
=
{
info32
->
Mask
,
info32
->
Group
};
return
NtSetInformationThread
(
handle
,
class
,
&
info
,
sizeof
(
info
)
);
}
else
return
STATUS_INVALID_PARAMETER
;
case
ThreadDescription
:
/* THREAD_DESCRIPTION_INFORMATION */
if
(
len
==
sizeof
(
THREAD_DESCRIPTION_INFORMATION32
))
{
THREAD_DESCRIPTION_INFORMATION32
*
info32
=
ptr
;
THREAD_DESCRIPTION_INFORMATION
info
;
if
(
!
unicode_str_32to64
(
&
info
.
Description
,
&
info32
->
Description
))
return
STATUS_ACCESS_VIOLATION
;
return
NtSetInformationThread
(
handle
,
class
,
&
info
,
sizeof
(
info
)
);
}
else
return
STATUS_INFO_LENGTH_MISMATCH
;
default:
FIXME
(
"unsupported class %u
\n
"
,
class
);
return
STATUS_INVALID_INFO_CLASS
;
}
}
/**********************************************************************
* wow64_NtSetThreadExecutionState
*/
NTSTATUS
WINAPI
wow64_NtSetThreadExecutionState
(
UINT
*
args
)
...
...
dlls/wow64/struct32.h
View file @
ba74c5c6
...
...
@@ -155,6 +155,29 @@ typedef struct
typedef
struct
{
ULONG
Version
;
ULONG
Reserved
;
ULONG
Callback
;
}
PROCESS_INSTRUMENTATION_CALLBACK_INFORMATION32
;
typedef
struct
{
ULONG
ReserveSize
;
ULONG
ZeroBits
;
ULONG
StackBase
;
}
PROCESS_STACK_ALLOCATION_INFORMATION32
;
typedef
struct
{
ULONG
PreferredNode
;
ULONG
Reserved0
;
ULONG
Reserved1
;
ULONG
Reserved2
;
PROCESS_STACK_ALLOCATION_INFORMATION32
AllocInfo
;
}
PROCESS_STACK_ALLOCATION_INFORMATION_EX32
;
typedef
struct
{
ULONG
Size
;
PS_CREATE_STATE
State
;
union
...
...
dlls/wow64/syscall.h
View file @
ba74c5c6
...
...
@@ -168,6 +168,8 @@
SYSCALL_ENTRY( NtSetInformationFile ) \
SYSCALL_ENTRY( NtSetInformationKey ) \
SYSCALL_ENTRY( NtSetInformationObject ) \
SYSCALL_ENTRY( NtSetInformationProcess ) \
SYSCALL_ENTRY( NtSetInformationThread ) \
SYSCALL_ENTRY( NtSetIoCompletion ) \
SYSCALL_ENTRY( NtSetPowerRequest ) \
SYSCALL_ENTRY( NtSetThreadExecutionState ) \
...
...
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