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
75a84132
Commit
75a84132
authored
Nov 21, 1999
by
Michael McCormack
Committed by
Alexandre Julliard
Nov 21, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented OpenSCManagerW, CloseServiceHandle, OpenServiceW, and some
of QueryServiceStatus.
parent
7e6e92cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
8 deletions
+74
-8
service.c
dlls/advapi32/service.c
+74
-8
No files found.
dlls/advapi32/service.c
View file @
75a84132
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
#include "windef.h"
#include "windef.h"
#include "winsvc.h"
#include "winsvc.h"
#include "winerror.h"
#include "winerror.h"
#include "winreg.h"
#include "heap.h"
#include "heap.h"
#include "debugtools.h"
#include "debugtools.h"
...
@@ -143,9 +144,25 @@ SC_HANDLE WINAPI
...
@@ -143,9 +144,25 @@ SC_HANDLE WINAPI
OpenSCManagerW
(
LPCWSTR
lpMachineName
,
LPCWSTR
lpDatabaseName
,
OpenSCManagerW
(
LPCWSTR
lpMachineName
,
LPCWSTR
lpDatabaseName
,
DWORD
dwDesiredAccess
)
DWORD
dwDesiredAccess
)
{
{
FIXME
(
"(%s,%s,0x%08lx): stub
\n
"
,
debugstr_w
(
lpMachineName
),
HKEY
hKey
;
LONG
r
;
TRACE
(
"(%s,%s,0x%08lx)
\n
"
,
debugstr_w
(
lpMachineName
),
debugstr_w
(
lpDatabaseName
),
dwDesiredAccess
);
debugstr_w
(
lpDatabaseName
),
dwDesiredAccess
);
return
1
;
/*
* FIXME: what is lpDatabaseName?
* It should be set to "SERVICES_ACTIVE_DATABASE" according to
* docs, but what if it isn't?
*/
r
=
RegConnectRegistryW
(
lpMachineName
,
HKEY_LOCAL_MACHINE
,
&
hKey
);
if
(
r
!=
ERROR_SUCCESS
)
return
0
;
TRACE
(
"returning %x
\n
"
,
hKey
);
return
hKey
;
}
}
...
@@ -196,7 +213,10 @@ ControlService( SC_HANDLE hService, DWORD dwControl,
...
@@ -196,7 +213,10 @@ ControlService( SC_HANDLE hService, DWORD dwControl,
BOOL
WINAPI
BOOL
WINAPI
CloseServiceHandle
(
SC_HANDLE
hSCObject
)
CloseServiceHandle
(
SC_HANDLE
hSCObject
)
{
{
FIXME
(
"(%d): stub
\n
"
,
hSCObject
);
TRACE
(
"(%x)
\n
"
,
hSCObject
);
RegCloseKey
(
hSCObject
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -209,7 +229,13 @@ OpenServiceA( SC_HANDLE hSCManager, LPCSTR lpServiceName,
...
@@ -209,7 +229,13 @@ OpenServiceA( SC_HANDLE hSCManager, LPCSTR lpServiceName,
DWORD
dwDesiredAccess
)
DWORD
dwDesiredAccess
)
{
{
LPWSTR
lpServiceNameW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
lpServiceName
);
LPWSTR
lpServiceNameW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
lpServiceName
);
DWORD
ret
=
OpenServiceW
(
hSCManager
,
lpServiceNameW
,
dwDesiredAccess
);
DWORD
ret
;
if
(
lpServiceName
)
TRACE
(
"Request for service %s
\n
"
,
lpServiceName
);
else
return
FALSE
;
ret
=
OpenServiceW
(
hSCManager
,
lpServiceNameW
,
dwDesiredAccess
);
HeapFree
(
GetProcessHeap
(),
0
,
lpServiceNameW
);
HeapFree
(
GetProcessHeap
(),
0
,
lpServiceNameW
);
return
ret
;
return
ret
;
}
}
...
@@ -232,9 +258,27 @@ SC_HANDLE WINAPI
...
@@ -232,9 +258,27 @@ SC_HANDLE WINAPI
OpenServiceW
(
SC_HANDLE
hSCManager
,
LPCWSTR
lpServiceName
,
OpenServiceW
(
SC_HANDLE
hSCManager
,
LPCWSTR
lpServiceName
,
DWORD
dwDesiredAccess
)
DWORD
dwDesiredAccess
)
{
{
FIXME
(
"(%d,%p,%ld): stub
\n
"
,
hSCManager
,
lpServiceName
,
const
char
*
str
=
"System
\\
CurrentControlSet
\\
Services
\\
"
;
WCHAR
lpServiceKey
[
80
];
/* FIXME: this should be dynamically allocated */
HKEY
hKey
;
long
r
;
TRACE
(
"(%d,%p,%ld)
\n
"
,
hSCManager
,
lpServiceName
,
dwDesiredAccess
);
dwDesiredAccess
);
return
1
;
lstrcpyAtoW
(
lpServiceKey
,
str
);
lstrcatW
(
lpServiceKey
,
lpServiceName
);
TRACE
(
"Opening reg key %s
\n
"
,
debugstr_w
(
lpServiceKey
));
/* FIXME: dwDesiredAccess may need some processing */
r
=
RegOpenKeyExW
(
hSCManager
,
lpServiceKey
,
0
,
dwDesiredAccess
,
&
hKey
);
if
(
r
!=
ERROR_SUCCESS
)
return
0
;
TRACE
(
"returning %x
\n
"
,
hKey
);
return
hKey
;
}
}
...
@@ -320,7 +364,29 @@ StartServiceW( SC_HANDLE hService, DWORD dwNumServiceArgs,
...
@@ -320,7 +364,29 @@ StartServiceW( SC_HANDLE hService, DWORD dwNumServiceArgs,
BOOL
WINAPI
BOOL
WINAPI
QueryServiceStatus
(
SC_HANDLE
hService
,
LPSERVICE_STATUS
lpservicestatus
)
QueryServiceStatus
(
SC_HANDLE
hService
,
LPSERVICE_STATUS
lpservicestatus
)
{
{
FIXME
(
"(%d,%p),stub!
\n
"
,
hService
,
lpservicestatus
);
LONG
r
;
return
TRUE
;
DWORD
type
,
val
,
size
;
FIXME
(
"(%x,%p) partial
\n
"
,
hService
,
lpservicestatus
);
/* read the service type from the registry */
size
=
sizeof
val
;
r
=
RegQueryValueExA
(
hService
,
"Type"
,
NULL
,
&
type
,
(
LPBYTE
)
&
val
,
&
size
);
if
(
type
!=
REG_DWORD
)
{
ERR
(
"invalid Type
\n
"
);
return
FALSE
;
}
lpservicestatus
->
dwServiceType
=
val
;
/* FIXME: how are these determined or read from the registry? */
lpservicestatus
->
dwCurrentState
=
0
/*SERVICE_STOPPED*/
;
lpservicestatus
->
dwControlsAccepted
=
0
;
lpservicestatus
->
dwWin32ExitCode
=
NO_ERROR
;
lpservicestatus
->
dwServiceSpecificExitCode
=
0
;
lpservicestatus
->
dwCheckPoint
=
0
;
lpservicestatus
->
dwWaitHint
=
0
;
return
TRUE
;
}
}
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