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
c7951509
Commit
c7951509
authored
Jan 21, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Fix GetServiceKeyNameW behavior to pass the tests.
parent
a882bb6a
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 @
c7951509
...
...
@@ -1565,6 +1565,7 @@ BOOL WINAPI GetServiceKeyNameW( SC_HANDLE hSCManager, LPCWSTR lpDisplayName,
LPWSTR
lpServiceName
,
LPDWORD
lpcchBuffer
)
{
DWORD
err
;
WCHAR
buffer
[
2
];
TRACE
(
"%p %s %p %p
\n
"
,
hSCManager
,
debugstr_w
(
lpServiceName
),
lpDisplayName
,
lpcchBuffer
);
...
...
@@ -1575,10 +1576,20 @@ BOOL WINAPI GetServiceKeyNameW( SC_HANDLE hSCManager, LPCWSTR lpDisplayName,
return
0
;
}
/* provide a buffer if the caller didn't */
if
(
!
lpServiceName
||
*
lpcchBuffer
<
2
)
{
lpServiceName
=
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_GetServiceKeyNameW
(
hSCManager
,
lpDisplayName
,
lpServiceName
,
lpServiceName
?
*
lpcchBuffer
:
0
,
lpcchBuffer
);
*
lpcchBuffer
,
lpcchBuffer
);
}
__EXCEPT
(
rpc_filter
)
{
...
...
dlls/advapi32/tests/service.c
View file @
c7951509
...
...
@@ -760,7 +760,7 @@ static void test_get_servicekeyname(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
(
servicesize
==
15
,
"Service size expected 15, got %d
\n
"
,
servicesize
);
ok
(
servicesize
==
15
,
"Service size expected 15, got %d
\n
"
,
servicesize
);
ok
(
servicenameW
[
0
]
==
0
,
"Service name not empty
\n
"
);
servicesize
=
0
;
...
...
@@ -776,7 +776,7 @@ static void test_get_servicekeyname(void)
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
(
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
"
);
...
...
@@ -794,10 +794,10 @@ static void test_get_servicekeyname(void)
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
(
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
"
);
ok
(
servicenameW
[
0
]
==
'A'
,
"Service name changed
\n
"
);
servicesize
=
2
;
strcpy
(
servicename
,
"ABC"
);
...
...
@@ -805,14 +805,14 @@ static void test_get_servicekeyname(void)
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
);
todo_wine
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
(
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
"
);
...
...
include/wine/svcctl.idl
View file @
c7951509
...
...
@@ -240,7 +240,7 @@ typedef [switch_type(DWORD)] union
[
in
]
LPCWSTR
lpServiceDisplayName
,
[
out
,
size_is
(
cchBufSize
)
]
WCHAR
lpBuffer
[]
,
[
in
]
DWORD
cchBufSize
,
[
out
]
DWORD
*
cchLength
)
;
[
in
,
out
]
DWORD
*
cchLength
)
;
/*
Not
compatible
with
Windows
function
0
x16
*/
DWORD
svcctl_SCSetServiceBitsA
(/*
FIXME
*/)
;
...
...
programs/services/rpc.c
View file @
c7951509
...
...
@@ -261,10 +261,7 @@ DWORD svcctl_GetServiceKeyNameW(
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