Author: ekohl
Date: Sat Jun 8 11:04:18 2013
New Revision: 59190
URL:
http://svn.reactos.org/svn/reactos?rev=59190&view=rev
Log:
[NETAPI32]
NetLocalGroupGetMembers: Implement levels 2 and 3. Fixes netapi32:access winetest
failures.
Modified:
trunk/reactos/dll/win32/netapi32/local_group.c
Modified: trunk/reactos/dll/win32/netapi32/local_group.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/local_g…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/local_group.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/local_group.c [iso-8859-1] Sat Jun 8 11:04:18 2013
@@ -946,6 +946,8 @@
LPVOID Buffer = NULL;
PLOCALGROUP_MEMBERS_INFO_0 MembersInfo0;
PLOCALGROUP_MEMBERS_INFO_1 MembersInfo1;
+ PLOCALGROUP_MEMBERS_INFO_2 MembersInfo2;
+ PLOCALGROUP_MEMBERS_INFO_3 MembersInfo3;
LPWSTR Ptr;
ULONG Size = 0;
ULONG SidLength;
@@ -1060,7 +1062,7 @@
goto done;
}
-
+ /* Get name and domain information for all members */
if (level != 0)
{
InitializeObjectAttributes(&ObjectAttributes,
@@ -1108,6 +1110,19 @@
EnumContext->Names[i].Name.Length + sizeof(WCHAR);
break;
+ case 2:
+ Size = sizeof(LOCALGROUP_MEMBERS_INFO_2) +
+ RtlLengthSid(EnumContext->Sids[i]) +
+ EnumContext->Names[i].Name.Length + sizeof(WCHAR) +
+
EnumContext->Domains->Domains[EnumContext->Names[i].DomainIndex].Name.Length +
sizeof(WCHAR);
+ break;
+
+ case 3:
+ Size = sizeof(LOCALGROUP_MEMBERS_INFO_3) +
+ EnumContext->Names[i].Name.Length + sizeof(WCHAR) +
+
EnumContext->Domains->Domains[EnumContext->Names[i].DomainIndex].Name.Length +
sizeof(WCHAR);
+ break;
+
default:
ApiStatus = ERROR_INVALID_LEVEL;
goto done;
@@ -1132,6 +1147,16 @@
case 1:
MembersInfo1 = (PLOCALGROUP_MEMBERS_INFO_1)Buffer;
Ptr = (PVOID)((ULONG_PTR)Buffer + sizeof(LOCALGROUP_MEMBERS_INFO_1) *
EnumContext->Count);
+ break;
+
+ case 2:
+ MembersInfo2 = (PLOCALGROUP_MEMBERS_INFO_2)Buffer;
+ Ptr = (PVOID)((ULONG_PTR)Buffer + sizeof(LOCALGROUP_MEMBERS_INFO_2) *
EnumContext->Count);
+ break;
+
+ case 3:
+ MembersInfo3 = (PLOCALGROUP_MEMBERS_INFO_3)Buffer;
+ Ptr = (PVOID)((ULONG_PTR)Buffer + sizeof(LOCALGROUP_MEMBERS_INFO_3) *
EnumContext->Count);
break;
}
@@ -1166,6 +1191,51 @@
MembersInfo1->lgrmi1_name = (LPWSTR)Ptr;
memcpy(MembersInfo1->lgrmi1_name,
+ EnumContext->Names[i].Name.Buffer,
+ EnumContext->Names[i].Name.Length);
+ break;
+
+ case 2:
+ MembersInfo2->lgrmi2_sid = (PSID)Ptr;
+
+ SidLength = RtlLengthSid(EnumContext->Sids[i]);
+ memcpy(MembersInfo2->lgrmi2_sid,
+ EnumContext->Sids[i],
+ SidLength);
+
+ Ptr = (PVOID)((ULONG_PTR)Ptr + SidLength);
+
+ MembersInfo2->lgrmi2_sidusage = EnumContext->Names[i].Use;
+
+ MembersInfo2->lgrmi2_domainandname = (LPWSTR)Ptr;
+ memcpy(MembersInfo2->lgrmi2_domainandname,
+
EnumContext->Domains->Domains[EnumContext->Names[i].DomainIndex].Name.Buffer,
+
EnumContext->Domains->Domains[EnumContext->Names[i].DomainIndex].Name.Length);
+
+ Ptr = (PVOID)((ULONG_PTR)Ptr +
EnumContext->Domains->Domains[EnumContext->Names[i].DomainIndex].Name.Length);
+
+ *((LPWSTR)Ptr) = L'\\';
+
+ Ptr = (PVOID)((ULONG_PTR)Ptr + sizeof(WCHAR));
+
+ memcpy(Ptr,
+ EnumContext->Names[i].Name.Buffer,
+ EnumContext->Names[i].Name.Length);
+ break;
+
+ case 3:
+ MembersInfo3->lgrmi3_domainandname = (PSID)Ptr;
+ memcpy(MembersInfo2->lgrmi2_domainandname,
+
EnumContext->Domains->Domains[EnumContext->Names[i].DomainIndex].Name.Buffer,
+
EnumContext->Domains->Domains[EnumContext->Names[i].DomainIndex].Name.Length);
+
+ Ptr = (PVOID)((ULONG_PTR)Ptr +
EnumContext->Domains->Domains[EnumContext->Names[i].DomainIndex].Name.Length);
+
+ *((LPWSTR)Ptr) = L'\\';
+
+ Ptr = (PVOID)((ULONG_PTR)Ptr + sizeof(WCHAR));
+
+ memcpy(Ptr,
EnumContext->Names[i].Name.Buffer,
EnumContext->Names[i].Name.Length);
break;