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
0327f84a
Commit
0327f84a
authored
Sep 04, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implemented NtOpenProcessTokenEx and NtOpenThreadTokenEx.
parent
1abf8090
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
21 deletions
+41
-21
nt.c
dlls/ntdll/nt.c
+31
-13
ntdll.spec
dlls/ntdll/ntdll.spec
+8
-8
winternl.h
include/winternl.h
+2
-0
No files found.
dlls/ntdll/nt.c
View file @
0327f84a
...
@@ -96,21 +96,30 @@ NTSTATUS WINAPI NtOpenProcessToken(
...
@@ -96,21 +96,30 @@ NTSTATUS WINAPI NtOpenProcessToken(
DWORD
DesiredAccess
,
DWORD
DesiredAccess
,
HANDLE
*
TokenHandle
)
HANDLE
*
TokenHandle
)
{
{
return
NtOpenProcessTokenEx
(
ProcessHandle
,
DesiredAccess
,
0
,
TokenHandle
);
}
/******************************************************************************
* NtOpenProcessTokenEx [NTDLL.@]
* ZwOpenProcessTokenEx [NTDLL.@]
*/
NTSTATUS
WINAPI
NtOpenProcessTokenEx
(
HANDLE
process
,
DWORD
access
,
DWORD
attributes
,
HANDLE
*
handle
)
{
NTSTATUS
ret
;
NTSTATUS
ret
;
TRACE
(
"(%p,0x%08x,
%p)
\n
"
,
ProcessHandle
,
DesiredAccess
,
TokenH
andle
);
TRACE
(
"(%p,0x%08x,
0x%08x,%p)
\n
"
,
process
,
access
,
attributes
,
h
andle
);
SERVER_START_REQ
(
open_token
)
SERVER_START_REQ
(
open_token
)
{
{
req
->
handle
=
ProcessHandle
;
req
->
handle
=
process
;
req
->
access
=
DesiredA
ccess
;
req
->
access
=
a
ccess
;
req
->
attributes
=
0
;
req
->
attributes
=
attributes
;
req
->
flags
=
0
;
req
->
flags
=
0
;
ret
=
wine_server_call
(
req
);
ret
=
wine_server_call
(
req
);
if
(
!
ret
)
*
TokenH
andle
=
reply
->
token
;
if
(
!
ret
)
*
h
andle
=
reply
->
token
;
}
}
SERVER_END_REQ
;
SERVER_END_REQ
;
return
ret
;
return
ret
;
}
}
...
@@ -124,20 +133,29 @@ NTSTATUS WINAPI NtOpenThreadToken(
...
@@ -124,20 +133,29 @@ NTSTATUS WINAPI NtOpenThreadToken(
BOOLEAN
OpenAsSelf
,
BOOLEAN
OpenAsSelf
,
HANDLE
*
TokenHandle
)
HANDLE
*
TokenHandle
)
{
{
return
NtOpenThreadTokenEx
(
ThreadHandle
,
DesiredAccess
,
OpenAsSelf
,
0
,
TokenHandle
);
}
/******************************************************************************
* NtOpenThreadTokenEx [NTDLL.@]
* ZwOpenThreadTokenEx [NTDLL.@]
*/
NTSTATUS
WINAPI
NtOpenThreadTokenEx
(
HANDLE
thread
,
DWORD
access
,
BOOLEAN
as_self
,
DWORD
attributes
,
HANDLE
*
handle
)
{
NTSTATUS
ret
;
NTSTATUS
ret
;
TRACE
(
"(%p,0x%08x,0x%08x,%p)
\n
"
,
TRACE
(
"(%p,0x%08x,%u,0x%08x,%p)
\n
"
,
thread
,
access
,
as_self
,
attributes
,
handle
);
ThreadHandle
,
DesiredAccess
,
OpenAsSelf
,
TokenHandle
);
SERVER_START_REQ
(
open_token
)
SERVER_START_REQ
(
open_token
)
{
{
req
->
handle
=
ThreadHandle
;
req
->
handle
=
thread
;
req
->
access
=
DesiredA
ccess
;
req
->
access
=
a
ccess
;
req
->
attributes
=
0
;
req
->
attributes
=
attributes
;
req
->
flags
=
OPEN_TOKEN_THREAD
;
req
->
flags
=
OPEN_TOKEN_THREAD
;
if
(
OpenAsS
elf
)
req
->
flags
|=
OPEN_TOKEN_AS_SELF
;
if
(
as_s
elf
)
req
->
flags
|=
OPEN_TOKEN_AS_SELF
;
ret
=
wine_server_call
(
req
);
ret
=
wine_server_call
(
req
);
if
(
!
ret
)
*
TokenH
andle
=
reply
->
token
;
if
(
!
ret
)
*
h
andle
=
reply
->
token
;
}
}
SERVER_END_REQ
;
SERVER_END_REQ
;
...
...
dlls/ntdll/ntdll.spec
View file @
0327f84a
...
@@ -214,14 +214,14 @@
...
@@ -214,14 +214,14 @@
@ stdcall NtOpenMutant(ptr long ptr)
@ stdcall NtOpenMutant(ptr long ptr)
@ stub NtOpenObjectAuditAlarm
@ stub NtOpenObjectAuditAlarm
@ stdcall NtOpenProcess(ptr long ptr ptr)
@ stdcall NtOpenProcess(ptr long ptr ptr)
@ stdcall NtOpenProcessToken(long long
long
)
@ stdcall NtOpenProcessToken(long long
ptr
)
# @ stub NtOpenProcessTokenEx
@ stdcall NtOpenProcessTokenEx(long long long ptr)
@ stdcall NtOpenSection(ptr long ptr)
@ stdcall NtOpenSection(ptr long ptr)
@ stdcall NtOpenSemaphore(long long ptr)
@ stdcall NtOpenSemaphore(long long ptr)
@ stdcall NtOpenSymbolicLinkObject (ptr long ptr)
@ stdcall NtOpenSymbolicLinkObject (ptr long ptr)
@ stdcall NtOpenThread(ptr long ptr ptr)
@ stdcall NtOpenThread(ptr long ptr ptr)
@ stdcall NtOpenThreadToken(long long long
long
)
@ stdcall NtOpenThreadToken(long long long
ptr
)
# @ stub NtOpenThreadTokenEx
@ stdcall NtOpenThreadTokenEx(long long long long ptr)
@ stdcall NtOpenTimer(ptr long ptr)
@ stdcall NtOpenTimer(ptr long ptr)
@ stub NtPlugPlayControl
@ stub NtPlugPlayControl
@ stdcall NtPowerInformation(long ptr long ptr long)
@ stdcall NtPowerInformation(long ptr long ptr long)
...
@@ -1058,14 +1058,14 @@
...
@@ -1058,14 +1058,14 @@
@ stdcall ZwOpenMutant(ptr long ptr) NtOpenMutant
@ stdcall ZwOpenMutant(ptr long ptr) NtOpenMutant
@ stub ZwOpenObjectAuditAlarm
@ stub ZwOpenObjectAuditAlarm
@ stdcall ZwOpenProcess(ptr long ptr ptr) NtOpenProcess
@ stdcall ZwOpenProcess(ptr long ptr ptr) NtOpenProcess
@ stdcall ZwOpenProcessToken(long long
long
) NtOpenProcessToken
@ stdcall ZwOpenProcessToken(long long
ptr
) NtOpenProcessToken
# @ stub Zw
OpenProcessTokenEx
@ stdcall ZwOpenProcessTokenEx(long long long ptr) Nt
OpenProcessTokenEx
@ stdcall ZwOpenSection(ptr long ptr) NtOpenSection
@ stdcall ZwOpenSection(ptr long ptr) NtOpenSection
@ stdcall ZwOpenSemaphore(long long ptr) NtOpenSemaphore
@ stdcall ZwOpenSemaphore(long long ptr) NtOpenSemaphore
@ stdcall ZwOpenSymbolicLinkObject (ptr long ptr) NtOpenSymbolicLinkObject
@ stdcall ZwOpenSymbolicLinkObject (ptr long ptr) NtOpenSymbolicLinkObject
@ stdcall ZwOpenThread(ptr long ptr ptr) NtOpenThread
@ stdcall ZwOpenThread(ptr long ptr ptr) NtOpenThread
@ stdcall ZwOpenThreadToken(long long long
long
) NtOpenThreadToken
@ stdcall ZwOpenThreadToken(long long long
ptr
) NtOpenThreadToken
# @ stub Zw
OpenThreadTokenEx
@ stdcall ZwOpenThreadTokenEx(long long long long ptr) Nt
OpenThreadTokenEx
@ stdcall ZwOpenTimer(ptr long ptr) NtOpenTimer
@ stdcall ZwOpenTimer(ptr long ptr) NtOpenTimer
@ stub ZwPlugPlayControl
@ stub ZwPlugPlayControl
@ stdcall ZwPowerInformation(long ptr long ptr long) NtPowerInformation
@ stdcall ZwPowerInformation(long ptr long ptr long) NtPowerInformation
...
...
include/winternl.h
View file @
0327f84a
...
@@ -1942,11 +1942,13 @@ NTSYSAPI NTSTATUS WINAPI NtOpenMutant(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUT
...
@@ -1942,11 +1942,13 @@ NTSYSAPI NTSTATUS WINAPI NtOpenMutant(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUT
NTSYSAPI
NTSTATUS
WINAPI
NtOpenObjectAuditAlarm
(
PUNICODE_STRING
,
PHANDLE
,
PUNICODE_STRING
,
PUNICODE_STRING
,
PSECURITY_DESCRIPTOR
,
HANDLE
,
ACCESS_MASK
,
ACCESS_MASK
,
PPRIVILEGE_SET
,
BOOLEAN
,
BOOLEAN
,
PBOOLEAN
);
NTSYSAPI
NTSTATUS
WINAPI
NtOpenObjectAuditAlarm
(
PUNICODE_STRING
,
PHANDLE
,
PUNICODE_STRING
,
PUNICODE_STRING
,
PSECURITY_DESCRIPTOR
,
HANDLE
,
ACCESS_MASK
,
ACCESS_MASK
,
PPRIVILEGE_SET
,
BOOLEAN
,
BOOLEAN
,
PBOOLEAN
);
NTSYSAPI
NTSTATUS
WINAPI
NtOpenProcess
(
PHANDLE
,
ACCESS_MASK
,
const
OBJECT_ATTRIBUTES
*
,
const
CLIENT_ID
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtOpenProcess
(
PHANDLE
,
ACCESS_MASK
,
const
OBJECT_ATTRIBUTES
*
,
const
CLIENT_ID
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtOpenProcessToken
(
HANDLE
,
DWORD
,
HANDLE
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtOpenProcessToken
(
HANDLE
,
DWORD
,
HANDLE
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtOpenProcessTokenEx
(
HANDLE
,
DWORD
,
DWORD
,
HANDLE
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtOpenSection
(
HANDLE
*
,
ACCESS_MASK
,
const
OBJECT_ATTRIBUTES
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtOpenSection
(
HANDLE
*
,
ACCESS_MASK
,
const
OBJECT_ATTRIBUTES
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtOpenSemaphore
(
PHANDLE
,
ACCESS_MASK
,
const
OBJECT_ATTRIBUTES
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtOpenSemaphore
(
PHANDLE
,
ACCESS_MASK
,
const
OBJECT_ATTRIBUTES
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtOpenSymbolicLinkObject
(
PHANDLE
,
ACCESS_MASK
,
POBJECT_ATTRIBUTES
);
NTSYSAPI
NTSTATUS
WINAPI
NtOpenSymbolicLinkObject
(
PHANDLE
,
ACCESS_MASK
,
POBJECT_ATTRIBUTES
);
NTSYSAPI
NTSTATUS
WINAPI
NtOpenThread
(
HANDLE
*
,
ACCESS_MASK
,
const
OBJECT_ATTRIBUTES
*
,
const
CLIENT_ID
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtOpenThread
(
HANDLE
*
,
ACCESS_MASK
,
const
OBJECT_ATTRIBUTES
*
,
const
CLIENT_ID
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtOpenThreadToken
(
HANDLE
,
DWORD
,
BOOLEAN
,
HANDLE
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtOpenThreadToken
(
HANDLE
,
DWORD
,
BOOLEAN
,
HANDLE
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtOpenThreadTokenEx
(
HANDLE
,
DWORD
,
BOOLEAN
,
DWORD
,
HANDLE
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtOpenTimer
(
HANDLE
*
,
ACCESS_MASK
,
const
OBJECT_ATTRIBUTES
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtOpenTimer
(
HANDLE
*
,
ACCESS_MASK
,
const
OBJECT_ATTRIBUTES
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtPowerInformation
(
POWER_INFORMATION_LEVEL
,
PVOID
,
ULONG
,
PVOID
,
ULONG
);
NTSYSAPI
NTSTATUS
WINAPI
NtPowerInformation
(
POWER_INFORMATION_LEVEL
,
PVOID
,
ULONG
,
PVOID
,
ULONG
);
NTSYSAPI
NTSTATUS
WINAPI
NtPrivilegeCheck
(
HANDLE
,
PPRIVILEGE_SET
,
PBOOLEAN
);
NTSYSAPI
NTSTATUS
WINAPI
NtPrivilegeCheck
(
HANDLE
,
PPRIVILEGE_SET
,
PBOOLEAN
);
...
...
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