1 /* $Id: scm.c,v 1.6 2001/06/17 20:36:35 ea Exp $
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS system libraries
5 * FILE: lib/advapi32/service/scm.c
6 * PURPOSE: Service control manager functions
7 * PROGRAMMER: Emanuele Aliberti
13 /* INCLUDES ******************************************************************/
16 #include <ddk/ntddk.h>
18 /* FUNCTIONS *****************************************************************/
20 /**********************************************************************
21 * ChangeServiceConfigA
30 LPCSTR lpBinaryPathName
,
31 LPCSTR lpLoadOrderGroup
,
33 LPCSTR lpDependencies
,
34 LPCSTR lpServiceStartName
,
39 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
44 /**********************************************************************
45 * ChangeServiceConfigW
54 LPCWSTR lpBinaryPathName
,
55 LPCWSTR lpLoadOrderGroup
,
57 LPCWSTR lpDependencies
,
58 LPCWSTR lpServiceStartName
,
63 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
68 /**********************************************************************
73 CloseServiceHandle( SC_HANDLE hSCObject
)
75 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
80 /**********************************************************************
88 LPSERVICE_STATUS lpServiceStatus
91 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
96 /**********************************************************************
102 SC_HANDLE hSCManager
,
103 LPCTSTR lpServiceName
,
104 LPCTSTR lpDisplayName
,
105 DWORD dwDesiredAccess
,
108 DWORD dwErrorControl
,
109 LPCTSTR lpBinaryPathName
,
110 LPCTSTR lpLoadOrderGroup
,
112 LPCTSTR lpDependencies
,
113 LPCTSTR lpServiceStartName
,
117 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
122 /**********************************************************************
128 SC_HANDLE hSCManager
,
129 LPCWSTR lpServiceName
,
130 LPCWSTR lpDisplayName
,
131 DWORD dwDesiredAccess
,
134 DWORD dwErrorControl
,
135 LPCWSTR lpBinaryPathName
,
136 LPCWSTR lpLoadOrderGroup
,
138 LPCWSTR lpDependencies
,
139 LPCWSTR lpServiceStartName
,
143 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
148 /**********************************************************************
153 DeleteService( SC_HANDLE hService
)
155 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
160 /**********************************************************************
161 * EnumDependentServicesA
165 EnumDependentServicesA(
167 DWORD dwServiceState
,
168 LPENUM_SERVICE_STATUSA lpServices
,
170 LPDWORD pcbBytesNeeded
,
171 LPDWORD lpServicesReturned
174 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
179 /**********************************************************************
180 * EnumDependentServicesW
184 EnumDependentServicesW(
186 DWORD dwServiceState
,
187 LPENUM_SERVICE_STATUSW lpServices
,
189 LPDWORD pcbBytesNeeded
,
190 LPDWORD lpServicesReturned
193 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
198 /**********************************************************************
217 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
222 /**********************************************************************
223 * EnumServicesStatusA
227 EnumServicesStatusA (
228 SC_HANDLE hSCManager
,
230 DWORD dwServiceState
,
231 LPENUM_SERVICE_STATUSA lpServices
,
233 LPDWORD pcbBytesNeeded
,
234 LPDWORD lpServicesReturned
,
235 LPDWORD lpResumeHandle
238 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
243 /**********************************************************************
244 * EnumServicesStatusExA
248 EnumServicesStatusExA(VOID
)
250 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
255 /**********************************************************************
256 * EnumServicesStatusExW
260 EnumServicesStatusExW(VOID
)
262 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
267 /**********************************************************************
268 * EnumServicesStatusW
273 SC_HANDLE hSCManager
,
275 DWORD dwServiceState
,
276 LPENUM_SERVICE_STATUSW lpServices
,
278 LPDWORD pcbBytesNeeded
,
279 LPDWORD lpServicesReturned
,
280 LPDWORD lpResumeHandle
283 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
288 /**********************************************************************
289 * GetServiceDisplayNameA
293 GetServiceDisplayNameA(
294 SC_HANDLE hSCManager
,
295 LPCSTR lpServiceName
,
300 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
305 /**********************************************************************
306 * GetServiceDisplayNameW
310 GetServiceDisplayNameW(
311 SC_HANDLE hSCManager
,
312 LPCWSTR lpServiceName
,
313 LPWSTR lpDisplayName
,
317 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
322 /**********************************************************************
328 SC_HANDLE hSCManager
,
329 LPCSTR lpDisplayName
,
334 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
339 /**********************************************************************
345 SC_HANDLE hSCManager
,
346 LPCWSTR lpDisplayName
,
347 LPWSTR lpServiceName
,
351 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
355 /**********************************************************************
356 * LockServiceDatabase
364 SetLastError (ERROR_CALL_NOT_IMPLEMENTED
);
369 /**********************************************************************
372 SC_HANDLE STDCALL
OpenSCManagerA(LPCSTR lpMachineName
,
373 LPCSTR lpDatabaseName
,
374 DWORD dwDesiredAccess
)
377 UNICODE_STRING MachineNameW
;
378 UNICODE_STRING DatabaseNameW
;
379 ANSI_STRING MachineNameA
;
380 ANSI_STRING DatabaseNameA
;
382 RtlInitAnsiString(&MachineNameA
, lpMachineName
);
383 RtlAnsiStringToUnicodeString(&MachineNameW
,
386 RtlInitAnsiString(&DatabaseNameA
, lpDatabaseName
);
387 RtlAnsiStringToUnicodeString(&DatabaseNameW
,
391 h
= OpenSCManagerW(MachineNameW
.Buffer
,
392 DatabaseNameW
.Buffer
,
395 RtlFreeHeap(GetProcessHeap(),
397 MachineNameW
.Buffer
);
398 RtlFreeHeap(GetProcessHeap(),
400 DatabaseNameW
.Buffer
);
406 /**********************************************************************
409 SC_HANDLE STDCALL
OpenSCManagerW(LPCWSTR lpMachineName
,
410 LPCWSTR lpDatabaseName
,
411 DWORD dwDesiredAccess
)
415 if (lpMachineName
== NULL
||
416 wcslen(lpMachineName
) == 0)
418 if (lpDatabaseName
!= NULL
&&
419 wcscmp(lpDatabaseName
, SERVICES_ACTIVE_DATABASEW
) != 0)
424 h
= CreateFile(L
"\\\\.\\pipe\\ntsrvctrl",
431 if (h
== INVALID_HANDLE_VALUE
)
445 /**********************************************************************
451 SC_HANDLE hSCManager
,
452 LPCSTR lpServiceName
,
453 DWORD dwDesiredAccess
456 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
461 /**********************************************************************
467 SC_HANDLE hSCManager
,
468 LPCWSTR lpServiceName
,
469 DWORD dwDesiredAccess
472 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
477 /**********************************************************************
478 * PrivilegedServiceAuditAlarmA
482 PrivilegedServiceAuditAlarmA(
483 LPCSTR SubsystemName
,
486 PPRIVILEGE_SET Privileges
,
490 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
495 /**********************************************************************
496 * PrivilegedServiceAuditAlarmW
500 PrivilegedServiceAuditAlarmW(
501 LPCWSTR SubsystemName
,
504 PPRIVILEGE_SET Privileges
,
508 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
513 /**********************************************************************
514 * QueryServiceConfigA
520 LPQUERY_SERVICE_CONFIGA lpServiceConfig
,
522 LPDWORD pcbBytesNeeded
525 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
530 /**********************************************************************
531 * QueryServiceConfigW
537 LPQUERY_SERVICE_CONFIGW lpServiceConfig
,
539 LPDWORD pcbBytesNeeded
542 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
547 /**********************************************************************
548 * QueryServiceLockStatusA
552 QueryServiceLockStatusA(
553 SC_HANDLE hSCManager
,
554 LPQUERY_SERVICE_LOCK_STATUSA lpLockStatus
,
556 LPDWORD pcbBytesNeeded
559 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
564 /**********************************************************************
565 * QueryServiceLockStatusW
569 QueryServiceLockStatusW(
570 SC_HANDLE hSCManager
,
571 LPQUERY_SERVICE_LOCK_STATUSW lpLockStatus
,
573 LPDWORD pcbBytesNeeded
576 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
581 /**********************************************************************
582 * QueryServiceObjectSecurity
586 QueryServiceObjectSecurity(
588 SECURITY_INFORMATION dwSecurityInformation
,
589 PSECURITY_DESCRIPTOR lpSecurityDescriptor
,
591 LPDWORD pcbBytesNeeded
594 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
599 /**********************************************************************
606 LPSERVICE_STATUS lpServiceStatus
609 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
614 /**********************************************************************
615 * QueryServiceStatusEx
619 QueryServiceStatusEx(VOID
)
621 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
626 /**********************************************************************
633 DWORD dwNumServiceArgs
,
634 LPCSTR
*lpServiceArgVectors
637 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
644 /**********************************************************************
651 DWORD dwNumServiceArgs
,
652 LPCWSTR
*lpServiceArgVectors
655 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
660 /**********************************************************************
661 * UnlockServiceDatabase
665 UnlockServiceDatabase(
669 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);