Author: ekohl
Date: Sun Sep 15 14:20:58 2013
New Revision: 60134
URL:
http://svn.reactos.org/svn/reactos?rev=60134&view=rev
Log:
[USRMGR]
Use NetLocalGroupGetMembers level 2 instead of level 1 in order to display the domain
names of well-known groups in the group membership list. Skip the domain name for other
account types.
Modified:
trunk/reactos/dll/cpl/usrmgr/groupprops.c
Modified: trunk/reactos/dll/cpl/usrmgr/groupprops.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/groupprops.…
==============================================================================
--- trunk/reactos/dll/cpl/usrmgr/groupprops.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/usrmgr/groupprops.c [iso-8859-1] Sun Sep 15 14:20:58 2013
@@ -389,7 +389,7 @@
PGENERAL_GROUP_DATA pGroupData)
{
PLOCALGROUP_INFO_1 groupInfo = NULL;
- PLOCALGROUP_MEMBERS_INFO_1 membersInfo = NULL;
+ PLOCALGROUP_MEMBERS_INFO_2 membersInfo = NULL;
DWORD dwRead;
DWORD dwTotal;
DWORD_PTR resumeHandle = 0;
@@ -435,7 +435,7 @@
NetApiBufferFree(groupInfo);
/* Set group members */
- NetLocalGroupGetMembers(NULL, pGroupData->szGroupName, 1,
(LPBYTE*)&membersInfo,
+ NetLocalGroupGetMembers(NULL, pGroupData->szGroupName, 2,
(LPBYTE*)&membersInfo,
MAX_PREFERRED_LENGTH, &dwRead, &dwTotal,
&resumeHandle);
@@ -443,31 +443,44 @@
{
ZeroMemory(&lvi, sizeof(lvi));
lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
- lvi.pszText = membersInfo[i].lgrmi1_name;
lvi.state = 0;
- if (membersInfo[i].lgrmi1_sidusage == SidTypeGroup ||
- membersInfo[i].lgrmi1_sidusage == SidTypeWellKnownGroup)
+ if (membersInfo[i].lgrmi2_sidusage == SidTypeGroup ||
+ membersInfo[i].lgrmi2_sidusage == SidTypeWellKnownGroup)
{
lvi.iImage = 0;
}
- else if (membersInfo[i].lgrmi1_sidusage == SidTypeUser)
+ else if (membersInfo[i].lgrmi2_sidusage == SidTypeUser)
{
/* FIXME: handle locked user properly! */
lvi.iImage = 1;
}
- if (membersInfo[i].lgrmi1_sidusage == SidTypeWellKnownGroup)
+ if (membersInfo[i].lgrmi2_sidusage == SidTypeWellKnownGroup)
{
TCHAR szSid[256];
- GetTextSid(membersInfo[i].lgrmi1_sid, szSid);
+ GetTextSid(membersInfo[i].lgrmi2_sid, szSid);
wsprintf(szGroupName,
TEXT("%s (%s)"),
- membersInfo[i].lgrmi1_name,
+ membersInfo[i].lgrmi2_domainandname,
szSid);
lvi.pszText = szGroupName;
+ }
+ else
+ {
+ LPWSTR ptr;
+
+ ptr = wcschr(membersInfo[i].lgrmi2_domainandname, L'\\');
+ if (ptr != NULL)
+ {
+ lvi.pszText = ++ptr;
+ }
+ else
+ {
+ lvi.pszText = membersInfo[i].lgrmi2_domainandname;
+ }
}
(void)ListView_InsertItem(hwndLV, &lvi);