mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 07:32:57 +00:00
[SAMSRV]
Add query and set code of user private data and security descriptor attributes. svn path=/trunk/; revision=60691
This commit is contained in:
parent
3586cb1635
commit
7483a5ed77
1 changed files with 58 additions and 2 deletions
|
@ -6793,7 +6793,14 @@ SampQueryUserAll(PSAM_DB_OBJECT UserObject,
|
||||||
|
|
||||||
if (InfoBuffer->All.WhichFields & USER_ALL_PRIVATEDATA)
|
if (InfoBuffer->All.WhichFields & USER_ALL_PRIVATEDATA)
|
||||||
{
|
{
|
||||||
/* FIXME */
|
Status = SampGetObjectAttributeString(UserObject,
|
||||||
|
L"PrivateData",
|
||||||
|
&InfoBuffer->All.PrivateData);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
TRACE("Status 0x%08lx\n", Status);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (InfoBuffer->All.WhichFields & USER_ALL_PASSWORDEXPIRED)
|
if (InfoBuffer->All.WhichFields & USER_ALL_PASSWORDEXPIRED)
|
||||||
|
@ -6803,7 +6810,32 @@ SampQueryUserAll(PSAM_DB_OBJECT UserObject,
|
||||||
|
|
||||||
if (InfoBuffer->All.WhichFields & USER_ALL_SECURITYDESCRIPTOR)
|
if (InfoBuffer->All.WhichFields & USER_ALL_SECURITYDESCRIPTOR)
|
||||||
{
|
{
|
||||||
/* FIXME */
|
Length = 0;
|
||||||
|
SampGetObjectAttribute(UserObject,
|
||||||
|
L"SecDesc",
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&Length);
|
||||||
|
|
||||||
|
if (Length > 0)
|
||||||
|
{
|
||||||
|
InfoBuffer->All.SecurityDescriptor.SecurityDescriptor = midl_user_allocate(Length);
|
||||||
|
if (InfoBuffer->All.SecurityDescriptor.SecurityDescriptor == NULL)
|
||||||
|
{
|
||||||
|
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
InfoBuffer->All.SecurityDescriptor.Length = Length;
|
||||||
|
|
||||||
|
Status = SampGetObjectAttribute(UserObject,
|
||||||
|
L"SecDesc",
|
||||||
|
NULL,
|
||||||
|
(PVOID)InfoBuffer->All.SecurityDescriptor.SecurityDescriptor,
|
||||||
|
&Length);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*Buffer = InfoBuffer;
|
*Buffer = InfoBuffer;
|
||||||
|
@ -6852,6 +6884,12 @@ done:
|
||||||
if (InfoBuffer->All.NtOwfPassword.Buffer != NULL)
|
if (InfoBuffer->All.NtOwfPassword.Buffer != NULL)
|
||||||
midl_user_free(InfoBuffer->All.NtOwfPassword.Buffer);
|
midl_user_free(InfoBuffer->All.NtOwfPassword.Buffer);
|
||||||
|
|
||||||
|
if (InfoBuffer->All.PrivateData.Buffer != NULL)
|
||||||
|
midl_user_free(InfoBuffer->All.PrivateData.Buffer);
|
||||||
|
|
||||||
|
if (InfoBuffer->All.SecurityDescriptor.SecurityDescriptor != NULL)
|
||||||
|
midl_user_free(InfoBuffer->All.SecurityDescriptor.SecurityDescriptor);
|
||||||
|
|
||||||
midl_user_free(InfoBuffer);
|
midl_user_free(InfoBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7539,6 +7577,15 @@ SampSetUserAll(PSAM_DB_OBJECT UserObject,
|
||||||
WriteFixedData = TRUE;
|
WriteFixedData = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (WhichFields & USER_ALL_PRIVATEDATA)
|
||||||
|
{
|
||||||
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
|
L"PrivateData",
|
||||||
|
&Buffer->All.PrivateData);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
if (WhichFields & USER_ALL_PASSWORDEXPIRED)
|
if (WhichFields & USER_ALL_PASSWORDEXPIRED)
|
||||||
{
|
{
|
||||||
if (Buffer->All.PasswordExpired)
|
if (Buffer->All.PasswordExpired)
|
||||||
|
@ -7558,6 +7605,15 @@ SampSetUserAll(PSAM_DB_OBJECT UserObject,
|
||||||
WriteFixedData = TRUE;
|
WriteFixedData = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (WhichFields & USER_ALL_SECURITYDESCRIPTOR)
|
||||||
|
{
|
||||||
|
Status = SampSetObjectAttribute(UserObject,
|
||||||
|
L"SecDesc",
|
||||||
|
REG_BINARY,
|
||||||
|
Buffer->All.SecurityDescriptor.SecurityDescriptor,
|
||||||
|
Buffer->All.SecurityDescriptor.Length);
|
||||||
|
}
|
||||||
|
|
||||||
if (WriteFixedData == TRUE)
|
if (WriteFixedData == TRUE)
|
||||||
{
|
{
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttribute(UserObject,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue