ReactOS 0.4.15-dev-8127-g6338913
dssetup.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: Local Security Authority (LSA) Server
4 * FILE: reactos/dll/win32/lsasrv/dssetup.c
5 * PURPOSE: Directory Service setup functions
6 *
7 * PROGRAMMERS: Eric Kohl
8 */
9
10#include "lsasrv.h"
11#include "dssetup_s.h"
12#include "resources.h"
13
14VOID
17 IN PLSAPR_POLICY_INFORMATION PolicyInformation);
18
19/* GLOBALS *****************************************************************/
20
21VOID
23{
25
26 Status = RpcServerRegisterIf(dssetup_v0_0_s_ifspec,
27 NULL,
28 NULL);
29 if (Status != RPC_S_OK)
30 {
31 WARN("RpcServerRegisterIf() failed (Status %lx)\n", Status);
32 return;
33 }
34}
35
36
37static
41{
45 LSA_HANDLE PolicyHandle;
46 ULONG Size;
48
53 &PolicyHandle);
54 if (!NT_SUCCESS(Status))
55 {
56 TRACE("LsarOpenPolicyFailed with NT status %x\n",
58 return ERROR_OUTOFMEMORY;
59 }
60
63 &PolicyInfo);
64 LsarClose(&PolicyHandle);
65 if (!NT_SUCCESS(Status))
66 {
67 TRACE("LsarQueryInformationPolicy with NT status %x\n",
69 return ERROR_OUTOFMEMORY;
70 }
71
73 PolicyInfo->PolicyAccountDomainInfo.DomainName.Length + sizeof(WCHAR);
74
76 if (Buffer == NULL)
77 {
79 PolicyInfo);
80 return ERROR_OUTOFMEMORY;
81 }
82
84 Buffer->DomainNameFlat = (LPWSTR)((LPBYTE)Buffer +
86 wcscpy(Buffer->DomainNameFlat, PolicyInfo->PolicyAccountDomainInfo.DomainName.Buffer);
87
89 PolicyInfo);
90
92
93 return ERROR_SUCCESS;
94}
95
96
97static
101{
103
105 if (Buffer == NULL)
106 return ERROR_OUTOFMEMORY;
107
108 Buffer->OperationState = 0;
109 Buffer->PreviousServerState = 0;
110
112
113 return ERROR_SUCCESS;
114}
115
116
117static
121{
123
125 if (Buffer == NULL)
126 return ERROR_OUTOFMEMORY;
127
128 Buffer->OperationState = DsRoleOperationIdle;
129
131
132 return ERROR_SUCCESS;
133}
134
135
136DWORD
137WINAPI
142{
144
145 TRACE("DsRolerGetPrimaryDomainInformation(%p, %d, %p)\n",
146 hBinding, InfoLevel, DomainInfo);
147
148 switch (InfoLevel)
149 {
151 ret = DsRolepGetBasicInfo(DomainInfo);
152 break;
153
155 ret = DsRolepGetUpdateStatus(DomainInfo);
156 break;
157
159 ret = DsRolepGetOperationState(DomainInfo);
160 break;
161
162 default:
164 }
165
166 return ret;
167}
168
169/* EOF */
LONG NTSTATUS
Definition: precomp.h:26
#define WARN(fmt,...)
Definition: debug.h:115
Definition: bufpool.h:45
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
handle_t hBinding
Definition: ctx_c.c:54
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
ULONG WINAPI LsaNtStatusToWinError(IN NTSTATUS Status)
Definition: lsa.c:1131
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
@ DsRole_RoleStandaloneWorkstation
Definition: dsrole.h:39
@ DsRolePrimaryDomainInfoBasic
Definition: dsrole.h:32
@ DsRoleUpgradeStatus
Definition: dsrole.h:33
@ DsRoleOperationState
Definition: dsrole.h:34
@ DsRoleOperationIdle
Definition: dsrole.h:56
enum _DSROLE_PRIMARY_DOMAIN_INFO_LEVEL DSROLE_PRIMARY_DOMAIN_INFO_LEVEL
struct _DSROLER_PRIMARY_DOMAIN_INFO_BASIC DSROLER_PRIMARY_DOMAIN_INFO_BASIC
union _DSROLER_PRIMARY_DOMAIN_INFORMATION * PDSROLER_PRIMARY_DOMAIN_INFORMATION
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_ FILTER_INFORMATION_CLASS InformationClass
Definition: fltkernel.h:1713
Status
Definition: gdiplustypes.h:25
NTSTATUS WINAPI LsarOpenPolicy(LPWSTR SystemName, PLSAPR_OBJECT_ATTRIBUTES ObjectAttributes, ACCESS_MASK DesiredAccess, LSAPR_HANDLE *PolicyHandle)
Definition: lsarpc.c:495
NTSTATUS WINAPI LsarClose(LSAPR_HANDLE *ObjectHandle)
Definition: lsarpc.c:125
NTSTATUS WINAPI LsarQueryInformationPolicy(LSAPR_HANDLE PolicyHandle, POLICY_INFORMATION_CLASS InformationClass, PLSAPR_POLICY_INFORMATION *PolicyInformation)
Definition: lsarpc.c:531
static NET_API_STATUS DsRolepGetOperationState(PDSROLER_PRIMARY_DOMAIN_INFORMATION *DomainInfo)
Definition: dssetup.c:119
VOID DsSetupInit(VOID)
Definition: dssetup.c:22
static NET_API_STATUS DsRolepGetBasicInfo(PDSROLER_PRIMARY_DOMAIN_INFORMATION *DomainInfo)
Definition: dssetup.c:39
VOID NTAPI LsaIFree_LSAPR_POLICY_INFORMATION(IN POLICY_INFORMATION_CLASS InformationClass, IN PLSAPR_POLICY_INFORMATION PolicyInformation)
Definition: lsasrv.c:51
DWORD WINAPI DsRolerGetPrimaryDomainInformation(handle_t hBinding, DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel, PDSROLER_PRIMARY_DOMAIN_INFORMATION *DomainInfo)
Definition: dssetup.c:138
static NET_API_STATUS DsRolepGetUpdateStatus(PDSROLER_PRIMARY_DOMAIN_INFORMATION *DomainInfo)
Definition: dssetup.c:99
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
@ PolicyAccountDomainInformation
Definition: ntsecapi.h:247
enum _POLICY_INFORMATION_CLASS POLICY_INFORMATION_CLASS
#define POLICY_VIEW_LOCAL_INFORMATION
Definition: ntsecapi.h:61
RPC_STATUS WINAPI RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv)
Definition: rpc_server.c:1116
#define RPC_S_OK
Definition: rpcnterr.h:22
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
long RPC_STATUS
Definition: rpc.h:52
#define midl_user_allocate
Definition: rpc.h:44
#define TRACE(s)
Definition: solgame.cpp:4
RPC_UNICODE_STRING DomainName
Definition: msv1_0.h:246
unsigned short Length
Definition: msv1_0.h:22
wchar_t * Buffer
Definition: msv1_0.h:24
unsigned char * LPBYTE
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
LSAPR_POLICY_ACCOUNT_DOM_INFO PolicyAccountDomainInfo
Definition: msv1_0.h:276
int ret
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
#define WINAPI
Definition: msvc.h:6
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184