case PolicyAuditEventsInformation: /* 2 */
Status = LsarSetAuditEvents(PolicyObject,
(PLSAPR_POLICY_AUDIT_EVENTS_INFO)PolicyInformation);
+ if (NT_SUCCESS(Status))
+ LsapNotifyPolicyChange(PolicyNotifyAuditEventsInformation);
break;
case PolicyPrimaryDomainInformation: /* 3 */
Status = LsarSetPrimaryDomain(PolicyObject,
(PLSAPR_POLICY_PRIMARY_DOM_INFO)PolicyInformation);
+ if (NT_SUCCESS(Status))
+ LsapNotifyPolicyChange(PolicyNotifyDnsDomainInformation);
break;
case PolicyAccountDomainInformation: /* 5 */
Status = LsarSetAccountDomain(PolicyObject,
(PLSAPR_POLICY_ACCOUNT_DOM_INFO)PolicyInformation);
+ if (NT_SUCCESS(Status))
+ LsapNotifyPolicyChange(PolicyNotifyAccountDomainInformation);
break;
case PolicyLsaServerRoleInformation: /* 6 */
Status = LsarSetServerRole(PolicyObject,
(PPOLICY_LSA_SERVER_ROLE_INFO)PolicyInformation);
+ if (NT_SUCCESS(Status))
+ LsapNotifyPolicyChange(PolicyNotifyServerRoleInformation);
break;
case PolicyReplicaSourceInformation: /* 7 */
case PolicyDnsDomainInformation: /* 12 (0xC) */
Status = LsarSetDnsDomain(PolicyObject,
(PLSAPR_POLICY_DNS_DOMAIN_INFO)PolicyInformation);
+ if (NT_SUCCESS(Status))
+ LsapNotifyPolicyChange(PolicyNotifyDnsDomainInformation);
break;
case PolicyDnsDomainInformationInt: /* 13 (0xD) */
static
PLSA_NOTIFICATION_ENTRY
-LsapGetNotificationEntryByHandle(
- HANDLE EventHandle)
+LsapGetNotificationEntry(
+ HANDLE EventHandle,
+ POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass)
{
PLIST_ENTRY NotificationEntry;
PLSA_NOTIFICATION_ENTRY CurrentNotification;
{
CurrentNotification = CONTAINING_RECORD(NotificationEntry, LSA_NOTIFICATION_ENTRY, Entry);
- if (CurrentNotification->EventHandle == EventHandle)
+ if ((CurrentNotification->EventHandle == EventHandle) &&
+ (CurrentNotification->InformationClass == InformationClass))
return CurrentNotification;
NotificationEntry = NotificationEntry->Flink;
if (pRequestMsg->PolicyChangeNotify.Request.Register)
{
+ /* Register the notification event */
pEntry = RtlAllocateHeap(RtlGetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof(LSA_NOTIFICATION_ENTRY));
}
else
{
- pEntry = LsapGetNotificationEntryByHandle(pRequestMsg->PolicyChangeNotify.Request.NotificationEventHandle);
- if (pEntry)
+ /* Unregister the notification event */
+ pEntry = LsapGetNotificationEntry(pRequestMsg->PolicyChangeNotify.Request.NotificationEventHandle,
+ pRequestMsg->PolicyChangeNotify.Request.InformationClass);
+ if (pEntry == NULL)
{
- RemoveEntryList(&pEntry->Entry);
- RtlFreeHeap(RtlGetProcessHeap(), 0, pEntry);
+ Status = STATUS_INVALID_HANDLE;
+ goto done;
}
+
+ RemoveEntryList(&pEntry->Entry);
+ RtlFreeHeap(RtlGetProcessHeap(), 0, pEntry);
}
done:
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 */