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
07ac635d
Commit
07ac635d
authored
Feb 12, 2014
by
Francois Gouget
Committed by
Alexandre Julliard
Feb 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atl/registrar: Skip the test_registrar() tests if we don't have elevated privileges.
parent
7b089951
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
1 deletion
+37
-1
registrar.c
dlls/atl/tests/registrar.c
+37
-1
No files found.
dlls/atl/tests/registrar.c
View file @
07ac635d
...
...
@@ -37,6 +37,34 @@
#include <initguid.h>
#include <atliface.h>
static
BOOL
is_process_limited
(
void
)
{
static
BOOL
(
WINAPI
*
pOpenProcessToken
)(
HANDLE
,
DWORD
,
PHANDLE
)
=
NULL
;
HANDLE
token
;
if
(
!
pOpenProcessToken
)
{
HMODULE
hadvapi32
=
GetModuleHandleA
(
"advapi32.dll"
);
pOpenProcessToken
=
(
void
*
)
GetProcAddress
(
hadvapi32
,
"OpenProcessToken"
);
if
(
!
pOpenProcessToken
)
return
FALSE
;
}
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
;
}
static
const
char
textA
[]
=
"HKCR
\n
"
"{
\n
"
...
...
@@ -84,7 +112,15 @@ static void test_registrar(void)
MultiByteToWideChar
(
CP_ACP
,
0
,
textA
,
-
1
,
textW
,
count
);
hr
=
IRegistrar_StringRegister
(
registrar
,
textW
);
ok
(
SUCCEEDED
(
hr
),
"IRegistrar_StringRegister failed, hr = 0x%08X
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
int
is_limited
=
is_process_limited
();
ok
(
hr
==
DISP_E_EXCEPTION
&&
is_limited
,
"IRegistrar_StringRegister failed, hr = 0x%08X, is_limited=%d
\n
"
,
hr
,
is_limited
);
skip
(
"Skipping registrar tests
\n
"
);
IRegistrar_Release
(
registrar
);
return
;
}
lret
=
RegOpenKeyA
(
HKEY_CLASSES_ROOT
,
"eebf73c4-50fd-478f-bbcf-db212221227a"
,
&
key
);
ok
(
lret
==
ERROR_SUCCESS
,
"error %d opening registry key
\n
"
,
lret
);
...
...
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