mirror of
https://github.com/reactos/wine.git
synced 2024-11-24 20:30:01 +00:00
netapi32: Improve stub for NetLocalGroupGetMembers a bit to return current user.
This commit is contained in:
parent
1e3d65dbb8
commit
f3e59a3d70
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user