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
6e41b512
Commit
6e41b512
authored
Feb 03, 2022
by
Eric Pouech
Committed by
Alexandre Julliard
Feb 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
schtasks/tests: Enable compilation with long types.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
72ca5d73
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
22 deletions
+21
-22
Makefile.in
programs/schtasks/tests/Makefile.in
+0
-1
schtasks.c
programs/schtasks/tests/schtasks.c
+21
-21
No files found.
programs/schtasks/tests/Makefile.in
View file @
6e41b512
EXTRADEFS
=
-DWINE_NO_LONG_TYPES
TESTDLL
=
schtasks.exe
IMPORTS
=
ole32
...
...
programs/schtasks/tests/schtasks.c
View file @
6e41b512
...
...
@@ -74,7 +74,7 @@ static DWORD _run_command(unsigned line, const char *cmd)
strcpy
(
command
,
cmd
);
r
=
CreateProcessA
(
NULL
,
command
,
NULL
,
NULL
,
TRUE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
);
ok_
(
__FILE__
,
line
)(
r
,
"CreateProcess failed: %u
\n
"
,
GetLastError
());
ok_
(
__FILE__
,
line
)(
r
,
"CreateProcess failed: %
l
u
\n
"
,
GetLastError
());
if
(
!
r
)
return
-
1
;
ret
=
WaitForSingleObject
(
pi
.
hProcess
,
10000
);
...
...
@@ -83,7 +83,7 @@ static DWORD _run_command(unsigned line, const char *cmd)
TerminateProcess
(
pi
.
hProcess
,
-
1
);
r
=
GetExitCodeProcess
(
pi
.
hProcess
,
&
ret
);
ok_
(
__FILE__
,
line
)(
r
,
"GetExitCodeProcess failed: %u
\n
"
,
GetLastError
());
ok_
(
__FILE__
,
line
)(
r
,
"GetExitCodeProcess failed: %
l
u
\n
"
,
GetLastError
());
CloseHandle
(
pi
.
hThread
);
CloseHandle
(
pi
.
hProcess
);
...
...
@@ -107,7 +107,7 @@ static void _register_task(unsigned line, const char *task_name_a)
hres
=
ITaskFolder_RegisterTask
(
root
,
task_name
,
xml
,
TASK_CREATE
,
empty
,
empty
,
TASK_LOGON_NONE
,
empty
,
&
task
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"RegisterTask failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"RegisterTask failed: %08
l
x
\n
"
,
hres
);
HeapFree
(
GetProcessHeap
(),
0
,
task_name
);
HeapFree
(
GetProcessHeap
(),
0
,
xml
);
...
...
@@ -123,7 +123,7 @@ static void _unregister_task(unsigned line, const char *task_name_a)
task_name
=
a2w
(
task_name_a
);
hres
=
ITaskFolder_DeleteTask
(
root
,
task_name
,
0
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"DeleteTask failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"DeleteTask failed: %08
l
x
\n
"
,
hres
);
HeapFree
(
GetProcessHeap
(),
0
,
task_name
);
}
...
...
@@ -141,7 +141,7 @@ static void create_file(const char *file_name, const char *data)
return
;
r
=
WriteFile
(
file
,
data
,
strlen
(
data
),
&
size
,
NULL
);
ok
(
r
,
"WriteFile failed: %u
\n
"
,
GetLastError
());
ok
(
r
,
"WriteFile failed: %
l
u
\n
"
,
GetLastError
());
CloseHandle
(
file
);
}
...
...
@@ -153,17 +153,17 @@ static BOOL initialize_task_service(void)
hres
=
CoCreateInstance
(
&
CLSID_TaskScheduler
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_ITaskService
,
(
void
**
)
&
service
);
if
(
hres
!=
S_OK
)
{
ok
(
hres
==
REGDB_E_CLASSNOTREG
,
"Could not create task service: %08x
\n
"
,
hres
);
ok
(
hres
==
REGDB_E_CLASSNOTREG
,
"Could not create task service: %08
l
x
\n
"
,
hres
);
win_skip
(
"Task service not available
\n
"
);
return
FALSE
;
}
V_VT
(
&
empty
)
=
VT_EMPTY
;
hres
=
ITaskService_Connect
(
service
,
empty
,
empty
,
empty
,
empty
);
ok
(
hres
==
S_OK
,
"Connect failed: %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"Connect failed: %08
l
x
\n
"
,
hres
);
hres
=
ITaskService_GetFolder
(
service
,
NULL
,
&
root
);
ok
(
hres
==
S_OK
,
"GetFolder error %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"GetFolder error %08
l
x
\n
"
,
hres
);
return
TRUE
;
}
...
...
@@ -180,51 +180,51 @@ START_TEST(schtasks)
}
r
=
run_command
(
"schtasks"
);
ok
(
r
==
0
,
"r = %u
\n
"
,
r
);
ok
(
r
==
0
,
"r = %
l
u
\n
"
,
r
);
register_task
(
"winetest"
);
r
=
run_command
(
"schtasks /change /tn winetest /enable"
);
ok
(
r
==
0
,
"r = %u
\n
"
,
r
);
ok
(
r
==
0
,
"r = %
l
u
\n
"
,
r
);
unregister_task
(
"winetest"
);
r
=
run_command
(
"schtasks /change /tn winetest /enable"
);
ok
(
r
==
1
,
"r = %u
\n
"
,
r
);
ok
(
r
==
1
,
"r = %
l
u
\n
"
,
r
);
register_task
(
"wine
\\
test
\\
winetest"
);
r
=
run_command
(
"schtasks /CHANGE /tn wine
\\
test
\\
winetest /enable"
);
ok
(
r
==
0
,
"r = %u
\n
"
,
r
);
ok
(
r
==
0
,
"r = %
l
u
\n
"
,
r
);
r
=
run_command
(
"schtasks /delete /f /tn wine
\\
test
\\
winetest"
);
ok
(
r
==
0
,
"r = %u
\n
"
,
r
);
ok
(
r
==
0
,
"r = %
l
u
\n
"
,
r
);
r
=
run_command
(
"schtasks /Change /tn wine
\\
test
\\
winetest /enable"
);
ok
(
r
==
1
,
"r = %u
\n
"
,
r
);
ok
(
r
==
1
,
"r = %
l
u
\n
"
,
r
);
create_file
(
"test.xml"
,
xml_a
);
r
=
run_command
(
"schtasks /create /xml test.xml /tn wine
\\
winetest"
);
ok
(
r
==
0
,
"r = %u
\n
"
,
r
);
ok
(
r
==
0
,
"r = %
l
u
\n
"
,
r
);
r
=
run_command
(
"schtasks /change /tn wine
\\
winetest /enable"
);
ok
(
r
==
0
,
"r = %u
\n
"
,
r
);
ok
(
r
==
0
,
"r = %
l
u
\n
"
,
r
);
r
=
run_command
(
"schtasks /create /xml test.xml /f /tn wine
\\
winetest"
);
ok
(
r
==
0
,
"r = %u
\n
"
,
r
);
/* task already exists, but /f argument provided */
ok
(
r
==
0
,
"r = %
l
u
\n
"
,
r
);
/* task already exists, but /f argument provided */
r
=
run_command
(
"schtasks /create /xml test.xml /tn wine
\\
winetest"
);
ok
(
r
==
1
,
"r = %u
\n
"
,
r
);
/* task already exists */
ok
(
r
==
1
,
"r = %
l
u
\n
"
,
r
);
/* task already exists */
r
=
run_command
(
"schtasks /create /tn wine
\\
winetest"
);
ok
(
r
==
E_FAIL
,
"r = %x
\n
"
,
r
);
/* missing arguments */
ok
(
r
==
E_FAIL
,
"r = %
l
x
\n
"
,
r
);
/* missing arguments */
r
=
run_command
(
"schtasks /Delete /f /tn wine
\\
winetest"
);
ok
(
r
==
0
,
"r = %u
\n
"
,
r
);
ok
(
r
==
0
,
"r = %
l
u
\n
"
,
r
);
r
=
DeleteFileA
(
"test.xml"
);
ok
(
r
,
"DeleteFileA failed: %u
\n
"
,
GetLastError
());
ok
(
r
,
"DeleteFileA failed: %
l
u
\n
"
,
GetLastError
());
ITaskFolder_DeleteFolder
(
root
,
wine_testW
,
0
);
ITaskFolder_DeleteFolder
(
root
,
wineW
,
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