Get Users of a Group

Zeige mir alle Mitglieder einer Gruppe an:

getUsersofaGroup.c
// Welcher Benutzer ist in der Gruppe?
#include <windows.h>
#include <lm.h>
#include <stdio.h>
 
#pragma lib <netapi32.lib>
 
//----------------------------------------  
int  GetUsersofAGroup (LPWSTR servername, LPWSTR groupname)  
{  
  GROUP_USERS_INFO_0 *buf1;  
  DWORD entries = 0;  
  DWORD total = 0;  
  DWORD reshdl = 0;
  int i,ret ;
 
  ret = NetGroupGetUsers (servername, groupname,0, (LPBYTE *) &buf1,
                          MAX_PREFERRED_LENGTH,&entries, &total, &reshdl);  
   if (!ret)
    {  
      for (i = 0; i < entries; ++i)  
    {  
      printf("%S\n",buf1[i].grui0_name);
    }  
      NetApiBufferFree (buf1);  
    }
    else
    {
    printf("error: %d\n",ret);
    }
  return ret;  
}  
//-------------------------------------------------
int main( void )
{ 
	wchar_t *server = L"\\\\myDomcontrl"; // DC 
	wchar_t *group = L"myNTGroup"; //Gruppe 
	int ret;
	ret = GetUsersofAGroup(server,group);
	return ret;
}