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
e69d218d
Commit
e69d218d
authored
Jan 02, 2022
by
Alex Henrie
Committed by
Alexandre Julliard
Jan 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
faultrep/tests: Drop workarounds for Windows <= 2000.
Signed-off-by:
Alex Henrie
<
alexhenrie24@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cd2b8b64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
56 deletions
+6
-56
faultrep.c
dlls/faultrep/tests/faultrep.c
+6
-56
No files found.
dlls/faultrep/tests/faultrep.c
View file @
e69d218d
...
...
@@ -36,65 +36,15 @@ static const char regpath_exclude[] = "ExclusionList";
static
BOOL
is_process_limited
(
void
)
{
static
BOOL
(
WINAPI
*
pCheckTokenMembership
)(
HANDLE
,
PSID
,
PBOOL
)
=
NULL
;
static
BOOL
(
WINAPI
*
pOpenProcessToken
)(
HANDLE
,
DWORD
,
PHANDLE
)
=
NULL
;
SID_IDENTIFIER_AUTHORITY
NtAuthority
=
{
SECURITY_NT_AUTHORITY
};
PSID
Group
;
BOOL
IsInGroup
;
HANDLE
token
;
TOKEN_ELEVATION_TYPE
type
=
TokenElevationTypeDefault
;
DWORD
size
;
if
(
!
pOpenProcessToken
)
{
HMODULE
hadvapi32
=
GetModuleHandleA
(
"advapi32.dll"
);
pOpenProcessToken
=
(
void
*
)
GetProcAddress
(
hadvapi32
,
"OpenProcessToken"
);
pCheckTokenMembership
=
(
void
*
)
GetProcAddress
(
hadvapi32
,
"CheckTokenMembership"
);
if
(
!
pCheckTokenMembership
||
!
pOpenProcessToken
)
{
/* Win9x (power to the masses) or NT4 (no way to know) */
trace
(
"missing pOpenProcessToken or CheckTokenMembership
\n
"
);
return
FALSE
;
}
}
if
(
!
AllocateAndInitializeSid
(
&
NtAuthority
,
2
,
SECURITY_BUILTIN_DOMAIN_RID
,
DOMAIN_ALIAS_RID_ADMINS
,
0
,
0
,
0
,
0
,
0
,
0
,
&
Group
)
||
!
pCheckTokenMembership
(
NULL
,
Group
,
&
IsInGroup
))
{
trace
(
"Could not check if the current user is an administrator
\n
"
);
return
FALSE
;
}
FreeSid
(
Group
);
if
(
!
IsInGroup
)
{
if
(
!
AllocateAndInitializeSid
(
&
NtAuthority
,
2
,
SECURITY_BUILTIN_DOMAIN_RID
,
DOMAIN_ALIAS_RID_POWER_USERS
,
0
,
0
,
0
,
0
,
0
,
0
,
&
Group
)
||
!
pCheckTokenMembership
(
NULL
,
Group
,
&
IsInGroup
))
{
trace
(
"Could not check if the current user is a power user
\n
"
);
return
FALSE
;
}
FreeSid
(
Group
);
if
(
!
IsInGroup
)
{
/* Only administrators and power users can be powerful */
return
TRUE
;
}
}
OpenProcessToken
(
GetCurrentProcess
(),
TOKEN_QUERY
,
&
token
);
GetTokenInformation
(
token
,
TokenElevationType
,
&
type
,
sizeof
(
type
),
&
size
);
CloseHandle
(
token
);
if
(
pOpenProcessToken
(
GetCurrentProcess
(),
TOKEN_QUERY
,
&
token
))
{
BOOL
ret
;
TOKEN_ELEVATION_TYPE
type
=
TokenElevationTypeDefault
;
DWORD
size
;
ret
=
GetTokenInformation
(
token
,
TokenElevationType
,
&
type
,
sizeof
(
type
),
&
size
);
CloseHandle
(
token
);
return
(
ret
&&
type
==
TokenElevationTypeLimited
);
}
return
FALSE
;
return
type
==
TokenElevationTypeLimited
;
}
...
...
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