2011-08-23 51 views
0

我正在使用:: NetQueryDisplayInformation()API检索本地计算机组信息。我正在运行升级的程序。 问题是它只返回“无”组名(仅限一组)。我已成功使用相同的API从本地计算机和Active Directory中检索用户帐户。NetQueryDisplayInformation检索组信息的问题

我用这个组:

unsigned long index = 0, count = 0; 
void *buffer = nullptr; 
unsigned long result = 0; 
result = ::NetQueryDisplayInformation ( 
           /* serverName */NULL, 
           /*Level*/ 3, 
           /*Index*/index, 
           /*Entries requested*/100, 
           /*PreferredMaximumLength */MAX_PREFERRED_LENGTH, 
           /*ReturnedEntryCount*/&count, 
           /*SortedBuffer*/&buffer); 

计数返回为1

回答

0

我能够使用NetQueryDisplayInformation因为尽管检索AD用户组信息...(通过设置服务器/名称以不同于NULL)

+0

因此,当检索本地机器组信息时,这个似乎不像预期的那样工作。 – Ghita