#include "precomp.h"
#include <debug.h>
Go to the source code of this file.
|
VOID | InitializeGPNotifications (VOID) |
|
VOID | UninitializeGPNotifications (VOID) |
|
static VOID | NotifyGPEvents (IN BOOL bMachine) |
|
static DWORD WINAPI | GPNotificationThreadProc (IN LPVOID lpParameter) |
|
static HANDLE | CreateGPEvent (IN BOOL bMachine, IN PSECURITY_DESCRIPTOR lpSecurityDescriptor) |
|
BOOL WINAPI | RegisterGPNotification (IN HANDLE hEvent, IN BOOL bMachine) |
|
BOOL WINAPI | UnregisterGPNotification (IN HANDLE hEvent) |
|
BOOL WINAPI | RefreshPolicy (IN BOOL bMachine) |
|
BOOL WINAPI | RefreshPolicyEx (IN BOOL bMachine, IN DWORD dwOptions) |
|
HANDLE WINAPI | EnterCriticalPolicySection (IN BOOL bMachine) |
|
BOOL WINAPI | LeaveCriticalPolicySection (IN HANDLE hSection) |
|
BOOL WINAPI | WaitForUserPolicyForegroundProcessing (VOID) |
|
BOOL WINAPI | WaitForMachinePolicyForegroundProcessing (VOID) |
|
DWORD WINAPI | GetAppliedGPOListA (_In_ DWORD dwFlags, _In_ LPCSTR pMachineName, _In_ PSID pSidUser, _In_ GUID *pGuidExtension, _Out_ PGROUP_POLICY_OBJECTA *ppGPOList) |
|
DWORD WINAPI | GetAppliedGPOListW (_In_ DWORD dwFlags, _In_ LPCWSTR pMachineName, _In_ PSID pSidUser, _In_ GUID *pGuidExtension, _Out_ PGROUP_POLICY_OBJECTW *ppGPOList) |
|
◆ NDEBUG
◆ GP_NOTIFY
◆ PGP_NOTIFY
◆ GP_ACTION
Enumerator |
---|
gpaUpdate | |
gpaTerminate | |
Definition at line 39 of file gpolicy.c.
◆ CreateGPEvent()
Definition at line 262 of file gpolicy.c.
264{
267
271
276
278}
struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES
static const WCHAR szLocalGPApplied[]
static const WCHAR szMachineGPApplied[]
static PCWSTR BOOL bMachine
LPVOID lpSecurityDescriptor
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Referenced by RegisterGPNotification().
◆ EnterCriticalPolicySection()
Definition at line 482 of file gpolicy.c.
483{
487
488
490 if (lpSecurityDescriptor !=
NULL)
491 {
495
499
501
503 {
504
507 {
509 }
510
512 }
513 }
514
516}
PSECURITY_DESCRIPTOR CreateDefaultSecurityDescriptor(VOID)
static const WCHAR szMachineGPMutex[]
static const WCHAR szLocalGPMutex[]
HLOCAL NTAPI LocalFree(HLOCAL hMem)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
_In_ const BITMAPINFO _In_ UINT _In_opt_ HANDLE hSection
◆ GetAppliedGPOListA()
Definition at line 578 of file gpolicy.c.
585{
586 DPRINT1(
"GetAppliedGPOListA is UNIMPLEMENTED!\n");
588}
#define ERROR_CALL_NOT_IMPLEMENTED
◆ GetAppliedGPOListW()
Definition at line 592 of file gpolicy.c.
599{
600 DPRINT1(
"GetAppliedGPOListW is UNIMPLEMENTED!\n");
602}
◆ GPNotificationThreadProc()
Definition at line 132 of file gpolicy.c.
133{
135 DWORD WaitResult, WaitCount;
137
138
139
143 {
145
147
150 for (;;)
151 {
153
155 break;
156
157 WaitCount = 2;
159
161 {
163 WaitCount++;
164 }
165
167
169 WaitHandles,
172
174
176 {
178 {
180
182 {
183
184 break;
185 }
186 }
188 {
189
191 {
193 }
194 }
196 {
197
198
200 {
203 }
204 }
206 {
207
208
209 break;
210 }
211 else
212 {
213 DPRINT(
"Unexpected wait result watching the group policy events: 0x%x\n", WaitResult);
215 break;
216 }
217
219 break;
220 }
221 else
222 break;
223
224 }
225
226
229
234
236 {
239 }
241 {
244 }
245
247
248
250 0);
251 }
252 else
253 {
254 DPRINT1(
"Referencing the library failed!\n");
255 }
256
257 return 1;
258}
BOOL WINAPI GetModuleHandleExW(IN DWORD dwFlags, IN LPCWSTR lpwModuleName OPTIONAL, OUT HMODULE *phModule)
VOID WINAPI FreeLibraryAndExitThread(HMODULE hLibModule, DWORD dwExitCode)
static HANDLE hMachineGPAppliedEvent
static HANDLE hNotificationThread
static PGP_NOTIFY NotificationList
static VOID NotifyGPEvents(IN BOOL bMachine)
static HANDLE hLocalGPAppliedEvent
static CRITICAL_SECTION GPNotifyLock
static GP_ACTION GPNotificationAction
static HANDLE hNotificationThreadEvent
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
Referenced by RegisterGPNotification().
◆ InitializeGPNotifications()
Definition at line 65 of file gpolicy.c.
66{
68}
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Referenced by DllMain().
◆ LeaveCriticalPolicySection()
Definition at line 520 of file gpolicy.c.
521{
523
525 {
528 }
529
532
533 return Ret;
534}
#define ERROR_INVALID_PARAMETER
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
◆ NotifyGPEvents()
Definition at line 114 of file gpolicy.c.
115{
117
119 {
121 {
123 }
124
126 }
127}
BOOL WINAPI SHIM_OBJ_NAME() Notify(DWORD fdwReason, PVOID ptr)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Referenced by GPNotificationThreadProc().
◆ RefreshPolicy()
Definition at line 428 of file gpolicy.c.
429{
432
437 {
440 }
441
442
443 return Ret;
444}
static const WCHAR szMachineGPRefreshEvent[]
static const WCHAR szLocalGPRefreshEvent[]
HANDLE WINAPI DECLSPEC_HOTPATCH OpenEventW(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCWSTR lpName)
#define EVENT_MODIFY_STATE
Referenced by RefreshPolicyEx().
◆ RefreshPolicyEx()
Definition at line 448 of file gpolicy.c.
450{
452 {
455 }
456
458 {
461
466 {
469 }
470
471
472 return Ret;
473 }
474 else
475 {
477 }
478}
static const WCHAR szMachineGPForceRefreshEvent[]
BOOL WINAPI RefreshPolicy(IN BOOL bMachine)
static const WCHAR szLocalGPForceRefreshEvent[]
◆ RegisterGPNotification()
Definition at line 282 of file gpolicy.c.
284{
288
290
291
293 {
299 {
301 }
302 }
303
304
306 {
308 if (lpSecurityDescriptor ==
NULL)
309 {
311 }
312
314 lpSecurityDescriptor);
316 {
318 }
319 }
320
321
323 {
324 if (lpSecurityDescriptor ==
NULL)
325 {
327 if (lpSecurityDescriptor ==
NULL)
328 {
330 }
331 }
332
334 lpSecurityDescriptor);
336 {
338 }
339 }
340
342 {
344 0,
347 0,
349 }
350
352 {
356 {
357
361
363
364
367
369 }
370 }
371
374
375 if (lpSecurityDescriptor !=
NULL)
376 {
378 }
379
380
381
382 return Ret;
383}
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
static const WCHAR Cleanup[]
static HANDLE CreateGPEvent(IN BOOL bMachine, IN PSECURITY_DESCRIPTOR lpSecurityDescriptor)
struct _GP_NOTIFY * PGP_NOTIFY
static DWORD WINAPI GPNotificationThreadProc(IN LPVOID lpParameter)
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
◆ UninitializeGPNotifications()
VOID UninitializeGPNotifications |
( |
VOID |
| ) |
|
Definition at line 71 of file gpolicy.c.
72{
74
75
77 {
79
80
83
85
86
89
91
93 {
94
95
98 }
99 }
100
102 {
105 }
106
108
110}
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
Referenced by DllMain().
◆ UnregisterGPNotification()
Definition at line 387 of file gpolicy.c.
388{
391
393
396
398 {
400 {
401
402 *NotifyLink =
Notify->Next;
404
405
408 {
411 }
412
414 break;
415 }
416
417 NotifyLink = &
Notify->Next;
419 }
420
422
423 return Ret;
424}
◆ WaitForMachinePolicyForegroundProcessing()
Definition at line 558 of file gpolicy.c.
559{
562
567 {
571 }
572
573 return Ret;
574}
static const WCHAR szMachineGPDoneEvent[]
◆ WaitForUserPolicyForegroundProcessing()
Definition at line 538 of file gpolicy.c.
539{
542
547 {
551 }
552
553 return Ret;
554}
static const WCHAR szLocalGPDoneEvent[]
◆ GPNotificationAction
◆ GPNotifyLock
◆ hLocalGPAppliedEvent
◆ hMachineGPAppliedEvent
◆ hNotificationThread
◆ hNotificationThreadEvent
◆ NotificationList
◆ szLocalGPApplied
◆ szLocalGPDoneEvent
const WCHAR szLocalGPDoneEvent[] = L"userenv: User Policy Foreground Done Event" |
|
static |
◆ szLocalGPForceRefreshEvent
◆ szLocalGPMutex
◆ szLocalGPRefreshEvent
◆ szMachineGPApplied
◆ szMachineGPDoneEvent
const WCHAR szMachineGPDoneEvent[] = L"Global\\userenv: Machine Policy Foreground Done Event" |
|
static |
◆ szMachineGPForceRefreshEvent
◆ szMachineGPMutex
◆ szMachineGPRefreshEvent