#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <winsvc.h>
#include <ndk/rtlfuncs.h>
#include <ntsecapi.h>
#include "wine/debug.h"
Go to the source code of this file.
◆ WIN32_NO_STATUS
◆ AddImpersonatePrivilege()
static VOID AddImpersonatePrivilege |
( |
VOID |
| ) |
|
|
static |
Definition at line 133 of file setup.c.
134{
135
137
142
146 &PolicyHandle);
148 {
149 ERR(
"LsaOpenPolicy() failed with Status 0x%08lx\n",
Status);
150 return;
151 }
152
156 {
157 ERR(
"LsaAddAccountRights(\"S-1-5-6\", \"%wZ\") failed with Status 0x%08lx\n",
Status, &RightString);
158 }
159
161}
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
NTSTATUS WINAPI LsaOpenPolicy(IN PLSA_UNICODE_STRING SystemName OPTIONAL, IN PLSA_OBJECT_ATTRIBUTES ObjectAttributes, IN ACCESS_MASK DesiredAccess, OUT PLSA_HANDLE PolicyHandle)
NTSTATUS WINAPI LsaAddAccountRights(IN LSA_HANDLE PolicyHandle, IN PSID AccountSid, IN PLSA_UNICODE_STRING UserRights, IN ULONG CountOfRights)
NTSTATUS WINAPI LsaClose(IN LSA_HANDLE ObjectHandle)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define POLICY_CREATE_ACCOUNT
#define POLICY_LOOKUP_NAMES
#define SECURITY_SERVICE_RID
#define SECURITY_NT_AUTHORITY
Referenced by DoRpcSsSetupConfiguration().
◆ DoRpcSsSetupConfiguration()
Definition at line 163 of file setup.c.
164{
165
166
167
168
169
170
171
172
173
175 {
178 }
179}
static BOOL SetupIsActive(VOID)
static BOOL RunningAsSYSTEM(VOID)
static VOID AddImpersonatePrivilege(VOID)
static VOID RpcSsConfigureAsNetworkService(VOID)
Referenced by ServiceMain().
◆ RpcSsConfigureAsNetworkService()
static VOID RpcSsConfigureAsNetworkService |
( |
VOID |
| ) |
|
|
static |
Definition at line 92 of file setup.c.
93{
95
96
99 {
101 return;
102 }
103
104
106 if (!hService)
107 ERR(
"OpenService(\"RPCSS\") failed with error 0x%lx\n",
GetLastError());
108 if (hService)
109 {
110
119 L"NT AUTHORITY\\NetworkService",
122 {
123 ERR(
"ChangeServiceConfig(\"RPCSS\") failed with error 0x%lx\n",
GetLastError());
124 }
125
127 }
128
130}
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
BOOL WINAPI ChangeServiceConfigW(SC_HANDLE hService, DWORD dwServiceType, DWORD dwStartType, DWORD dwErrorControl, LPCWSTR lpBinaryPathName, LPCWSTR lpLoadOrderGroup, LPDWORD lpdwTagId, LPCWSTR lpDependencies, LPCWSTR lpServiceStartName, LPCWSTR lpPassword, LPCWSTR lpDisplayName)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
DWORD WINAPI GetLastError(void)
#define SC_MANAGER_CONNECT
#define SERVICE_NO_CHANGE
#define SERVICE_CHANGE_CONFIG
#define SERVICES_ACTIVE_DATABASE
Referenced by DoRpcSsSetupConfiguration().
◆ RunningAsSYSTEM()
Definition at line 53 of file setup.c.
54{
55
57
61 DWORD cbTokenBuffer = 0;
62
63
66
67
70 {
71 goto Quit;
72 }
73
75 if (!pTokenUser)
76 goto Quit;
77
79 {
80
82 }
83
85
86Quit:
88 return bRet;
89}
#define ERROR_INSUFFICIENT_BUFFER
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
BOOL WINAPI EqualSid(PSID pSid1, PSID pSid2)
#define GetCurrentProcess()
#define HeapFree(x, y, z)
#define SECURITY_LOCAL_SYSTEM_RID
Referenced by DoRpcSsSetupConfiguration().
◆ SetupIsActive()
Definition at line 27 of file setup.c.
28{
34
38
42
45 {
47 }
48
50}
#define RegCloseKey(hKey)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
static HANDLE ULONG_PTR dwData
#define HKEY_LOCAL_MACHINE
Referenced by DoRpcSsSetupConfiguration(), and InitializePnPManager().
◆ WINE_DEFAULT_DEBUG_CHANNEL()
WINE_DEFAULT_DEBUG_CHANNEL |
( |
rpcss |
| ) |
|