Commit f3e59a3d authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

netapi32: Improve stub for NetLocalGroupGetMembers a bit to return current user.

parent 1e3d65db
......@@ -166,6 +166,39 @@ NET_API_STATUS WINAPI NetLocalGroupGetMembers(
FIXME("(%s %s %d %p %d, %p %p %p) stub!\n", debugstr_w(servername),
debugstr_w(localgroupname), level, bufptr, prefmaxlen, entriesread,
totalentries, resumehandle);
if (level == 3)
{
WCHAR userName[MAX_COMPUTERNAME_LENGTH + 1];
DWORD userNameLen;
DWORD len,needlen;
PLOCALGROUP_MEMBERS_INFO_3 ptr;
/* still a stub, current user is belonging to all groups */
*totalentries = 1;
*entriesread = 0;
userNameLen = MAX_COMPUTERNAME_LENGTH + 1;
GetUserNameW(userName,&userNameLen);
needlen = sizeof(LOCALGROUP_MEMBERS_INFO_3) +
(userNameLen+2) * sizeof(WCHAR);
if (prefmaxlen != MAX_PREFERRED_LENGTH)
len = min(prefmaxlen,needlen);
else
len = needlen;
NetApiBufferAllocate(len, (LPVOID *) bufptr);
if (len < needlen)
return ERROR_MORE_DATA;
ptr = (PLOCALGROUP_MEMBERS_INFO_3)*bufptr;
ptr->lgrmi3_domainandname = (LPWSTR)(*bufptr+sizeof(LOCALGROUP_MEMBERS_INFO_3));
lstrcpyW(ptr->lgrmi3_domainandname,userName);
*entriesread = 1;
}
return NERR_Success;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment