S
Stephan Kapfer
Hi,
I have built a client side extension as group policy extension based
on the sample C++ code of MSDN:
#include <windows.h>
#include <userenv.h>
DWORD ProcessGroupPolicyEx(
DWORD dwFlags,
HANDLE hToken,
HKEY hKeyRoot,
PGROUP_POLICY_OBJECT pDeletedGPOList,
PGROUP_POLICY_OBJECT pChangedGPOList,
ASYNCCOMPLETIONHANDLE pHandle,
BOOL* pbAbort,
PFNSTATUSMESSAGECALLBACK pStatusCallback,
IWbemServices* pWbemServices,
HRESULT* pRsopStatus
)
{
PGROUP_POLICY_OBJECT pCurGPO;
// Check dwFlags for settings.
// ...
// Process deleted GPOs.
for( pCurGPO = pDeletedGPOList; pCurGPO; pCurGPO = pCurGPO->pNext )
{
if( *pbAbort )
{
// Abort.
break;
}
// ...
}
// Process changed GPOs.
for( pCurGPO = pChangedGPOList; pCurGPO; pCurGPO = pCurGPO->pNext )
{
if( *pbAbort )
{
// Abort.
break;
}
// ...
}
return( ERROR_SUCCESS );
}
The dll is registered with an unique GUID in the registry under
HKLM\..\Winlogon\GPExtensions
A corresponding adm file has been built to force the use of the client
side extension using its GUID:
CLASS USER
CATEGORY Test
POLICY "Test policy"
KEYNAME "Test"
PART "Enter text ?" EDITTEXT REQUIRED
CLIENTEXT {F17E8B5B-78F2-49A6-8933-7B767EDA5B42}
VALUENAME ""
END PART
END POLICY
END CATEGORY
During user logon or launching gpupdate the winlogon process uses the
dll.
This has been verified by creating a log file within the
ProcessGroupPolicyEx function.
The dll returns to the winlogon process and then the application error
occurs:
The instruction at "0x769ed04e" referenced memory at "0x00000838". The
memory could not be "read".
It seems that something specific has to be done/cleaned up/declared in
the ProcessGroupPolicyEx function before returning to the winlogon
process.
But no information could be found in MSDN.
Best regards
Stephan
I have built a client side extension as group policy extension based
on the sample C++ code of MSDN:
#include <windows.h>
#include <userenv.h>
DWORD ProcessGroupPolicyEx(
DWORD dwFlags,
HANDLE hToken,
HKEY hKeyRoot,
PGROUP_POLICY_OBJECT pDeletedGPOList,
PGROUP_POLICY_OBJECT pChangedGPOList,
ASYNCCOMPLETIONHANDLE pHandle,
BOOL* pbAbort,
PFNSTATUSMESSAGECALLBACK pStatusCallback,
IWbemServices* pWbemServices,
HRESULT* pRsopStatus
)
{
PGROUP_POLICY_OBJECT pCurGPO;
// Check dwFlags for settings.
// ...
// Process deleted GPOs.
for( pCurGPO = pDeletedGPOList; pCurGPO; pCurGPO = pCurGPO->pNext )
{
if( *pbAbort )
{
// Abort.
break;
}
// ...
}
// Process changed GPOs.
for( pCurGPO = pChangedGPOList; pCurGPO; pCurGPO = pCurGPO->pNext )
{
if( *pbAbort )
{
// Abort.
break;
}
// ...
}
return( ERROR_SUCCESS );
}
The dll is registered with an unique GUID in the registry under
HKLM\..\Winlogon\GPExtensions
A corresponding adm file has been built to force the use of the client
side extension using its GUID:
CLASS USER
CATEGORY Test
POLICY "Test policy"
KEYNAME "Test"
PART "Enter text ?" EDITTEXT REQUIRED
CLIENTEXT {F17E8B5B-78F2-49A6-8933-7B767EDA5B42}
VALUENAME ""
END PART
END POLICY
END CATEGORY
During user logon or launching gpupdate the winlogon process uses the
dll.
This has been verified by creating a log file within the
ProcessGroupPolicyEx function.
The dll returns to the winlogon process and then the application error
occurs:
The instruction at "0x769ed04e" referenced memory at "0x00000838". The
memory could not be "read".
It seems that something specific has to be done/cleaned up/declared in
the ProcessGroupPolicyEx function before returning to the winlogon
process.
But no information could be found in MSDN.
Best regards
Stephan