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
fc453527
Commit
fc453527
authored
Mar 16, 2007
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Mar 17, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: DuplicateTokenEx is not present on all platforms.
parent
439b852d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
security.c
dlls/advapi32/tests/security.c
+9
-1
No files found.
dlls/advapi32/tests/security.c
View file @
fc453527
...
@@ -55,6 +55,8 @@ typedef BOOL (WINAPI *fnGetFileSecurityA)(LPCSTR, SECURITY_INFORMATION,
...
@@ -55,6 +55,8 @@ typedef BOOL (WINAPI *fnGetFileSecurityA)(LPCSTR, SECURITY_INFORMATION,
PSECURITY_DESCRIPTOR
,
DWORD
,
LPDWORD
);
PSECURITY_DESCRIPTOR
,
DWORD
,
LPDWORD
);
typedef
DWORD
(
WINAPI
*
fnRtlAdjustPrivilege
)(
ULONG
,
BOOLEAN
,
BOOLEAN
,
PBOOLEAN
);
typedef
DWORD
(
WINAPI
*
fnRtlAdjustPrivilege
)(
ULONG
,
BOOLEAN
,
BOOLEAN
,
PBOOLEAN
);
typedef
BOOL
(
WINAPI
*
fnCreateWellKnownSid
)(
WELL_KNOWN_SID_TYPE
,
PSID
,
PSID
,
DWORD
*
);
typedef
BOOL
(
WINAPI
*
fnCreateWellKnownSid
)(
WELL_KNOWN_SID_TYPE
,
PSID
,
PSID
,
DWORD
*
);
typedef
BOOL
(
WINAPI
*
fnDuplicateTokenEx
)(
HANDLE
,
DWORD
,
LPSECURITY_ATTRIBUTES
,
SECURITY_IMPERSONATION_LEVEL
,
TOKEN_TYPE
,
PHANDLE
);
typedef
NTSTATUS
(
WINAPI
*
fnLsaQueryInformationPolicy
)(
LSA_HANDLE
,
POLICY_INFORMATION_CLASS
,
PVOID
*
);
typedef
NTSTATUS
(
WINAPI
*
fnLsaQueryInformationPolicy
)(
LSA_HANDLE
,
POLICY_INFORMATION_CLASS
,
PVOID
*
);
typedef
NTSTATUS
(
WINAPI
*
fnLsaClose
)(
LSA_HANDLE
);
typedef
NTSTATUS
(
WINAPI
*
fnLsaClose
)(
LSA_HANDLE
);
...
@@ -76,6 +78,7 @@ fnConvertStringSidToSidA pConvertStringSidToSidA;
...
@@ -76,6 +78,7 @@ fnConvertStringSidToSidA pConvertStringSidToSidA;
fnGetFileSecurityA
pGetFileSecurityA
;
fnGetFileSecurityA
pGetFileSecurityA
;
fnRtlAdjustPrivilege
pRtlAdjustPrivilege
;
fnRtlAdjustPrivilege
pRtlAdjustPrivilege
;
fnCreateWellKnownSid
pCreateWellKnownSid
;
fnCreateWellKnownSid
pCreateWellKnownSid
;
fnDuplicateTokenEx
pDuplicateTokenEx
;
fnLsaQueryInformationPolicy
pLsaQueryInformationPolicy
;
fnLsaQueryInformationPolicy
pLsaQueryInformationPolicy
;
fnLsaClose
pLsaClose
;
fnLsaClose
pLsaClose
;
fnLsaFreeMemory
pLsaFreeMemory
;
fnLsaFreeMemory
pLsaFreeMemory
;
...
@@ -1592,6 +1595,11 @@ static void test_impersonation_level(void)
...
@@ -1592,6 +1595,11 @@ static void test_impersonation_level(void)
HKEY
hkey
;
HKEY
hkey
;
DWORD
error
;
DWORD
error
;
pDuplicateTokenEx
=
(
fnDuplicateTokenEx
)
GetProcAddress
(
hmod
,
"DuplicateTokenEx"
);
if
(
!
pDuplicateTokenEx
)
{
skip
(
"DuplicateTokenEx
\n
"
);
return
;
}
ret
=
ImpersonateSelf
(
SecurityAnonymous
);
ret
=
ImpersonateSelf
(
SecurityAnonymous
);
ok
(
ret
,
"ImpersonateSelf(SecurityAnonymous) failed with error %d
\n
"
,
GetLastError
());
ok
(
ret
,
"ImpersonateSelf(SecurityAnonymous) failed with error %d
\n
"
,
GetLastError
());
ret
=
OpenThreadToken
(
GetCurrentThread
(),
TOKEN_QUERY
|
TOKEN_ADJUST_PRIVILEGES
|
TOKEN_QUERY_SOURCE
|
TOKEN_IMPERSONATE
|
TOKEN_ADJUST_DEFAULT
,
TRUE
,
&
Token
);
ret
=
OpenThreadToken
(
GetCurrentThread
(),
TOKEN_QUERY
|
TOKEN_ADJUST_PRIVILEGES
|
TOKEN_QUERY_SOURCE
|
TOKEN_IMPERSONATE
|
TOKEN_ADJUST_DEFAULT
,
TRUE
,
&
Token
);
...
@@ -1608,7 +1616,7 @@ static void test_impersonation_level(void)
...
@@ -1608,7 +1616,7 @@ static void test_impersonation_level(void)
ret
=
OpenProcessToken
(
GetCurrentProcess
(),
TOKEN_DUPLICATE
,
&
ProcessToken
);
ret
=
OpenProcessToken
(
GetCurrentProcess
(),
TOKEN_DUPLICATE
,
&
ProcessToken
);
ok
(
ret
,
"OpenProcessToken failed with error %d
\n
"
,
GetLastError
());
ok
(
ret
,
"OpenProcessToken failed with error %d
\n
"
,
GetLastError
());
ret
=
DuplicateTokenEx
(
ProcessToken
,
ret
=
p
DuplicateTokenEx
(
ProcessToken
,
TOKEN_QUERY
|
TOKEN_DUPLICATE
|
TOKEN_IMPERSONATE
,
NULL
,
TOKEN_QUERY
|
TOKEN_DUPLICATE
|
TOKEN_IMPERSONATE
,
NULL
,
SecurityAnonymous
,
TokenImpersonation
,
&
Token
);
SecurityAnonymous
,
TokenImpersonation
,
&
Token
);
ok
(
ret
,
"DuplicateTokenEx failed with error %d
\n
"
,
GetLastError
());
ok
(
ret
,
"DuplicateTokenEx failed with error %d
\n
"
,
GetLastError
());
...
...
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