The NetUserGetLocalGroups function retrieves a list of local groups to which a specified user belongs.
也就是获取一组特定用户所属的本地组
NET_API_STATUS NetUserGetLocalGroups(
_In_ LPCWSTR servername, //指向DNS或者网络基本输入的指针;若为NULL,the local computer is used.
_In_ LPCWSTR username, //指针常量字符串,返回本地组成员信息,如果DomainName\UserName在domain中,那么
//用户名将会在服务器名指定的服务器上得到
_In_ DWORD level, //为0
_In_ DWORD flags, //影响标志位的操作,Currently, only the value defined is LG_INCLUDE_INDIRECT
_Out_ LPBYTE *bufptr, //存储数据的缓冲区
//This buffer is allocated by the system and must be freed using the NetApiBufferFree function
_In_ DWORD prefmaxlen, //首选的最大长度,若为MAX_PREFERRED_LENGTH,则根据所需的长度自动分配长度
_Out_ LPDWORD entriesread, //获得的元素枚举的数量
_Out_ LPDWORD totalentries //所接受的条目总数,包含枚举
);
Return value
If the function succeeds, the return value is NERR_Success.
If the function fails, the return value can be one of