Author: ekohl
Date: Sat Jan 5 20:30:06 2013
New Revision: 58117
URL:
http://svn.reactos.org/svn/reactos?rev=58117&view=rev
Log:
[SAMSRV]
Implement SamrQueryInformationUser.UserParametersInformation and set the Parameters
attribute when a new user is created.
Modified:
trunk/reactos/dll/win32/samsrv/samrpc.c
trunk/reactos/dll/win32/samsrv/setup.c
Modified: trunk/reactos/dll/win32/samsrv/samrpc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samrpc.c?…
==============================================================================
--- trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] Sat Jan 5 20:30:06 2013
@@ -2297,6 +2297,18 @@
return Status;
}
+ /* Set the Parameters attribute */
+ Status = SampSetObjectAttribute(UserObject,
+ L"Parameters",
+ REG_SZ,
+ EmptyString.Buffer,
+ EmptyString.MaximumLength);
+ if (!NT_SUCCESS(Status))
+ {
+ TRACE("failed with status 0x%08lx\n", Status);
+ return Status;
+ }
+
/* FIXME: Set default user attributes */
if (NT_SUCCESS(Status))
@@ -5654,6 +5666,47 @@
}
+static NTSTATUS
+SampQueryUserParameters(PSAM_DB_OBJECT UserObject,
+ PSAMPR_USER_INFO_BUFFER *Buffer)
+{
+ PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
+ NTSTATUS Status;
+
+ *Buffer = NULL;
+
+ InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
+ if (InfoBuffer == NULL)
+ return STATUS_INSUFFICIENT_RESOURCES;
+
+ /* Get the Parameters string */
+ Status = SampGetObjectAttributeString(UserObject,
+ L"Parameters",
+ &InfoBuffer->Parameters.Parameters);
+ if (!NT_SUCCESS(Status))
+ {
+ TRACE("Status 0x%08lx\n", Status);
+ goto done;
+ }
+
+ *Buffer = InfoBuffer;
+
+done:
+ if (!NT_SUCCESS(Status))
+ {
+ if (InfoBuffer != NULL)
+ {
+ if (InfoBuffer->Parameters.Parameters.Buffer != NULL)
+ midl_user_free(InfoBuffer->Parameters.Parameters.Buffer);
+
+ midl_user_free(InfoBuffer);
+ }
+ }
+
+ return Status;
+}
+
+
/* Function 36 */
NTSTATUS
NTAPI
@@ -5689,6 +5742,7 @@
case UserControlInformation:
case UserExpiresInformation:
+ case UserParametersInformation:
DesiredAccess = USER_READ_ACCOUNT;
break;
@@ -5800,6 +5854,19 @@
Status = SampQueryUserExpires(UserObject,
Buffer);
break;
+
+// case UserInternal1Information:
+
+ case UserParametersInformation:
+ Status = SampQueryUserParameters(UserObject,
+ Buffer);
+ break;
+
+// case UserAllInformation:
+// case UserInternal4Information:
+// case UserInternal5Information:
+// case UserInternal4InformationNew:
+// case UserInternal5InformationNew:
default:
Status = STATUS_INVALID_INFO_CLASS;
Modified: trunk/reactos/dll/win32/samsrv/setup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/setup.c?r…
==============================================================================
--- trunk/reactos/dll/win32/samsrv/setup.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samsrv/setup.c [iso-8859-1] Sat Jan 5 20:30:06 2013
@@ -313,6 +313,13 @@
RegSetValueEx(hAccountKey,
L"WorkStations",
+ 0,
+ REG_SZ,
+ (LPVOID)lpEmptyString,
+ sizeof(WCHAR));
+
+ RegSetValueEx(hAccountKey,
+ L"Parameters",
0,
REG_SZ,
(LPVOID)lpEmptyString,