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
fe3ba129
Commit
fe3ba129
authored
Jan 20, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Add some more tests for GetServiceKeyName.
parent
df671256
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
2 deletions
+47
-2
service.c
dlls/advapi32/tests/service.c
+47
-2
No files found.
dlls/advapi32/tests/service.c
View file @
fe3ba129
...
@@ -625,6 +625,7 @@ static void test_get_servicekeyname(void)
...
@@ -625,6 +625,7 @@ static void test_get_servicekeyname(void)
BOOL
ret
;
BOOL
ret
;
static
const
CHAR
deadbeef
[]
=
"Deadbeef"
;
static
const
CHAR
deadbeef
[]
=
"Deadbeef"
;
static
const
WCHAR
deadbeefW
[]
=
{
'D'
,
'e'
,
'a'
,
'd'
,
'b'
,
'e'
,
'e'
,
'f'
,
0
};
static
const
WCHAR
deadbeefW
[]
=
{
'D'
,
'e'
,
'a'
,
'd'
,
'b'
,
'e'
,
'e'
,
'f'
,
0
};
static
const
WCHAR
abcW
[]
=
{
'A'
,
'B'
,
'C'
,
0
};
/* Having NULL for the size of the buffer will crash on W2K3 */
/* Having NULL for the size of the buffer will crash on W2K3 */
...
@@ -667,13 +668,17 @@ static void test_get_servicekeyname(void)
...
@@ -667,13 +668,17 @@ static void test_get_servicekeyname(void)
strcpy
(
servicename
,
"ABC"
);
strcpy
(
servicename
,
"ABC"
);
ret
=
GetServiceKeyNameA
(
scm_handle
,
deadbeef
,
servicename
,
&
servicesize
);
ret
=
GetServiceKeyNameA
(
scm_handle
,
deadbeef
,
servicename
,
&
servicesize
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_SERVICE_DOES_NOT_EXIST
,
"Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d
\n
"
,
GetLastError
());
todo_wine
ok
(
servicesize
==
15
,
"Service size expected 15, got %d
\n
"
,
servicesize
);
todo_wine
ok
(
servicesize
==
15
,
"Service size expected 15, got %d
\n
"
,
servicesize
);
ok
(
servicename
[
0
]
==
0
,
"Service name not empty
\n
"
);
ok
(
servicename
[
0
]
==
0
,
"Service name not empty
\n
"
);
servicesize
=
15
;
servicesize
=
15
;
servicenameW
[
0
]
=
'A'
;
lstrcpyW
(
servicenameW
,
abcW
)
;
ret
=
GetServiceKeyNameW
(
scm_handle
,
deadbeefW
,
servicenameW
,
&
servicesize
);
ret
=
GetServiceKeyNameW
(
scm_handle
,
deadbeefW
,
servicenameW
,
&
servicesize
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_SERVICE_DOES_NOT_EXIST
,
"Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d
\n
"
,
GetLastError
());
todo_wine
ok
(
servicesize
==
15
,
"Service size expected 15, got %d
\n
"
,
servicesize
);
todo_wine
ok
(
servicesize
==
15
,
"Service size expected 15, got %d
\n
"
,
servicesize
);
ok
(
servicenameW
[
0
]
==
0
,
"Service name not empty
\n
"
);
ok
(
servicenameW
[
0
]
==
0
,
"Service name not empty
\n
"
);
...
@@ -681,16 +686,56 @@ static void test_get_servicekeyname(void)
...
@@ -681,16 +686,56 @@ static void test_get_servicekeyname(void)
strcpy
(
servicename
,
"ABC"
);
strcpy
(
servicename
,
"ABC"
);
ret
=
GetServiceKeyNameA
(
scm_handle
,
deadbeef
,
servicename
,
&
servicesize
);
ret
=
GetServiceKeyNameA
(
scm_handle
,
deadbeef
,
servicename
,
&
servicesize
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_SERVICE_DOES_NOT_EXIST
,
"Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d
\n
"
,
GetLastError
());
todo_wine
ok
(
servicesize
==
1
,
"Service size expected 1, got %d
\n
"
,
servicesize
);
todo_wine
ok
(
servicesize
==
1
,
"Service size expected 1, got %d
\n
"
,
servicesize
);
ok
(
servicename
[
0
]
==
'A'
,
"Service name changed
\n
"
);
ok
(
servicename
[
0
]
==
'A'
,
"Service name changed
\n
"
);
servicesize
=
0
;
servicesize
=
0
;
servicenameW
[
0
]
=
'A'
;
lstrcpyW
(
servicenameW
,
abcW
)
;
ret
=
GetServiceKeyNameW
(
scm_handle
,
deadbeefW
,
servicenameW
,
&
servicesize
);
ret
=
GetServiceKeyNameW
(
scm_handle
,
deadbeefW
,
servicenameW
,
&
servicesize
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
!
ret
,
"Expected failure
\n
"
);
todo_wine
ok
(
servicesize
==
2
,
"Service size expected 2, got %d
\n
"
,
servicesize
);
todo_wine
ok
(
servicesize
==
2
,
"Service size expected 2, got %d
\n
"
,
servicesize
);
ok
(
GetLastError
()
==
ERROR_SERVICE_DOES_NOT_EXIST
,
"Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d
\n
"
,
GetLastError
());
ok
(
servicenameW
[
0
]
==
'A'
,
"Service name changed
\n
"
);
ok
(
servicenameW
[
0
]
==
'A'
,
"Service name changed
\n
"
);
servicesize
=
1
;
strcpy
(
servicename
,
"ABC"
);
ret
=
GetServiceKeyNameA
(
scm_handle
,
deadbeef
,
servicename
,
&
servicesize
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_SERVICE_DOES_NOT_EXIST
,
"Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d
\n
"
,
GetLastError
());
todo_wine
ok
(
servicesize
==
1
,
"Service size expected 1, got %d
\n
"
,
servicesize
);
ok
(
servicename
[
0
]
==
0
,
"Service name not empty
\n
"
);
servicesize
=
1
;
lstrcpyW
(
servicenameW
,
abcW
);
ret
=
GetServiceKeyNameW
(
scm_handle
,
deadbeefW
,
servicenameW
,
&
servicesize
);
ok
(
!
ret
,
"Expected failure
\n
"
);
todo_wine
ok
(
servicesize
==
2
,
"Service size expected 2, got %d
\n
"
,
servicesize
);
ok
(
GetLastError
()
==
ERROR_SERVICE_DOES_NOT_EXIST
,
"Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d
\n
"
,
GetLastError
());
todo_wine
ok
(
servicenameW
[
0
]
==
'A'
,
"Service name changed
\n
"
);
servicesize
=
2
;
strcpy
(
servicename
,
"ABC"
);
ret
=
GetServiceKeyNameA
(
scm_handle
,
deadbeef
,
servicename
,
&
servicesize
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_SERVICE_DOES_NOT_EXIST
,
"Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d
\n
"
,
GetLastError
());
ok
(
servicesize
==
2
,
"Service size expected 2, got %d
\n
"
,
servicesize
);
ok
(
servicename
[
0
]
==
0
,
"Service name not empty
\n
"
);
servicesize
=
2
;
lstrcpyW
(
servicenameW
,
abcW
);
ret
=
GetServiceKeyNameW
(
scm_handle
,
deadbeefW
,
servicenameW
,
&
servicesize
);
ok
(
!
ret
,
"Expected failure
\n
"
);
todo_wine
ok
(
servicesize
==
2
,
"Service size expected 2, got %d
\n
"
,
servicesize
);
ok
(
GetLastError
()
==
ERROR_SERVICE_DOES_NOT_EXIST
,
"Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d
\n
"
,
GetLastError
());
ok
(
servicenameW
[
0
]
==
0
,
"Service name not empty
\n
"
);
/* Check if 'Spooler' exists */
/* Check if 'Spooler' exists */
svc_handle
=
OpenServiceA
(
scm_handle
,
spooler
,
GENERIC_READ
);
svc_handle
=
OpenServiceA
(
scm_handle
,
spooler
,
GENERIC_READ
);
if
(
!
svc_handle
)
if
(
!
svc_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