Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
e2172edc
Commit
e2172edc
authored
13 years ago
by
Piotr Caban
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
advapi32: Added support for SERVICE_CONFIG_PRESHUTDOWN_INFO.
parent
b8704a49
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/advapi32/service.c
+9
-1
9 additions, 1 deletion
dlls/advapi32/service.c
dlls/advapi32/tests/service.c
+28
-0
28 additions, 0 deletions
dlls/advapi32/tests/service.c
with
37 additions
and
1 deletion
dlls/advapi32/service.c
+
9
−
1
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
);
...
...
This diff is collapsed.
Click to expand it.
dlls/advapi32/tests/service.c
+
28
−
0
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment