Active Directory Client Side Extension in C#

C

Clay Wilcox

Can anyone assist in converting this sample from msdn into c#?

#include <windows.h>
#include <userenv.h>

DWORD CALLBACK ProcessGroupPolicy(
DWORD dwFlags,
HANDLE hToken,
HKEY hKeyRoot,
PGROUP_POLICY_OBJECT pDeletedGPOList,
PGROUP_POLICY_OBJECT pChangedGPOList,
ASYNCCOMPLETIONHANDLE pHandle,
BOOL *pbAbort,
PFNSTATUSMESSAGECALLBACK pStatusCallback
)

{
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 );

}
 
K

Kevin Yu [MSFT]

Hi Clay,

We have reviewed this issue and are currently researching on it. We will
update you ASAP. Thanks for your patience!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
K

Kevin Yu [MSFT]

Hi Clay,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to convert the c++ call of AD
Client side extension to C#. If there is any misunderstanding, please feel
free to let me know.

Based on my research, I found this function is for the extension DLL and
call back the main process from function table. I don't think can be called
from managed code, it shall be unmanaged code. So I suggest we can use COM
to wrap and COM interop to do.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
C

Clay Wilcox

Yes you are correct, I want to basically just reproduce the sample in C# and
then I can start building on it. So I can't have the c# function call back
to the main process in managed code?

Clay Wilcox
 
K

Kevin Yu [MSFT]

Hi Clay,

Yes, I think so. Please try to use interop with COM wrapper.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top