mirror of
https://github.com/reactos/reactos.git
synced 2025-06-03 16:30:26 +00:00
[SAMSRV]
Implement SamrQueryInformationUser.UserParametersInformation and set the Parameters attribute when a new user is created. svn path=/trunk/; revision=58117
This commit is contained in:
parent
6790ef337f
commit
f7dbb49d4c
2 changed files with 74 additions and 0 deletions
|
@ -2297,6 +2297,18 @@ SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
return Status;
|
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 */
|
/* FIXME: Set default user attributes */
|
||||||
|
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
|
@ -5654,6 +5666,47 @@ done:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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 */
|
/* Function 36 */
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
|
@ -5689,6 +5742,7 @@ SamrQueryInformationUser(IN SAMPR_HANDLE UserHandle,
|
||||||
|
|
||||||
case UserControlInformation:
|
case UserControlInformation:
|
||||||
case UserExpiresInformation:
|
case UserExpiresInformation:
|
||||||
|
case UserParametersInformation:
|
||||||
DesiredAccess = USER_READ_ACCOUNT;
|
DesiredAccess = USER_READ_ACCOUNT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -5801,6 +5855,19 @@ SamrQueryInformationUser(IN SAMPR_HANDLE UserHandle,
|
||||||
Buffer);
|
Buffer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// case UserInternal1Information:
|
||||||
|
|
||||||
|
case UserParametersInformation:
|
||||||
|
Status = SampQueryUserParameters(UserObject,
|
||||||
|
Buffer);
|
||||||
|
break;
|
||||||
|
|
||||||
|
// case UserAllInformation:
|
||||||
|
// case UserInternal4Information:
|
||||||
|
// case UserInternal5Information:
|
||||||
|
// case UserInternal4InformationNew:
|
||||||
|
// case UserInternal5InformationNew:
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Status = STATUS_INVALID_INFO_CLASS;
|
Status = STATUS_INVALID_INFO_CLASS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -318,6 +318,13 @@ SampCreateUserAccount(HKEY hDomainKey,
|
||||||
(LPVOID)lpEmptyString,
|
(LPVOID)lpEmptyString,
|
||||||
sizeof(WCHAR));
|
sizeof(WCHAR));
|
||||||
|
|
||||||
|
RegSetValueEx(hAccountKey,
|
||||||
|
L"Parameters",
|
||||||
|
0,
|
||||||
|
REG_SZ,
|
||||||
|
(LPVOID)lpEmptyString,
|
||||||
|
sizeof(WCHAR));
|
||||||
|
|
||||||
RegCloseKey(hAccountKey);
|
RegCloseKey(hAccountKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue