implemented WaitForUserPolicyForegroundProcessing() and WaitForMachinePolicyForegroun...
authorThomas Bluemel <thomas@reactsoft.com>
Thu, 12 Jan 2006 20:32:44 +0000 (20:32 +0000)
committerThomas Bluemel <thomas@reactsoft.com>
Thu, 12 Jan 2006 20:32:44 +0000 (20:32 +0000)
svn path=/trunk/; revision=20813

reactos/lib/userenv/gpolicy.c
reactos/lib/userenv/userenv.def

index 26cd254..6376c0c 100644 (file)
@@ -47,10 +47,12 @@ static const WCHAR szLocalGPApplied[] = L"userenv: User Group Policy has been ap
 static const WCHAR szLocalGPMutex[] = L"userenv: user policy mutex";
 static const WCHAR szLocalGPRefreshEvent[] = L"userenv: user policy refresh event";
 static const WCHAR szLocalGPForceRefreshEvent[] = L"userenv: user policy force refresh event";
+static const WCHAR szLocalGPDoneEvent[] = L"userenv: User Policy Foreground Done Event";
 static const WCHAR szMachineGPApplied[] = L"Global\\userenv: Machine Group Policy has been applied";
 static const WCHAR szMachineGPMutex[] = L"Global\\userenv: machine policy mutex";
 static const WCHAR szMachineGPRefreshEvent[] = L"Global\\userenv: machine policy refresh event";
 static const WCHAR szMachineGPForceRefreshEvent[] = L"Global\\userenv: machine policy force refresh event";
+static const WCHAR szMachineGPDoneEvent[] = L"Global\\userenv: Machine Policy Foreground Done Event";
 
 static CRITICAL_SECTION GPNotifyLock;
 static PGP_NOTIFY NotificationList = NULL;
@@ -521,3 +523,43 @@ LeaveCriticalPolicySection(IN HANDLE hSection)
 
     return Ret;
 }
+
+BOOL WINAPI
+WaitForUserPolicyForegroundProcessing(VOID)
+{
+    HANDLE hEvent;
+    BOOL Ret = FALSE;
+
+    hEvent = OpenEventW(SYNCHRONIZE,
+                        FALSE,
+                        szLocalGPDoneEvent);
+    if (hEvent != NULL)
+    {
+        Ret = WaitForSingleObject(hEvent,
+                                  INFINITE) != WAIT_FAILED;
+        CloseHandle(hEvent);
+    }
+
+    /* return TRUE even if the mutex doesn't exist! */
+    return Ret;
+}
+
+BOOL WINAPI
+WaitForMachinePolicyForegroundProcessing(VOID)
+{
+    HANDLE hEvent;
+    BOOL Ret = FALSE;
+
+    hEvent = OpenEventW(SYNCHRONIZE,
+                        FALSE,
+                        szMachineGPDoneEvent);
+    if (hEvent != NULL)
+    {
+        Ret = WaitForSingleObject(hEvent,
+                                  INFINITE) != WAIT_FAILED;
+        CloseHandle(hEvent);
+    }
+
+    /* return TRUE even if the mutex doesn't exist! */
+    return Ret;
+}
index 76c5f2f..328ec2f 100644 (file)
@@ -38,4 +38,6 @@ RefreshPolicyEx@8
 RegisterGPNotification@8
 UnloadUserProfile@8
 UnregisterGPNotification@4
+WaitForUserPolicyForegroundProcessing@0
+WaitForMachinePolicyForegroundProcessing@0
 ;EOF