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
05a840df
Commit
05a840df
authored
Jan 21, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Fix GetServiceDisplayNameW behavior to pass the tests.
parent
c7951509
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
11 deletions
+19
-11
service.c
dlls/advapi32/service.c
+12
-1
service.c
dlls/advapi32/tests/service.c
+6
-6
svcctl.idl
include/wine/svcctl.idl
+1
-1
rpc.c
programs/services/rpc.c
+0
-3
No files found.
dlls/advapi32/service.c
View file @
05a840df
...
...
@@ -1680,6 +1680,7 @@ BOOL WINAPI GetServiceDisplayNameW( SC_HANDLE hSCManager, LPCWSTR lpServiceName,
LPWSTR
lpDisplayName
,
LPDWORD
lpcchBuffer
)
{
DWORD
err
;
WCHAR
buffer
[
2
];
TRACE
(
"%p %s %p %p
\n
"
,
hSCManager
,
debugstr_w
(
lpServiceName
),
lpDisplayName
,
lpcchBuffer
);
...
...
@@ -1690,10 +1691,20 @@ BOOL WINAPI GetServiceDisplayNameW( SC_HANDLE hSCManager, LPCWSTR lpServiceName,
return
0
;
}
/* provide a buffer if the caller didn't */
if
(
!
lpDisplayName
||
*
lpcchBuffer
<
2
)
{
lpDisplayName
=
buffer
;
/* A size of 1 would be enough, but tests show that Windows returns 2,
* probably because of a WCHAR/bytes mismatch in their code.
*/
*
lpcchBuffer
=
2
;
}
__TRY
{
err
=
svcctl_GetServiceDisplayNameW
(
hSCManager
,
lpServiceName
,
lpDisplayName
,
lpDisplayName
?
*
lpcchBuffer
:
0
,
lpcchBuffer
);
*
lpcchBuffer
,
lpcchBuffer
);
}
__EXCEPT
(
rpc_filter
)
{
...
...
dlls/advapi32/tests/service.c
View file @
05a840df
...
...
@@ -476,7 +476,7 @@ static void test_get_displayname(void)
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
(
displaysize
==
15
,
"Service size expected 15, got %d
\n
"
,
displaysize
);
ok
(
displaynameW
[
0
]
==
0
,
"Service name not empty
\n
"
);
displaysize
=
0
;
...
...
@@ -492,7 +492,7 @@ static void test_get_displayname(void)
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
(
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
"
);
...
...
@@ -510,10 +510,10 @@ static void test_get_displayname(void)
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
(
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
"
);
ok
(
displaynameW
[
0
]
==
'A'
,
"Service name changed
\n
"
);
displaysize
=
2
;
strcpy
(
displayname
,
"ABC"
);
...
...
@@ -521,14 +521,14 @@ static void test_get_displayname(void)
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
);
todo_wine
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
(
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
"
);
...
...
include/wine/svcctl.idl
View file @
05a840df
...
...
@@ -232,7 +232,7 @@ typedef [switch_type(DWORD)] union
[
in
]
LPCWSTR
lpServiceName
,
[
out
,
size_is
(
cchBufSize
)
]
WCHAR
lpBuffer
[]
,
[
in
]
DWORD
cchBufSize
,
[
out
]
DWORD
*
cchLength
)
;
[
in
,
out
]
DWORD
*
cchLength
)
;
/*
Compatible
with
Windows
function
0
x15
*/
DWORD
svcctl_GetServiceKeyNameW
(
...
...
programs/services/rpc.c
View file @
05a840df
...
...
@@ -215,10 +215,7 @@ DWORD svcctl_GetServiceDisplayNameW(
service_unlock
(
entry
);
}
else
{
*
cchLength
=
1
;
err
=
ERROR_SERVICE_DOES_NOT_EXIST
;
}
scmdatabase_unlock
(
manager
->
db
);
...
...
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