mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 09:50:07 +00:00
[LSASRV] Implement and call the policy change notification routine
This commit is contained in:
parent
620217cec9
commit
4e32ad3623
|
@ -707,21 +707,29 @@ NTSTATUS WINAPI LsarSetInformationPolicy(
|
||||||
case PolicyAuditEventsInformation: /* 2 */
|
case PolicyAuditEventsInformation: /* 2 */
|
||||||
Status = LsarSetAuditEvents(PolicyObject,
|
Status = LsarSetAuditEvents(PolicyObject,
|
||||||
(PLSAPR_POLICY_AUDIT_EVENTS_INFO)PolicyInformation);
|
(PLSAPR_POLICY_AUDIT_EVENTS_INFO)PolicyInformation);
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
LsapNotifyPolicyChange(PolicyNotifyAuditEventsInformation);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PolicyPrimaryDomainInformation: /* 3 */
|
case PolicyPrimaryDomainInformation: /* 3 */
|
||||||
Status = LsarSetPrimaryDomain(PolicyObject,
|
Status = LsarSetPrimaryDomain(PolicyObject,
|
||||||
(PLSAPR_POLICY_PRIMARY_DOM_INFO)PolicyInformation);
|
(PLSAPR_POLICY_PRIMARY_DOM_INFO)PolicyInformation);
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
LsapNotifyPolicyChange(PolicyNotifyDnsDomainInformation);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PolicyAccountDomainInformation: /* 5 */
|
case PolicyAccountDomainInformation: /* 5 */
|
||||||
Status = LsarSetAccountDomain(PolicyObject,
|
Status = LsarSetAccountDomain(PolicyObject,
|
||||||
(PLSAPR_POLICY_ACCOUNT_DOM_INFO)PolicyInformation);
|
(PLSAPR_POLICY_ACCOUNT_DOM_INFO)PolicyInformation);
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
LsapNotifyPolicyChange(PolicyNotifyAccountDomainInformation);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PolicyLsaServerRoleInformation: /* 6 */
|
case PolicyLsaServerRoleInformation: /* 6 */
|
||||||
Status = LsarSetServerRole(PolicyObject,
|
Status = LsarSetServerRole(PolicyObject,
|
||||||
(PPOLICY_LSA_SERVER_ROLE_INFO)PolicyInformation);
|
(PPOLICY_LSA_SERVER_ROLE_INFO)PolicyInformation);
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
LsapNotifyPolicyChange(PolicyNotifyServerRoleInformation);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PolicyReplicaSourceInformation: /* 7 */
|
case PolicyReplicaSourceInformation: /* 7 */
|
||||||
|
@ -747,6 +755,8 @@ NTSTATUS WINAPI LsarSetInformationPolicy(
|
||||||
case PolicyDnsDomainInformation: /* 12 (0xC) */
|
case PolicyDnsDomainInformation: /* 12 (0xC) */
|
||||||
Status = LsarSetDnsDomain(PolicyObject,
|
Status = LsarSetDnsDomain(PolicyObject,
|
||||||
(PLSAPR_POLICY_DNS_DOMAIN_INFO)PolicyInformation);
|
(PLSAPR_POLICY_DNS_DOMAIN_INFO)PolicyInformation);
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
LsapNotifyPolicyChange(PolicyNotifyDnsDomainInformation);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PolicyDnsDomainInformationInt: /* 13 (0xD) */
|
case PolicyDnsDomainInformationInt: /* 13 (0xD) */
|
||||||
|
|
|
@ -217,6 +217,10 @@ NTSTATUS
|
||||||
LsapRegisterNotification(
|
LsapRegisterNotification(
|
||||||
PLSA_API_MSG RequestMsg);
|
PLSA_API_MSG RequestMsg);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
LsapNotifyPolicyChange(
|
||||||
|
POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass);
|
||||||
|
|
||||||
/* policy.c */
|
/* policy.c */
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
LsarQueryAuditLog(PLSA_DB_OBJECT PolicyObject,
|
LsarQueryAuditLog(PLSA_DB_OBJECT PolicyObject,
|
||||||
|
|
|
@ -32,8 +32,9 @@ LsapInitNotificationList(VOID)
|
||||||
|
|
||||||
static
|
static
|
||||||
PLSA_NOTIFICATION_ENTRY
|
PLSA_NOTIFICATION_ENTRY
|
||||||
LsapGetNotificationEntryByHandle(
|
LsapGetNotificationEntry(
|
||||||
HANDLE EventHandle)
|
HANDLE EventHandle,
|
||||||
|
POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass)
|
||||||
{
|
{
|
||||||
PLIST_ENTRY NotificationEntry;
|
PLIST_ENTRY NotificationEntry;
|
||||||
PLSA_NOTIFICATION_ENTRY CurrentNotification;
|
PLSA_NOTIFICATION_ENTRY CurrentNotification;
|
||||||
|
@ -43,7 +44,8 @@ LsapGetNotificationEntryByHandle(
|
||||||
{
|
{
|
||||||
CurrentNotification = CONTAINING_RECORD(NotificationEntry, LSA_NOTIFICATION_ENTRY, Entry);
|
CurrentNotification = CONTAINING_RECORD(NotificationEntry, LSA_NOTIFICATION_ENTRY, Entry);
|
||||||
|
|
||||||
if (CurrentNotification->EventHandle == EventHandle)
|
if ((CurrentNotification->EventHandle == EventHandle) &&
|
||||||
|
(CurrentNotification->InformationClass == InformationClass))
|
||||||
return CurrentNotification;
|
return CurrentNotification;
|
||||||
|
|
||||||
NotificationEntry = NotificationEntry->Flink;
|
NotificationEntry = NotificationEntry->Flink;
|
||||||
|
@ -67,6 +69,7 @@ LsapRegisterNotification(
|
||||||
|
|
||||||
if (pRequestMsg->PolicyChangeNotify.Request.Register)
|
if (pRequestMsg->PolicyChangeNotify.Request.Register)
|
||||||
{
|
{
|
||||||
|
/* Register the notification event */
|
||||||
pEntry = RtlAllocateHeap(RtlGetProcessHeap(),
|
pEntry = RtlAllocateHeap(RtlGetProcessHeap(),
|
||||||
HEAP_ZERO_MEMORY,
|
HEAP_ZERO_MEMORY,
|
||||||
sizeof(LSA_NOTIFICATION_ENTRY));
|
sizeof(LSA_NOTIFICATION_ENTRY));
|
||||||
|
@ -84,12 +87,17 @@ LsapRegisterNotification(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pEntry = LsapGetNotificationEntryByHandle(pRequestMsg->PolicyChangeNotify.Request.NotificationEventHandle);
|
/* Unregister the notification event */
|
||||||
if (pEntry)
|
pEntry = LsapGetNotificationEntry(pRequestMsg->PolicyChangeNotify.Request.NotificationEventHandle,
|
||||||
|
pRequestMsg->PolicyChangeNotify.Request.InformationClass);
|
||||||
|
if (pEntry == NULL)
|
||||||
{
|
{
|
||||||
RemoveEntryList(&pEntry->Entry);
|
Status = STATUS_INVALID_HANDLE;
|
||||||
RtlFreeHeap(RtlGetProcessHeap(), 0, pEntry);
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RemoveEntryList(&pEntry->Entry);
|
||||||
|
RtlFreeHeap(RtlGetProcessHeap(), 0, pEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
@ -99,4 +107,35 @@ done:
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
VOID
|
||||||
|
LsapNotifyPolicyChange(
|
||||||
|
POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass)
|
||||||
|
{
|
||||||
|
PLIST_ENTRY NotificationEntry;
|
||||||
|
PLSA_NOTIFICATION_ENTRY CurrentNotification;
|
||||||
|
|
||||||
|
FIXME("LsapNotifyPolicyChange(%lu)\n", InformationClass);
|
||||||
|
|
||||||
|
/* Acquire the notification list lock shared */
|
||||||
|
RtlAcquireResourceShared(&NotificationListLock, TRUE);
|
||||||
|
|
||||||
|
NotificationEntry = NotificationListHead.Flink;
|
||||||
|
while (NotificationEntry != &NotificationListHead)
|
||||||
|
{
|
||||||
|
CurrentNotification = CONTAINING_RECORD(NotificationEntry, LSA_NOTIFICATION_ENTRY, Entry);
|
||||||
|
|
||||||
|
if (CurrentNotification->InformationClass == InformationClass)
|
||||||
|
{
|
||||||
|
FIXME("Notify event %p\n", CurrentNotification->EventHandle);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
NotificationEntry = NotificationEntry->Flink;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Release the notification list lock */
|
||||||
|
RtlReleaseResource(&NotificationListLock);
|
||||||
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Reference in a new issue