implemented WaitForUserPolicyForegroundProcessing() and WaitForMachinePolicyForegroundProcessing()

svn path=/trunk/; revision=20813
This commit is contained in:
Thomas Bluemel 2006-01-12 20:32:44 +00:00
parent 94d809fd05
commit eb9ce0f7b7
2 changed files with 44 additions and 0 deletions

View 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;
}

View file

@ -38,4 +38,6 @@ RefreshPolicyEx@8
RegisterGPNotification@8
UnloadUserProfile@8
UnregisterGPNotification@4
WaitForUserPolicyForegroundProcessing@0
WaitForMachinePolicyForegroundProcessing@0
;EOF