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
a882bb6a
Commit
a882bb6a
authored
Jan 21, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Add some more tests for GetServiceDisplayName.
parent
0b8faac9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
0 deletions
+81
-0
service.c
dlls/advapi32/tests/service.c
+81
-0
No files found.
dlls/advapi32/tests/service.c
View file @
a882bb6a
...
...
@@ -416,6 +416,8 @@ static void test_get_displayname(void)
DWORD
displaysize
,
tempsize
,
tempsizeW
;
static
const
CHAR
deadbeef
[]
=
"Deadbeef"
;
static
const
WCHAR
spoolerW
[]
=
{
'S'
,
'p'
,
'o'
,
'o'
,
'l'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
deadbeefW
[]
=
{
'D'
,
'e'
,
'a'
,
'd'
,
'b'
,
'e'
,
'e'
,
'f'
,
0
};
static
const
WCHAR
abcW
[]
=
{
'A'
,
'B'
,
'C'
,
0
};
static
const
CHAR
servicename
[]
=
"Winetest"
;
static
const
CHAR
pathname
[]
=
"we_dont_care.exe"
;
...
...
@@ -452,6 +454,85 @@ static void test_get_displayname(void)
ok
(
GetLastError
()
==
ERROR_SERVICE_DOES_NOT_EXIST
,
"Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
GetServiceDisplayNameA
(
scm_handle
,
deadbeef
,
NULL
,
&
displaysize
);
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
(
displaysize
==
1
,
"Service size expected 1, got %d
\n
"
,
displaysize
);
displaysize
=
15
;
strcpy
(
displayname
,
"ABC"
);
ret
=
GetServiceDisplayNameA
(
scm_handle
,
deadbeef
,
displayname
,
&
displaysize
);
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
(
displaysize
==
15
,
"Service size expected 15, got %d
\n
"
,
displaysize
);
ok
(
displayname
[
0
]
==
0
,
"Service name not empty
\n
"
);
displaysize
=
15
;
lstrcpyW
(
displaynameW
,
abcW
);
ret
=
GetServiceDisplayNameW
(
scm_handle
,
deadbeefW
,
displaynameW
,
&
displaysize
);
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
(
displaysize
==
15
,
"Service size expected 15, got %d
\n
"
,
displaysize
);
ok
(
displaynameW
[
0
]
==
0
,
"Service name not empty
\n
"
);
displaysize
=
0
;
strcpy
(
displayname
,
"ABC"
);
ret
=
GetServiceDisplayNameA
(
scm_handle
,
deadbeef
,
displayname
,
&
displaysize
);
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
(
displaysize
==
1
,
"Service size expected 1, got %d
\n
"
,
displaysize
);
ok
(
displayname
[
0
]
==
'A'
,
"Service name changed
\n
"
);
displaysize
=
0
;
lstrcpyW
(
displaynameW
,
abcW
);
ret
=
GetServiceDisplayNameW
(
scm_handle
,
deadbeefW
,
displaynameW
,
&
displaysize
);
ok
(
!
ret
,
"Expected failure
\n
"
);
todo_wine
ok
(
displaysize
==
2
,
"Service size expected 2, got %d
\n
"
,
displaysize
);
ok
(
GetLastError
()
==
ERROR_SERVICE_DOES_NOT_EXIST
,
"Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d
\n
"
,
GetLastError
());
ok
(
displaynameW
[
0
]
==
'A'
,
"Service name changed
\n
"
);
displaysize
=
1
;
strcpy
(
displayname
,
"ABC"
);
ret
=
GetServiceDisplayNameA
(
scm_handle
,
deadbeef
,
displayname
,
&
displaysize
);
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
(
displaysize
==
1
,
"Service size expected 1, got %d
\n
"
,
displaysize
);
ok
(
displayname
[
0
]
==
0
,
"Service name not empty
\n
"
);
displaysize
=
1
;
lstrcpyW
(
displaynameW
,
abcW
);
ret
=
GetServiceDisplayNameW
(
scm_handle
,
deadbeefW
,
displaynameW
,
&
displaysize
);
ok
(
!
ret
,
"Expected failure
\n
"
);
todo_wine
ok
(
displaysize
==
2
,
"Service size expected 2, got %d
\n
"
,
displaysize
);
ok
(
GetLastError
()
==
ERROR_SERVICE_DOES_NOT_EXIST
,
"Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d
\n
"
,
GetLastError
());
todo_wine
ok
(
displaynameW
[
0
]
==
'A'
,
"Service name changed
\n
"
);
displaysize
=
2
;
strcpy
(
displayname
,
"ABC"
);
ret
=
GetServiceDisplayNameA
(
scm_handle
,
deadbeef
,
displayname
,
&
displaysize
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_SERVICE_DOES_NOT_EXIST
,
"Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d
\n
"
,
GetLastError
());
ok
(
displaysize
==
2
,
"Service size expected 2, got %d
\n
"
,
displaysize
);
ok
(
displayname
[
0
]
==
0
,
"Service name not empty
\n
"
);
displaysize
=
2
;
lstrcpyW
(
displaynameW
,
abcW
);
ret
=
GetServiceDisplayNameW
(
scm_handle
,
deadbeefW
,
displaynameW
,
&
displaysize
);
ok
(
!
ret
,
"Expected failure
\n
"
);
todo_wine
ok
(
displaysize
==
2
,
"Service size expected 2, got %d
\n
"
,
displaysize
);
ok
(
GetLastError
()
==
ERROR_SERVICE_DOES_NOT_EXIST
,
"Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d
\n
"
,
GetLastError
());
ok
(
displaynameW
[
0
]
==
0
,
"Service name not empty
\n
"
);
/* Check if 'Spooler' exists */
svc_handle
=
OpenServiceA
(
scm_handle
,
spooler
,
GENERIC_READ
);
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