mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 15:02:59 +00:00
[SAMSRV]
Implement the set LogonHours attribute code for all user set functions. svn path=/trunk/; revision=58715
This commit is contained in:
parent
30f64b59ea
commit
d8217043cd
3 changed files with 74 additions and 7 deletions
|
@ -2349,7 +2349,18 @@ SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: Set LogonHours attribute*/
|
/* Set LogonHours attribute*/
|
||||||
|
Status = SampSetObjectAttribute(UserObject,
|
||||||
|
L"LogonHours",
|
||||||
|
REG_BINARY,
|
||||||
|
NULL,
|
||||||
|
0);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: Set Groups attribute*/
|
/* FIXME: Set Groups attribute*/
|
||||||
|
|
||||||
/* Set LMPwd attribute*/
|
/* Set LMPwd attribute*/
|
||||||
|
@ -7098,6 +7109,16 @@ SampSetUserAll(PSAM_DB_OBJECT UserObject,
|
||||||
REG_SZ,
|
REG_SZ,
|
||||||
Buffer->All.Parameters.Buffer,
|
Buffer->All.Parameters.Buffer,
|
||||||
Buffer->All.Parameters.MaximumLength);
|
Buffer->All.Parameters.MaximumLength);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (WhichFields & USER_ALL_LOGONHOURS)
|
||||||
|
{
|
||||||
|
Status = SampSetLogonHoursAttrbute(UserObject,
|
||||||
|
&Buffer->All.LogonHours);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WhichFields & (USER_ALL_PRIMARYGROUPID |
|
if (WhichFields & (USER_ALL_PRIMARYGROUPID |
|
||||||
|
@ -7144,7 +7165,6 @@ SampSetUserAll(PSAM_DB_OBJECT UserObject,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
FIXME:
|
FIXME:
|
||||||
USER_ALL_LOGONHOURS
|
|
||||||
USER_ALL_NTPASSWORDPRESENT
|
USER_ALL_NTPASSWORDPRESENT
|
||||||
USER_ALL_LMPASSWORDPRESENT
|
USER_ALL_LMPASSWORDPRESENT
|
||||||
USER_ALL_PASSWORDEXPIRED
|
USER_ALL_PASSWORDEXPIRED
|
||||||
|
@ -7232,12 +7252,12 @@ SamrSetInformationUser(IN SAMPR_HANDLE UserHandle,
|
||||||
Status = SampSetUserPreferences(UserObject,
|
Status = SampSetUserPreferences(UserObject,
|
||||||
Buffer);
|
Buffer);
|
||||||
break;
|
break;
|
||||||
/*
|
|
||||||
case UserLogonHoursInformation:
|
case UserLogonHoursInformation:
|
||||||
Status = SampSetUserLogonHours(UserObject,
|
Status = SampSetLogonHoursAttrbute(UserObject,
|
||||||
Buffer);
|
&Buffer->LogonHours.LogonHours);
|
||||||
break;
|
break;
|
||||||
*/
|
|
||||||
case UserNameInformation:
|
case UserNameInformation:
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttribute(UserObject,
|
||||||
L"Name",
|
L"Name",
|
||||||
|
|
|
@ -328,6 +328,10 @@ SampSetUserPassword(IN PSAM_DB_OBJECT UserObject,
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
SampGetLogonHoursAttrbute(IN PSAM_DB_OBJECT UserObject,
|
SampGetLogonHoursAttrbute(IN PSAM_DB_OBJECT UserObject,
|
||||||
|
IN OUT PSAMPR_LOGON_HOURS LogonHours);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
SampSetLogonHoursAttrbute(IN PSAM_DB_OBJECT UserObject,
|
||||||
IN PSAMPR_LOGON_HOURS LogonHours);
|
IN PSAMPR_LOGON_HOURS LogonHours);
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -584,7 +584,7 @@ done:
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
SampGetLogonHoursAttrbute(IN PSAM_DB_OBJECT UserObject,
|
SampGetLogonHoursAttrbute(IN PSAM_DB_OBJECT UserObject,
|
||||||
IN PSAMPR_LOGON_HOURS LogonHours)
|
IN OUT PSAMPR_LOGON_HOURS LogonHours)
|
||||||
{
|
{
|
||||||
PUCHAR RawBuffer = NULL;
|
PUCHAR RawBuffer = NULL;
|
||||||
ULONG Length = 0;
|
ULONG Length = 0;
|
||||||
|
@ -651,4 +651,47 @@ done:
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
SampSetLogonHoursAttrbute(IN PSAM_DB_OBJECT UserObject,
|
||||||
|
IN PSAMPR_LOGON_HOURS LogonHours)
|
||||||
|
{
|
||||||
|
PUCHAR RawBuffer = NULL;
|
||||||
|
ULONG BufferLength;
|
||||||
|
ULONG Length = 0;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
if (LogonHours->UnitsPerWeek > 0)
|
||||||
|
{
|
||||||
|
BufferLength = (((ULONG)LogonHours->UnitsPerWeek) + 7) / 8;
|
||||||
|
|
||||||
|
Length = BufferLength + sizeof(USHORT);
|
||||||
|
|
||||||
|
RawBuffer = midl_user_allocate(Length);
|
||||||
|
if (RawBuffer == NULL)
|
||||||
|
{
|
||||||
|
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
*((PUSHORT)RawBuffer) = LogonHours->UnitsPerWeek;
|
||||||
|
|
||||||
|
memcpy(&(RawBuffer[2]),
|
||||||
|
LogonHours->LogonHours,
|
||||||
|
BufferLength);
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = SampSetObjectAttribute(UserObject,
|
||||||
|
L"LogonHours",
|
||||||
|
REG_BINARY,
|
||||||
|
RawBuffer,
|
||||||
|
Length);
|
||||||
|
|
||||||
|
done:
|
||||||
|
if (RawBuffer != NULL)
|
||||||
|
midl_user_free(RawBuffer);
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue