ReactOS 0.4.15-dev-7953-g1f49173
dssetup.c File Reference
#include "lsasrv.h"
#include "dssetup_s.h"
#include "resources.h"
Include dependency graph for dssetup.c:

Go to the source code of this file.

Functions

VOID NTAPI LsaIFree_LSAPR_POLICY_INFORMATION (IN POLICY_INFORMATION_CLASS InformationClass, IN PLSAPR_POLICY_INFORMATION PolicyInformation)
 
VOID DsSetupInit (VOID)
 
static NET_API_STATUS DsRolepGetBasicInfo (PDSROLER_PRIMARY_DOMAIN_INFORMATION *DomainInfo)
 
static NET_API_STATUS DsRolepGetUpdateStatus (PDSROLER_PRIMARY_DOMAIN_INFORMATION *DomainInfo)
 
static NET_API_STATUS DsRolepGetOperationState (PDSROLER_PRIMARY_DOMAIN_INFORMATION *DomainInfo)
 
DWORD WINAPI DsRolerGetPrimaryDomainInformation (handle_t hBinding, DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel, PDSROLER_PRIMARY_DOMAIN_INFORMATION *DomainInfo)
 

Function Documentation

◆ DsRolepGetBasicInfo()

static NET_API_STATUS DsRolepGetBasicInfo ( PDSROLER_PRIMARY_DOMAIN_INFORMATION DomainInfo)
static

Definition at line 39 of file dssetup.c.

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}
LONG NTSTATUS
Definition: precomp.h:26
Definition: bufpool.h:45
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#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
@ DsRole_RoleStandaloneWorkstation
Definition: dsrole.h:39
struct _DSROLER_PRIMARY_DOMAIN_INFO_BASIC DSROLER_PRIMARY_DOMAIN_INFO_BASIC
union _DSROLER_PRIMARY_DOMAIN_INFORMATION * PDSROLER_PRIMARY_DOMAIN_INFORMATION
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
VOID NTAPI LsaIFree_LSAPR_POLICY_INFORMATION(IN POLICY_INFORMATION_CLASS InformationClass, IN PLSAPR_POLICY_INFORMATION PolicyInformation)
Definition: lsasrv.c:51
@ PolicyAccountDomainInformation
Definition: ntsecapi.h:247
#define POLICY_VIEW_LOCAL_INFORMATION
Definition: ntsecapi.h:61
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#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 RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG
Definition: typedefs.h:59
LSAPR_POLICY_ACCOUNT_DOM_INFO PolicyAccountDomainInfo
Definition: msv1_0.h:276
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by DsRolerGetPrimaryDomainInformation().

◆ DsRolepGetOperationState()

static NET_API_STATUS DsRolepGetOperationState ( PDSROLER_PRIMARY_DOMAIN_INFORMATION DomainInfo)
static

Definition at line 119 of file dssetup.c.

121{
123
125 if (Buffer == NULL)
126 return ERROR_OUTOFMEMORY;
127
128 Buffer->OperationState = DsRoleOperationIdle;
129
131
132 return ERROR_SUCCESS;
133}
@ DsRoleOperationIdle
Definition: dsrole.h:56

Referenced by DsRolerGetPrimaryDomainInformation().

◆ DsRolepGetUpdateStatus()

static NET_API_STATUS DsRolepGetUpdateStatus ( PDSROLER_PRIMARY_DOMAIN_INFORMATION DomainInfo)
static

Definition at line 99 of file dssetup.c.

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}

Referenced by DsRolerGetPrimaryDomainInformation().

◆ DsRolerGetPrimaryDomainInformation()

DWORD WINAPI DsRolerGetPrimaryDomainInformation ( handle_t  hBinding,
DSROLE_PRIMARY_DOMAIN_INFO_LEVEL  InfoLevel,
PDSROLER_PRIMARY_DOMAIN_INFORMATION DomainInfo 
)

Definition at line 138 of file dssetup.c.

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}
handle_t hBinding
Definition: ctx_c.c:54
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
@ DsRolePrimaryDomainInfoBasic
Definition: dsrole.h:32
@ DsRoleUpgradeStatus
Definition: dsrole.h:33
@ DsRoleOperationState
Definition: dsrole.h:34
static NET_API_STATUS DsRolepGetOperationState(PDSROLER_PRIMARY_DOMAIN_INFORMATION *DomainInfo)
Definition: dssetup.c:119
static NET_API_STATUS DsRolepGetBasicInfo(PDSROLER_PRIMARY_DOMAIN_INFORMATION *DomainInfo)
Definition: dssetup.c:39
static NET_API_STATUS DsRolepGetUpdateStatus(PDSROLER_PRIMARY_DOMAIN_INFORMATION *DomainInfo)
Definition: dssetup.c:99
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
int ret

Referenced by DsRoleGetPrimaryDomainInformation().

◆ DsSetupInit()

VOID DsSetupInit ( VOID  )

Definition at line 22 of file dssetup.c.

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}
#define WARN(fmt,...)
Definition: debug.h:112
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
long RPC_STATUS
Definition: rpc.h:52

Referenced by LsarStartRpcServer().

◆ LsaIFree_LSAPR_POLICY_INFORMATION()

VOID NTAPI LsaIFree_LSAPR_POLICY_INFORMATION ( IN POLICY_INFORMATION_CLASS  InformationClass,
IN PLSAPR_POLICY_INFORMATION  PolicyInformation 
)

Definition at line 51 of file lsasrv.c.

53{
54 if (PolicyInformation != NULL)
55 {
56 switch (InformationClass)
57 {
58 case PolicyAuditLogInformation: /* 1 */
59 break;
60
62 if (PolicyInformation->PolicyAuditEventsInfo.EventAuditingOptions != NULL)
63 midl_user_free(PolicyInformation->PolicyAuditEventsInfo.EventAuditingOptions);
64 break;
65
67 if (PolicyInformation->PolicyPrimaryDomInfo.Name.Buffer != NULL)
68 midl_user_free(PolicyInformation->PolicyPrimaryDomInfo.Name.Buffer);
69
70 if (PolicyInformation->PolicyPrimaryDomInfo.Sid != NULL)
71 midl_user_free(PolicyInformation->PolicyPrimaryDomInfo.Sid);
72 break;
73
74 case PolicyPdAccountInformation: /* 4 */
75 if (PolicyInformation->PolicyPdAccountInfo.Name.Buffer != NULL)
76 midl_user_free(PolicyInformation->PolicyPdAccountInfo.Name.Buffer);
77 break;
78
80 if (PolicyInformation->PolicyAccountDomainInfo.DomainName.Buffer != NULL)
81 midl_user_free(PolicyInformation->PolicyAccountDomainInfo.DomainName.Buffer);
82
83 if (PolicyInformation->PolicyAccountDomainInfo.Sid != NULL)
84 midl_user_free(PolicyInformation->PolicyAccountDomainInfo.Sid);
85 break;
86
88 break;
89
91 if (PolicyInformation->PolicyReplicaSourceInfo.ReplicaSource.Buffer != NULL)
92 midl_user_free(PolicyInformation->PolicyReplicaSourceInfo.ReplicaSource.Buffer);
93
94 if (PolicyInformation->PolicyReplicaSourceInfo.ReplicaAccountName.Buffer != NULL)
95 midl_user_free(PolicyInformation->PolicyReplicaSourceInfo.ReplicaAccountName.Buffer);
96 break;
97
99 break;
100
102 break;
103
104 case PolicyAuditFullSetInformation: /* 10 (0xA) */
105 break;
106
107 case PolicyAuditFullQueryInformation: /* 11 (0xB) */
108 break;
109
110 case PolicyDnsDomainInformation: /* 12 (0xC) */
111 if (PolicyInformation->PolicyDnsDomainInfo.Name.Buffer != NULL)
112 midl_user_free(PolicyInformation->PolicyDnsDomainInfo.Name.Buffer);
113
114 if (PolicyInformation->PolicyDnsDomainInfo.DnsDomainName.Buffer != NULL)
115 midl_user_free(PolicyInformation->PolicyDnsDomainInfo.DnsDomainName.Buffer);
116
117 if (PolicyInformation->PolicyDnsDomainInfo.DnsForestName.Buffer != NULL)
118 midl_user_free(PolicyInformation->PolicyDnsDomainInfo.DnsForestName.Buffer);
119
120 if (PolicyInformation->PolicyDnsDomainInfo.Sid != NULL)
121 midl_user_free(PolicyInformation->PolicyDnsDomainInfo.Sid);
122 break;
123
124 case PolicyDnsDomainInformationInt: /* 13 (0xD) */
125 if (PolicyInformation->PolicyDnsDomainInfoInt.Name.Buffer != NULL)
126 midl_user_free(PolicyInformation->PolicyDnsDomainInfoInt.Name.Buffer);
127
128 if (PolicyInformation->PolicyDnsDomainInfoInt.DnsDomainName.Buffer != NULL)
129 midl_user_free(PolicyInformation->PolicyDnsDomainInfoInt.DnsDomainName.Buffer);
130
131 if (PolicyInformation->PolicyDnsDomainInfoInt.DnsForestName.Buffer != NULL)
132 midl_user_free(PolicyInformation->PolicyDnsDomainInfoInt.DnsForestName.Buffer);
133
134 if (PolicyInformation->PolicyDnsDomainInfoInt.Sid != NULL)
135 midl_user_free(PolicyInformation->PolicyDnsDomainInfoInt.Sid);
136 break;
137
138 case PolicyLocalAccountDomainInformation: /* 14 (0xE) */
139 if (PolicyInformation->PolicyLocalAccountDomainInfo.DomainName.Buffer != NULL)
140 midl_user_free(PolicyInformation->PolicyLocalAccountDomainInfo.DomainName.Buffer);
141
142 if (PolicyInformation->PolicyLocalAccountDomainInfo.Sid != NULL)
143 midl_user_free(PolicyInformation->PolicyLocalAccountDomainInfo.Sid);
144 break;
145
146 default:
147 ERR("Invalid InformationClass: %lu\n", InformationClass);
148 break;
149 }
150
151 midl_user_free(PolicyInformation);
152 }
153}
#define ERR(fmt,...)
Definition: debug.h:110
_In_ FILTER_INFORMATION_CLASS InformationClass
Definition: fltkernel.h:1713
@ PolicyModificationInformation
Definition: ntsecapi.h:251
@ PolicyAuditEventsInformation
Definition: ntsecapi.h:244
@ PolicyDnsDomainInformationInt
Definition: ntsecapi.h:255
@ PolicyDefaultQuotaInformation
Definition: ntsecapi.h:250
@ PolicyReplicaSourceInformation
Definition: ntsecapi.h:249
@ PolicyLsaServerRoleInformation
Definition: ntsecapi.h:248
@ PolicyAuditFullSetInformation
Definition: ntsecapi.h:252
@ PolicyDnsDomainInformation
Definition: ntsecapi.h:254
@ PolicyPrimaryDomainInformation
Definition: ntsecapi.h:245
@ PolicyAuditLogInformation
Definition: ntsecapi.h:243
@ PolicyAuditFullQueryInformation
Definition: ntsecapi.h:253
@ PolicyLocalAccountDomainInformation
Definition: ntsecapi.h:256
@ PolicyPdAccountInformation
Definition: ntsecapi.h:246
#define midl_user_free
Definition: rpc.h:45

Referenced by DsRolepGetBasicInfo(), and GetAccountDomainSid().