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
e88af468
Commit
e88af468
authored
Oct 28, 2007
by
Francois Gouget
Committed by
Alexandre Julliard
Oct 29, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winetest: Add an option that shuts Windows down once the tests have completed.
parent
bbf17b0a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
Makefile.in
programs/winetest/Makefile.in
+1
-1
main.c
programs/winetest/main.c
+22
-0
No files found.
programs/winetest/Makefile.in
View file @
e88af468
...
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
winetest.exe
APPMODE
=
-mconsole
IMPORTS
=
comctl32 version user32 gdi32 wsock32 kernel32
IMPORTS
=
comctl32 version user32 gdi32
advapi32
wsock32 kernel32
C_SRCS
=
\
gui.c
\
...
...
programs/winetest/main.c
View file @
e88af468
...
...
@@ -612,6 +612,7 @@ usage (void)
" -c console mode, no GUI
\n
"
" -e preserve the environment
\n
"
" -h print this message and exit
\n
"
" -p shutdown when the tests are done
\n
"
" -q quiet mode, no output at all
\n
"
" -o FILE put report into FILE, do not submit
\n
"
" -s FILE submit FILE, do not run tests
\n
"
...
...
@@ -624,6 +625,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
char
*
logname
=
NULL
;
const
char
*
cp
,
*
submit
=
NULL
;
int
reset_env
=
1
;
int
poweroff
=
0
;
int
interactive
=
1
;
/* initialize the revision information first */
...
...
@@ -645,8 +647,12 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
reset_env
=
0
;
break
;
case
'h'
:
case
'?'
:
usage
();
exit
(
0
);
case
'p'
:
poweroff
=
1
;
break
;
case
'q'
:
report
(
R_QUIET
);
interactive
=
0
;
...
...
@@ -718,5 +724,21 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
}
else
run_tests
(
logname
);
report
(
R_STATUS
,
"Finished"
);
}
if
(
poweroff
)
{
HANDLE
hToken
;
TOKEN_PRIVILEGES
npr
;
/* enable the shutdown privilege for the current process */
if
(
OpenProcessToken
(
GetCurrentProcess
(),
TOKEN_ADJUST_PRIVILEGES
,
&
hToken
))
{
LookupPrivilegeValueA
(
0
,
SE_SHUTDOWN_NAME
,
&
npr
.
Privileges
[
0
].
Luid
);
npr
.
PrivilegeCount
=
1
;
npr
.
Privileges
[
0
].
Attributes
=
SE_PRIVILEGE_ENABLED
;
AdjustTokenPrivileges
(
hToken
,
FALSE
,
&
npr
,
0
,
0
,
0
);
CloseHandle
(
hToken
);
}
ExitWindowsEx
(
EWX_SHUTDOWN
|
EWX_POWEROFF
|
EWX_FORCEIFHUNG
,
SHTDN_REASON_MAJOR_OTHER
|
SHTDN_REASON_MINOR_OTHER
);
}
exit
(
0
);
}
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