Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
6c63fa62
Commit
6c63fa62
authored
Jul 15, 2007
by
Paul Vriens
Committed by
Alexandre Julliard
Jul 16, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/service: Check combination of service-type and start-type.
parent
27030599
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
service.c
dlls/advapi32/service.c
+8
-0
service.c
dlls/advapi32/tests/service.c
+8
-4
No files found.
dlls/advapi32/service.c
View file @
6c63fa62
...
...
@@ -1377,6 +1377,14 @@ CreateServiceW( SC_HANDLE hSCManager, LPCWSTR lpServiceName,
return
NULL
;
}
/* SERVICE_BOOT_START and SERVICE_SYSTEM_START or only allowed for driver services */
if
(((
dwStartType
==
SERVICE_BOOT_START
)
||
(
dwStartType
==
SERVICE_SYSTEM_START
))
&&
((
dwServiceType
&
SERVICE_WIN32_OWN_PROCESS
)
||
(
dwServiceType
&
SERVICE_WIN32_SHARE_PROCESS
)))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
NULL
;
}
r
=
RegCreateKeyExW
(
hscm
->
hkey
,
lpServiceName
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
KEY_ALL_ACCESS
,
NULL
,
&
hKey
,
&
dp
);
if
(
r
!=
ERROR_SUCCESS
)
...
...
dlls/advapi32/tests/service.c
View file @
6c63fa62
...
...
@@ -142,7 +142,7 @@ static void test_create_delete_svc(void)
static
const
CHAR
servicename
[]
=
"Winetest"
;
static
const
CHAR
pathname
[]
=
"we_dont_care.exe"
;
static
const
CHAR
empty
[]
=
""
;
static
const
CHAR
spooler
[]
=
"Spooler"
;
static
const
CHAR
spooler
[]
=
"Spooler"
;
/* Should be available on all platforms */
static
const
CHAR
password
[]
=
"secret"
;
/* Get the username and turn it into an account to be used in some tests */
...
...
@@ -267,9 +267,11 @@ static void test_create_delete_svc(void)
ok
(
!
svc_handle1
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
/* TODO: Add check for illegal combination of service-type and start-type */
/* TODO: Add check for displayname, it must be unique (or NULL/empty) */
/* Illegal (SERVICE_BOOT_START and SERVICE_SYSTEM_START or only allowed for driver services) */
SetLastError
(
0xdeadbeef
);
svc_handle1
=
CreateServiceA
(
scm_handle
,
servicename
,
NULL
,
0
,
SERVICE_WIN32_OWN_PROCESS
,
SERVICE_BOOT_START
,
0
,
pathname
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!
svc_handle1
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
/* The service already exists (check first, just in case) */
svc_handle1
=
OpenServiceA
(
scm_handle
,
spooler
,
GENERIC_READ
);
...
...
@@ -284,6 +286,8 @@ static void test_create_delete_svc(void)
else
skip
(
"Spooler service doesn't exist
\n
"
);
/* TODO: Add check for displayname, it must be unique (or NULL/empty) */
CloseServiceHandle
(
scm_handle
);
}
...
...
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