Reputation: 63
In my program I want to get user's local groups. My code is:
LPLOCALGROUP_USERS_INFO_0 pBuf = NULL; //STRUCTURE
DWORD dwLevel = 0;
DWORD dwFlags = LG_INCLUDE_INDIRECT ;
DWORD dwPrefMaxLen = MAX_PREFERRED_LENGTH;
DWORD dwEntriesRead = 0;
DWORD dwTotalEntries = 0;
NET_API_STATUS nStatus;
nStatus = NetUserGetLocalGroups(NULL,
L"Nastya",
dwLevel,
dwFlags,
(LPBYTE *) &pBuf,
dwPrefMaxLen,
&dwEntriesRead,
&dwTotalEntries);
DWORD i;
I want to output pBuf:
if (nStatus == NERR_Success)
{
wprintf(L"\t-- %s\n", pBuf->lgrui0_name);
}
But I get only first element "HomeUsers". How can I get all elements of this structure?
typedef struct _LOCALGROUP_USERS_INFO_0 {
LPWSTR lgrui0_name;
} LOCALGROUP_USERS_INFO_0, *PLOCALGROUP_USERS_INFO_0, *LPLOCALGROUP_USERS_INFO_0;
Upvotes: 0
Views: 60