Using IADs to query the rootDSE - token handle leak


i have multi-threaded application performs thread-level impersonation of access tokens each thread has capability of accessing ad unique identity, if necessary.  application running, various threads need find out information ad environment, such checking see if particular schema extension exists before attempting perform operations in ad.

to perform test, instance of iads com interface obtained via call adsgetobject() binds com interface instance "rootdse", , iads::getinfoex() method called load value "schemanamingcontext" attribute property cache.  once property value has been obtained call iads::getex() method, schema partition searched specific class , attribute definition class objects.

the problem encountering each time iads::getinfoex() called when iads com interface instance bound "rootdse", there leak of 1 handle access token.  using windbg's handle tracing feature, can seen call iads::getinfoex() making additional function calls open thread token , duplicate thread token.  however, handle duplicated token never being closed, , process' handle count increases 1.

further testing no thread level impersonation being performed has result no token handles leaked.  if per-thread tokens re-enabled in application, leak occurs again, leaking 1 handle per attempt schema naming context value rootdse.

this testing has been performed on 64-bit builds of both windows server 2008 r2 , windows server 2012, , domains & forests were, respectively, @ windows server 2008 r2 , windows server 2012 functional levels.

i have performed extensive searches google , of microsoft's technet, msdn , tech support web sites, have not been able locate information particular problem.  appreciate links articles or other sources can explain why problem occurring , can done resolve it.

hello,

it seems more of development issue. kindly recommend post in msdn forums better assistance.

thanks understanding.

regards,
cicely



Windows Server  >  Directory Services



Comments

Popular posts from this blog

some help on Event 540

WMI Repository 4GB limit - Win 2003 Ent Question

Event ID 1302 (error 1307) DFS replication service encountered an error while writing to the debug log file