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
e2172edc
Commit
e2172edc
authored
Nov 30, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 30, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Added support for SERVICE_CONFIG_PRESHUTDOWN_INFO.
parent
b8704a49
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
1 deletion
+37
-1
service.c
dlls/advapi32/service.c
+9
-1
service.c
dlls/advapi32/tests/service.c
+28
-0
No files found.
dlls/advapi32/service.c
View file @
e2172edc
...
...
@@ -1400,6 +1400,10 @@ BOOL WINAPI QueryServiceConfig2A(SC_HANDLE hService, DWORD dwLevel, LPBYTE buffe
else
configA
->
lpDescription
=
NULL
;
}
break
;
case
SERVICE_CONFIG_PRESHUTDOWN_INFO
:
if
(
buffer
&&
bufferW
&&
*
needed
<=
size
)
memcpy
(
buffer
,
bufferW
,
*
needed
);
break
;
default:
FIXME
(
"conversation W->A not implemented for level %d
\n
"
,
dwLevel
);
ret
=
FALSE
;
...
...
@@ -1421,7 +1425,7 @@ BOOL WINAPI QueryServiceConfig2W(SC_HANDLE hService, DWORD dwLevel, LPBYTE buffe
{
DWORD
err
;
if
(
dwLevel
!=
SERVICE_CONFIG_DESCRIPTION
)
{
if
(
dwLevel
!=
SERVICE_CONFIG_DESCRIPTION
&&
dwLevel
!=
SERVICE_CONFIG_PRESHUTDOWN_INFO
)
{
FIXME
(
"Level %d not implemented
\n
"
,
dwLevel
);
SetLastError
(
ERROR_INVALID_LEVEL
);
return
FALSE
;
...
...
@@ -2051,6 +2055,10 @@ BOOL WINAPI ChangeServiceConfig2A( SC_HANDLE hService, DWORD dwInfoLevel,
HeapFree
(
GetProcessHeap
(),
0
,
faw
.
lpRebootMsg
);
HeapFree
(
GetProcessHeap
(),
0
,
faw
.
lpCommand
);
}
else
if
(
dwInfoLevel
==
SERVICE_CONFIG_PRESHUTDOWN_INFO
)
{
r
=
ChangeServiceConfig2W
(
hService
,
dwInfoLevel
,
lpInfo
);
}
else
SetLastError
(
ERROR_INVALID_PARAMETER
);
...
...
dlls/advapi32/tests/service.c
View file @
e2172edc
...
...
@@ -1896,6 +1896,7 @@ static void test_queryconfig2(void)
DWORD
expected
,
needed
;
BYTE
buffer
[
MAX_PATH
];
LPSERVICE_DESCRIPTIONA
pConfig
=
(
LPSERVICE_DESCRIPTIONA
)
buffer
;
SERVICE_PRESHUTDOWN_INFO
preshutdown_info
;
static
const
CHAR
servicename
[]
=
"Winetest"
;
static
const
CHAR
displayname
[]
=
"Winetest dummy service"
;
static
const
CHAR
pathname
[]
=
"we_dont_care.exe"
;
...
...
@@ -2062,6 +2063,33 @@ static void test_queryconfig2(void)
ret
=
pQueryServiceConfig2W
(
svc_handle
,
SERVICE_CONFIG_DESCRIPTION
,
buffer
,
needed
,
&
needed
);
ok
(
ret
,
"expected QueryServiceConfig2W to succeed
\n
"
);
SetLastError
(
0xdeadbeef
);
ret
=
pQueryServiceConfig2W
(
svc_handle
,
SERVICE_CONFIG_PRESHUTDOWN_INFO
,
(
LPBYTE
)
&
preshutdown_info
,
sizeof
(
preshutdown_info
),
&
needed
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_LEVEL
)
{
/* Win2k3 and older */
win_skip
(
"SERVICE_CONFIG_PRESHUTDOWN_INFO not supported
\n
"
);
goto
cleanup
;
}
ok
(
ret
,
"expected QueryServiceConfig2W to succeed (%d)
\n
"
,
GetLastError
());
ok
(
needed
==
sizeof
(
preshutdown_info
),
"needed = %d
\n
"
,
needed
);
ok
(
preshutdown_info
.
dwPreshutdownTimeout
==
180000
,
"Default PreshutdownTimeout = %d
\n
"
,
preshutdown_info
.
dwPreshutdownTimeout
);
SetLastError
(
0xdeadbeef
);
preshutdown_info
.
dwPreshutdownTimeout
=
-
1
;
ret
=
pChangeServiceConfig2A
(
svc_handle
,
SERVICE_CONFIG_PRESHUTDOWN_INFO
,
(
LPVOID
)
&
preshutdown_info
);
ok
(
ret
,
"expected ChangeServiceConfig2A to succeed (%d)
\n
"
,
GetLastError
());
ret
=
pQueryServiceConfig2W
(
svc_handle
,
SERVICE_CONFIG_PRESHUTDOWN_INFO
,
(
LPBYTE
)
&
preshutdown_info
,
sizeof
(
preshutdown_info
),
&
needed
);
ok
(
ret
,
"expected QueryServiceConfig2W to succeed (%d)
\n
"
,
GetLastError
());
ok
(
needed
==
sizeof
(
preshutdown_info
),
"needed = %d
\n
"
,
needed
);
ok
(
preshutdown_info
.
dwPreshutdownTimeout
==
-
1
,
"New PreshutdownTimeout = %d
\n
"
,
preshutdown_info
.
dwPreshutdownTimeout
);
cleanup:
DeleteService
(
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