Author: ekohl
Date: Mon Dec 24 12:48:39 2012
New Revision: 57994
URL:
http://svn.reactos.org/svn/reactos?rev=57994&view=rev
Log:
[NETAPI32]
Use servername in NetLocalGroupEnum and NetUserEnum.
Modified:
trunk/reactos/dll/win32/netapi32/local_group.c
trunk/reactos/dll/win32/netapi32/misc.c
trunk/reactos/dll/win32/netapi32/netapi32.h
trunk/reactos/dll/win32/netapi32/user.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] Mon Dec 24 12:48:39 2012
@@ -150,6 +150,7 @@
LPDWORD totalentries,
PDWORD_PTR resumehandle)
{
+ UNICODE_STRING ServerName;
PSAM_RID_ENUMERATION CurrentAlias;
PENUM_CONTEXT EnumContext = NULL;
PSID DomainSid = NULL;
@@ -171,6 +172,9 @@
*totalentries = 0;
*bufptr = NULL;
+ if (servername != NULL)
+ RtlInitUnicodeString(&ServerName, servername);
+
if (resumehandle != NULL && *resumehandle != 0)
{
EnumContext = (PENUM_CONTEXT)*resumehandle;
@@ -187,7 +191,7 @@
EnumContext->Index = 0;
EnumContext->BuiltinDone = FALSE;
- Status = SamConnect(NULL,
+ Status = SamConnect((servername != NULL) ? &ServerName : NULL,
&EnumContext->ServerHandle,
SAM_SERVER_CONNECT | SAM_SERVER_LOOKUP_DOMAIN,
NULL);
@@ -198,7 +202,8 @@
goto done;
}
- Status = GetAccountDomainSid(&DomainSid);
+ Status = GetAccountDomainSid((servername != NULL) ? &ServerName : NULL,
+ &DomainSid);
if (!NT_SUCCESS(Status))
{
ERR("GetAccountDomainSid failed (Status %08lx)\n", Status);
Modified: trunk/reactos/dll/win32/netapi32/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/misc.c?…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/misc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/misc.c [iso-8859-1] Mon Dec 24 12:48:39 2012
@@ -37,7 +37,8 @@
/* FUNCTIONS *****************************************************************/
NTSTATUS
-GetAccountDomainSid(PSID *AccountDomainSid)
+GetAccountDomainSid(IN PUNICODE_STRING ServerName,
+ OUT PSID *AccountDomainSid)
{
PPOLICY_ACCOUNT_DOMAIN_INFO AccountDomainInfo = NULL;
LSA_OBJECT_ATTRIBUTES ObjectAttributes;
@@ -47,7 +48,7 @@
memset(&ObjectAttributes, 0, sizeof(LSA_OBJECT_ATTRIBUTES));
- Status = LsaOpenPolicy(NULL,
+ Status = LsaOpenPolicy(ServerName,
&ObjectAttributes,
POLICY_VIEW_LOCAL_INFORMATION,
&PolicyHandle);
@@ -89,7 +90,7 @@
NTSTATUS
-GetBuiltinDomainSid(PSID *BuiltinDomainSid)
+GetBuiltinDomainSid(OUT PSID *BuiltinDomainSid)
{
PSID Sid = NULL;
PULONG Ptr;
Modified: trunk/reactos/dll/win32/netapi32/netapi32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/netapi3…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/netapi32.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/netapi32.h [iso-8859-1] Mon Dec 24 12:48:39 2012
@@ -9,9 +9,10 @@
/* misc.c */
NTSTATUS
-GetAccountDomainSid(PSID *AccountDomainSid);
+GetAccountDomainSid(IN PUNICODE_STRING ServerName,
+ OUT PSID *AccountDomainSid);
NTSTATUS
-GetBuiltinDomainSid(PSID *BuiltinDomainSid);
+GetBuiltinDomainSid(OUT PSID *BuiltinDomainSid);
#endif
Modified: trunk/reactos/dll/win32/netapi32/user.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/user.c?…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/user.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/user.c [iso-8859-1] Mon Dec 24 12:48:39 2012
@@ -321,6 +321,7 @@
LPDWORD totalentries,
LPDWORD resume_handle)
{
+ UNICODE_STRING ServerName;
PSAM_RID_ENUMERATION CurrentUser;
PENUM_CONTEXT EnumContext = NULL;
LPVOID Buffer = NULL;
@@ -346,6 +347,9 @@
*totalentries = 0;
*bufptr = NULL;
+ if (servername != NULL)
+ RtlInitUnicodeString(&ServerName, servername);
+
if (resume_handle != NULL && *resume_handle != 0)
{
EnumContext = (PENUM_CONTEXT)*resume_handle;
@@ -362,7 +366,7 @@
EnumContext->Index = 0;
EnumContext->BuiltinDone = FALSE;
- Status = SamConnect(NULL,
+ Status = SamConnect((servername != NULL) ? &ServerName : NULL,
&EnumContext->ServerHandle,
SAM_SERVER_CONNECT | SAM_SERVER_LOOKUP_DOMAIN,
NULL);
@@ -373,7 +377,8 @@
goto done;
}
- Status = GetAccountDomainSid(&DomainSid);
+ Status = GetAccountDomainSid((servername != NULL) ? &ServerName : NULL,
+ &DomainSid);
if (!NT_SUCCESS(Status))
{
ERR("GetAccountDomainSid failed (Status %08lx)\n", Status);