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
af5f6325
Commit
af5f6325
authored
Apr 20, 2007
by
Rolf Kalbermatter
Committed by
Alexandre Julliard
Apr 20, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Implement QueryServiceStatusEx.
Based on a patch by Anastasius Focht.
parent
c42a1dc2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
2 deletions
+76
-2
service.c
dlls/advapi32/service.c
+67
-2
winsvc.h
include/winsvc.h
+9
-0
No files found.
dlls/advapi32/service.c
View file @
af5f6325
...
@@ -1635,9 +1635,74 @@ BOOL WINAPI QueryServiceStatusEx(SC_HANDLE hService, SC_STATUS_TYPE InfoLevel,
...
@@ -1635,9 +1635,74 @@ BOOL WINAPI QueryServiceStatusEx(SC_HANDLE hService, SC_STATUS_TYPE InfoLevel,
LPBYTE
lpBuffer
,
DWORD
cbBufSize
,
LPBYTE
lpBuffer
,
DWORD
cbBufSize
,
LPDWORD
pcbBytesNeeded
)
LPDWORD
pcbBytesNeeded
)
{
{
FIXME
(
"stub
\n
"
);
struct
sc_service
*
hsvc
;
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
DWORD
size
,
type
,
val
;
HANDLE
pipe
;
LONG
r
;
LPSERVICE_STATUS_PROCESS
pSvcStatusData
;
TRACE
(
"%p %d %p %d %p
\n
"
,
hService
,
InfoLevel
,
lpBuffer
,
cbBufSize
,
pcbBytesNeeded
);
if
(
InfoLevel
!=
SC_STATUS_PROCESS_INFO
)
{
SetLastError
(
ERROR_INVALID_LEVEL
);
return
FALSE
;
}
pSvcStatusData
=
(
LPSERVICE_STATUS_PROCESS
)
lpBuffer
;
if
(
pSvcStatusData
==
NULL
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
return
FALSE
;
}
if
(
cbBufSize
<
sizeof
(
SERVICE_STATUS_PROCESS
))
{
if
(
pcbBytesNeeded
!=
NULL
)
*
pcbBytesNeeded
=
sizeof
(
SERVICE_STATUS_PROCESS
);
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
FALSE
;
}
hsvc
=
sc_handle_get_handle_data
(
hService
,
SC_HTYPE_SERVICE
);
if
(
!
hsvc
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
FALSE
;
}
/* FIXME: this would be the pid from service_start_process() */
pSvcStatusData
->
dwProcessId
=
0
;
/* service is running in a process that is not a system process */
pSvcStatusData
->
dwServiceFlags
=
0
;
pipe
=
service_open_pipe
(
hsvc
->
name
);
if
(
pipe
!=
INVALID_HANDLE_VALUE
)
{
r
=
service_get_status
(
pipe
,
&
pSvcStatusData
->
status
);
CloseHandle
(
pipe
);
if
(
r
)
return
TRUE
;
}
TRACE
(
"Failed to read service status
\n
"
);
/* read the service type from the registry */
size
=
sizeof
(
val
);
r
=
RegQueryValueExA
(
hsvc
->
hkey
,
"Type"
,
NULL
,
&
type
,
(
LPBYTE
)
&
val
,
&
size
);
if
(
r
!=
ERROR_SUCCESS
||
type
!=
REG_DWORD
)
val
=
0
;
pSvcStatusData
->
status
.
dwServiceType
=
val
;
pSvcStatusData
->
status
.
dwCurrentState
=
SERVICE_STOPPED
;
/* stopped */
pSvcStatusData
->
status
.
dwControlsAccepted
=
0
;
pSvcStatusData
->
status
.
dwWin32ExitCode
=
ERROR_SERVICE_NEVER_STARTED
;
pSvcStatusData
->
status
.
dwServiceSpecificExitCode
=
0
;
pSvcStatusData
->
status
.
dwCheckPoint
=
0
;
pSvcStatusData
->
status
.
dwWaitHint
=
0
;
return
TRUE
;
}
}
/******************************************************************************
/******************************************************************************
...
...
include/winsvc.h
View file @
af5f6325
...
@@ -131,6 +131,15 @@ typedef struct _SERVICE_STATUS {
...
@@ -131,6 +131,15 @@ typedef struct _SERVICE_STATUS {
DWORD
dwWaitHint
;
DWORD
dwWaitHint
;
}
SERVICE_STATUS
,
*
LPSERVICE_STATUS
;
}
SERVICE_STATUS
,
*
LPSERVICE_STATUS
;
/* Service status process structure */
typedef
struct
_SERVICE_STATUS_PROCESS
{
SERVICE_STATUS
status
;
DWORD
dwProcessId
;
DWORD
dwServiceFlags
;
}
SERVICE_STATUS_PROCESS
,
*
LPSERVICE_STATUS_PROCESS
;
typedef
enum
_SC_STATUS_TYPE
{
typedef
enum
_SC_STATUS_TYPE
{
SC_STATUS_PROCESS_INFO
=
0
SC_STATUS_PROCESS_INFO
=
0
}
SC_STATUS_TYPE
;
}
SC_STATUS_TYPE
;
...
...
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