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
b7afd8ba
Commit
b7afd8ba
authored
Mar 24, 2023
by
Francois Gouget
Committed by
Alexandre Julliard
Mar 28, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
taskschd/tests: Elevated privileges are needed to connect using a hostname.
Being in the administrator group is not sufficient.
parent
27f378f0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
scheduler.c
dlls/taskschd/tests/scheduler.c
+18
-1
No files found.
dlls/taskschd/tests/scheduler.c
View file @
b7afd8ba
...
...
@@ -29,6 +29,22 @@
#include <wine/test.h>
static
BOOL
is_process_elevated
(
void
)
{
HANDLE
token
;
if
(
OpenProcessToken
(
GetCurrentProcess
(),
TOKEN_QUERY
,
&
token
))
{
TOKEN_ELEVATION_TYPE
type
;
DWORD
size
;
BOOL
ret
;
ret
=
GetTokenInformation
(
token
,
TokenElevationType
,
&
type
,
sizeof
(
type
),
&
size
);
CloseHandle
(
token
);
return
(
ret
&&
type
==
TokenElevationTypeFull
);
}
return
FALSE
;
}
static
void
test_Connect
(
void
)
{
WCHAR
comp_name
[
MAX_COMPUTERNAME_LENGTH
+
1
];
...
...
@@ -73,7 +89,8 @@ static void test_Connect(void)
V_BSTR
(
&
v_comp
)
=
SysAllocString
(
comp_name
);
hr
=
ITaskService_Connect
(
service
,
v_comp
,
v_null
,
v_null
,
v_null
);
ok
(
hr
==
S_OK
||
hr
==
E_ACCESSDENIED
/* not an administrator */
,
"Connect error %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
||
(
hr
==
E_ACCESSDENIED
&&
!
is_process_elevated
()),
"Connect error %#lx
\n
"
,
hr
);
was_connected
=
hr
==
S_OK
;
SysFreeString
(
V_BSTR
(
&
v_comp
));
...
...
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