[MSIEXEC] Sync with Wine Staging 2.16. CORE-13762
[reactos.git] / base / system / services / services.h
index 2eac817..1d20f12 100644 (file)
@@ -6,6 +6,7 @@
 #define _SERVICES_H
 
 #include <stdio.h>
+#include <stdlib.h>
 
 #define WIN32_NO_STATUS
 #define _INC_WINDOWS
@@ -15,6 +16,7 @@
 #include <winbase.h>
 #include <winsvc.h>
 #include <winreg.h>
+#include <winuser.h>
 #include <netevent.h>
 #define NTOS_MODE_USER
 #include <ndk/obfuncs.h>
@@ -22,6 +24,8 @@
 #include <services/services.h>
 #include <svcctl_s.h>
 
+#include "resource.h"
+
 typedef struct _SERVICE_GROUP
 {
     LIST_ENTRY GroupListEntry;
@@ -39,13 +43,15 @@ typedef struct _SERVICE_GROUP
 typedef struct _SERVICE_IMAGE
 {
     LIST_ENTRY ImageListEntry;
+    LPWSTR pszImagePath;
+    LPWSTR pszAccountName;
     DWORD dwImageRunCount;
 
     HANDLE hControlPipe;
     HANDLE hProcess;
     DWORD dwProcessId;
-
-    WCHAR szImagePath[1];
+    HANDLE hToken;
+    HANDLE hProfile;
 } SERVICE_IMAGE, *PSERVICE_IMAGE;
 
 
@@ -67,7 +73,7 @@ typedef struct _SERVICE
 
     ULONG Flags;
 
-    PSECURITY_DESCRIPTOR lpSecurityDescriptor;
+    PSECURITY_DESCRIPTOR pSecurityDescriptor;
 
     BOOLEAN ServiceVisited;
 
@@ -81,7 +87,7 @@ typedef struct _START_LOCK
 {
     DWORD Tag;             /* Must be LOCK_TAG */
     DWORD TimeWhenLocked;  /* Number of seconds since 1970 */
-    PSID LockOwnerSid;     /* It is NULL if the SCM aquired the lock */
+    PSID LockOwnerSid;     /* It is NULL if the SCM acquired the lock */
 } START_LOCK, *PSTART_LOCK;
 
 
@@ -122,6 +128,25 @@ ScmReadDependencies(HKEY hServiceKey,
                     LPWSTR *lpDependencies,
                     DWORD *lpdwDependenciesLength);
 
+DWORD
+ScmSetServicePassword(
+    IN PCWSTR pszServiceName,
+    IN PCWSTR pszPassword);
+
+DWORD
+ScmWriteSecurityDescriptor(
+    _In_ HKEY hServiceKey,
+    _In_ PSECURITY_DESCRIPTOR pSecurityDescriptor);
+
+DWORD
+ScmReadSecurityDescriptor(
+    _In_ HKEY hServiceKey,
+    _Out_ PSECURITY_DESCRIPTOR *ppSecurityDescriptor);
+
+DWORD
+ScmDeleteRegKey(
+    _In_ HKEY hKey,
+    _In_ PCWSTR pszSubKey);
 
 /* controlset.c */
 
@@ -169,12 +194,17 @@ DWORD ScmControlDriver(PSERVICE lpService,
 
 /* groupdb.c */
 
+PSERVICE_GROUP
+ScmGetServiceGroupByName(
+    _In_ LPCWSTR lpGroupName);
+
 DWORD ScmCreateGroupList(VOID);
 DWORD ScmSetServiceGroup(PSERVICE lpService,
                          LPCWSTR lpGroupName);
 
 
 /* lock.c */
+
 DWORD ScmAcquireServiceStartLock(IN BOOL IsServiceController,
                                  OUT LPSC_RPC_LOCK lpLock);
 DWORD ScmReleaseServiceStartLock(IN OUT LPSC_RPC_LOCK lpLock);
@@ -187,10 +217,21 @@ VOID ScmQueryServiceLockStatusA(OUT LPQUERY_SERVICE_LOCK_STATUSA lpLockStatus);
 VOID ScmStartRpcServer(VOID);
 
 
+/* security.c */
+
+DWORD ScmInitializeSecurity(VOID);
+VOID ScmShutdownSecurity(VOID);
+
+DWORD
+ScmCreateDefaultServiceSD(
+    PSECURITY_DESCRIPTOR *ppSecurityDescriptor);
+
+
 /* services.c */
 
 VOID PrintString(LPCSTR fmt, ...);
-VOID ScmLogError(DWORD dwEventId,
+VOID ScmLogEvent(DWORD dwEventId,
+                 WORD wType,
                  WORD wStrings,
                  LPCWSTR *lpStrings);
 VOID ScmWaitForLsa(VOID);