ReactOS  0.4.14-dev-991-g696cdc6
notify.c File Reference
#include "lsasrv.h"
Include dependency graph for notify.c:

Go to the source code of this file.

Classes

struct  _LSA_NOTIFICATION_ENTRY
 

Typedefs

typedef struct _LSA_NOTIFICATION_ENTRY LSA_NOTIFICATION_ENTRY
 
typedef struct _LSA_NOTIFICATION_ENTRYPLSA_NOTIFICATION_ENTRY
 

Functions

VOID LsapInitNotificationList (VOID)
 
static PLSA_NOTIFICATION_ENTRY LsapGetNotificationEntry (HANDLE EventHandle, POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass)
 
NTSTATUS LsapRegisterNotification (PLSA_API_MSG pRequestMsg)
 
VOID LsapNotifyPolicyChange (POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass)
 

Variables

static LIST_ENTRY NotificationListHead
 
static RTL_RESOURCE NotificationListLock
 

Typedef Documentation

◆ LSA_NOTIFICATION_ENTRY

◆ PLSA_NOTIFICATION_ENTRY

Function Documentation

◆ LsapGetNotificationEntry()

static PLSA_NOTIFICATION_ENTRY LsapGetNotificationEntry ( HANDLE  EventHandle,
POLICY_NOTIFICATION_INFORMATION_CLASS  InformationClass 
)
static

Definition at line 35 of file notify.c.

38 {
40  PLSA_NOTIFICATION_ENTRY CurrentNotification;
41 
44  {
46 
47  if ((CurrentNotification->EventHandle == EventHandle) &&
48  (CurrentNotification->InformationClass == InformationClass))
49  return CurrentNotification;
50 
52  }
53 
54  return NULL;
55 }
POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass
Definition: notify.c:13
_In_ ULONG _In_opt_ PVOID _In_ PDRIVER_OBJECT _In_ PDRIVER_NOTIFICATION_CALLBACK_ROUTINE _Inout_opt_ __drv_aliasesMem PVOID _Outptr_result_nullonfailure_ _At_ * NotificationEntry(return==0, __drv_allocatesMem(Mem))) PVOID *NotificationEntry
Definition: notify.c:10
HANDLE EventHandle
Definition: notify.c:14
smooth NULL
Definition: ftsmooth.c:416
static LIST_ENTRY NotificationListHead
Definition: notify.c:19
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:120
Definition: typedefs.h:118
_In_ FILTER_INFORMATION_CLASS InformationClass
Definition: fltkernel.h:1714
base of all file and directory entries
Definition: entries.h:82
_Out_ PHANDLE EventHandle
Definition: iofuncs.h:855

Referenced by LsapRegisterNotification().

◆ LsapInitNotificationList()

VOID LsapInitNotificationList ( VOID  )

Definition at line 26 of file notify.c.

27 {
30 }
static RTL_RESOURCE NotificationListLock
Definition: notify.c:20
static LIST_ENTRY NotificationListHead
Definition: notify.c:19
NTSYSAPI VOID NTAPI RtlInitializeResource(_In_ PRTL_RESOURCE Resource)
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944

Referenced by LsapInitLsa().

◆ LsapNotifyPolicyChange()

VOID LsapNotifyPolicyChange ( POLICY_NOTIFICATION_INFORMATION_CLASS  InformationClass)

Definition at line 112 of file notify.c.

114 {
116  PLSA_NOTIFICATION_ENTRY CurrentNotification;
117 
118  FIXME("LsapNotifyPolicyChange(%lu)\n", InformationClass);
119 
120  /* Acquire the notification list lock shared */
122 
125  {
127 
128  if (CurrentNotification->InformationClass == InformationClass)
129  {
130  FIXME("Notify event %p\n", CurrentNotification->EventHandle);
131 
132  }
133 
135  }
136 
137  /* Release the notification list lock */
139 }
#define TRUE
Definition: types.h:120
NTSYSAPI BOOLEAN NTAPI RtlAcquireResourceShared(_In_ PRTL_RESOURCE Resource, _In_ BOOLEAN Wait)
POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass
Definition: notify.c:13
static RTL_RESOURCE NotificationListLock
Definition: notify.c:20
NTSYSAPI VOID NTAPI RtlReleaseResource(_In_ PRTL_RESOURCE Resource)
_In_ ULONG _In_opt_ PVOID _In_ PDRIVER_OBJECT _In_ PDRIVER_NOTIFICATION_CALLBACK_ROUTINE _Inout_opt_ __drv_aliasesMem PVOID _Outptr_result_nullonfailure_ _At_ * NotificationEntry(return==0, __drv_allocatesMem(Mem))) PVOID *NotificationEntry
Definition: notify.c:10
#define FIXME(fmt,...)
Definition: debug.h:110
HANDLE EventHandle
Definition: notify.c:14
static LIST_ENTRY NotificationListHead
Definition: notify.c:19
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:120
Definition: typedefs.h:118
_In_ FILTER_INFORMATION_CLASS InformationClass
Definition: fltkernel.h:1714
base of all file and directory entries
Definition: entries.h:82

Referenced by LsarSetInformationPolicy().

◆ LsapRegisterNotification()

NTSTATUS LsapRegisterNotification ( PLSA_API_MSG  pRequestMsg)

Definition at line 59 of file notify.c.

61 {
64 
65  FIXME("LsapRegisterNotification(%p)\n", pRequestMsg);
66 
67  /* Acquire the notification list lock exclusively */
69 
70  if (pRequestMsg->PolicyChangeNotify.Request.Register)
71  {
72  /* Register the notification event */
73  pEntry = RtlAllocateHeap(RtlGetProcessHeap(),
75  sizeof(LSA_NOTIFICATION_ENTRY));
76  if (pEntry == NULL)
77  {
79  goto done;
80  }
81 
82  pEntry->InformationClass = pRequestMsg->PolicyChangeNotify.Request.InformationClass;
83  pEntry->EventHandle = pRequestMsg->PolicyChangeNotify.Request.NotificationEventHandle;
84 
86  &pEntry->Entry);
87  }
88  else
89  {
90  /* Unregister the notification event */
91  pEntry = LsapGetNotificationEntry(pRequestMsg->PolicyChangeNotify.Request.NotificationEventHandle,
92  pRequestMsg->PolicyChangeNotify.Request.InformationClass);
93  if (pEntry == NULL)
94  {
96  goto done;
97  }
98 
99  RemoveEntryList(&pEntry->Entry);
100  RtlFreeHeap(RtlGetProcessHeap(), 0, pEntry);
101  }
102 
103 done:
104  /* Release the notification list lock */
106 
107  return Status;
108 }
#define TRUE
Definition: types.h:120
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
FORCEINLINE VOID InsertHeadList(_Inout_ PLIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PLIST_ENTRY Entry)
Definition: rtlfuncs.h:201
LSA_POLICY_CHANGE_NOTIFY_MSG PolicyChangeNotify
Definition: lsass.h:193
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass
Definition: notify.c:13
static RTL_RESOURCE NotificationListLock
Definition: notify.c:20
NTSYSAPI VOID NTAPI RtlReleaseResource(_In_ PRTL_RESOURCE Resource)
#define STATUS_INVALID_HANDLE
Definition: ntstatus.h:231
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
Definition: notify.c:10
static PLSA_NOTIFICATION_ENTRY LsapGetNotificationEntry(HANDLE EventHandle, POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass)
Definition: notify.c:35
#define FIXME(fmt,...)
Definition: debug.h:110
HANDLE EventHandle
Definition: notify.c:14
smooth NULL
Definition: ftsmooth.c:416
static LIST_ENTRY NotificationListHead
Definition: notify.c:19
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
struct _LSA_POLICY_CHANGE_NOTIFY_MSG::@3374::@3376 Request
Status
Definition: gdiplustypes.h:24
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
LIST_ENTRY Entry
Definition: notify.c:12
return STATUS_SUCCESS
Definition: btrfs.c:2938
NTSYSAPI BOOLEAN NTAPI RtlAcquireResourceExclusive(_In_ PRTL_RESOURCE Resource, _In_ BOOLEAN Wait)

Referenced by AuthPortThreadRoutine().

Variable Documentation

◆ NotificationListHead

LIST_ENTRY NotificationListHead
static

◆ NotificationListLock

RTL_RESOURCE NotificationListLock
static