mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 16:26:02 +00:00
[SAMSRV]
- Use the new function SampSetObjectAttributeString to write strings to the registry. Handle empty strings properly. - Fix SampGetObjectAttributeString to handle empty strings properly as well. svn path=/trunk/; revision=59964
This commit is contained in:
parent
d791c1aca4
commit
cdb303dc54
3 changed files with 208 additions and 285 deletions
|
@ -533,7 +533,7 @@ SampGetObjectAttribute(PSAM_DB_OBJECT DbObject,
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
SampGetObjectAttributeString(PSAM_DB_OBJECT DbObject,
|
SampGetObjectAttributeString(PSAM_DB_OBJECT DbObject,
|
||||||
LPWSTR AttributeName,
|
LPWSTR AttributeName,
|
||||||
RPC_UNICODE_STRING *String)
|
PRPC_UNICODE_STRING String)
|
||||||
{
|
{
|
||||||
ULONG Length = 0;
|
ULONG Length = 0;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
@ -549,6 +549,16 @@ SampGetObjectAttributeString(PSAM_DB_OBJECT DbObject,
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Length == 0)
|
||||||
|
{
|
||||||
|
String->Length = 0;
|
||||||
|
String->MaximumLength = 0;
|
||||||
|
String->Buffer = NULL;
|
||||||
|
|
||||||
|
Status = STATUS_SUCCESS;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
String->Length = (USHORT)(Length - sizeof(WCHAR));
|
String->Length = (USHORT)(Length - sizeof(WCHAR));
|
||||||
String->MaximumLength = (USHORT)Length;
|
String->MaximumLength = (USHORT)Length;
|
||||||
String->Buffer = midl_user_allocate(Length);
|
String->Buffer = midl_user_allocate(Length);
|
||||||
|
@ -583,5 +593,28 @@ done:
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
SampSetObjectAttributeString(PSAM_DB_OBJECT DbObject,
|
||||||
|
LPWSTR AttributeName,
|
||||||
|
PRPC_UNICODE_STRING String)
|
||||||
|
{
|
||||||
|
PWCHAR Buffer = NULL;
|
||||||
|
USHORT Length = 0;
|
||||||
|
|
||||||
|
if ((String != NULL) && (String->Buffer != NULL))
|
||||||
|
{
|
||||||
|
Buffer = String->Buffer;
|
||||||
|
Length = String->Length + sizeof(WCHAR);
|
||||||
|
}
|
||||||
|
|
||||||
|
return SampSetObjectAttribute(DbObject,
|
||||||
|
AttributeName,
|
||||||
|
REG_SZ,
|
||||||
|
Buffer,
|
||||||
|
Length);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
||||||
|
|
|
@ -1714,27 +1714,21 @@ SamrSetInformationDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DomainOemInformation:
|
case DomainOemInformation:
|
||||||
Status = SampSetObjectAttribute(DomainObject,
|
Status = SampSetObjectAttributeString(DomainObject,
|
||||||
L"OemInformation",
|
L"OemInformation",
|
||||||
REG_SZ,
|
&DomainInformation->Oem.OemInformation);
|
||||||
DomainInformation->Oem.OemInformation.Buffer,
|
|
||||||
DomainInformation->Oem.OemInformation.Length + sizeof(WCHAR));
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DomainNameInformation:
|
case DomainNameInformation:
|
||||||
Status = SampSetObjectAttribute(DomainObject,
|
Status = SampSetObjectAttributeString(DomainObject,
|
||||||
L"Name",
|
L"Name",
|
||||||
REG_SZ,
|
&DomainInformation->Name.DomainName);
|
||||||
DomainInformation->Name.DomainName.Buffer,
|
|
||||||
DomainInformation->Name.DomainName.Length + sizeof(WCHAR));
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DomainReplicationInformation:
|
case DomainReplicationInformation:
|
||||||
Status = SampSetObjectAttribute(DomainObject,
|
Status = SampSetObjectAttributeString(DomainObject,
|
||||||
L"ReplicaSourceNodeName",
|
L"ReplicaSourceNodeName",
|
||||||
REG_SZ,
|
&DomainInformation->Replication.ReplicaSourceNodeName);
|
||||||
DomainInformation->Replication.ReplicaSourceNodeName.Buffer,
|
|
||||||
DomainInformation->Replication.ReplicaSourceNodeName.Length + sizeof(WCHAR));
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DomainServerRoleInformation:
|
case DomainServerRoleInformation:
|
||||||
|
@ -1772,7 +1766,6 @@ SamrCreateGroupInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
OUT SAMPR_HANDLE *GroupHandle,
|
OUT SAMPR_HANDLE *GroupHandle,
|
||||||
OUT unsigned long *RelativeId)
|
OUT unsigned long *RelativeId)
|
||||||
{
|
{
|
||||||
UNICODE_STRING EmptyString = RTL_CONSTANT_STRING(L"");
|
|
||||||
SAM_DOMAIN_FIXED_DATA FixedDomainData;
|
SAM_DOMAIN_FIXED_DATA FixedDomainData;
|
||||||
SAM_GROUP_FIXED_DATA FixedGroupData;
|
SAM_GROUP_FIXED_DATA FixedGroupData;
|
||||||
PSAM_DB_OBJECT DomainObject;
|
PSAM_DB_OBJECT DomainObject;
|
||||||
|
@ -1840,10 +1833,10 @@ SamrCreateGroupInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
|
|
||||||
/* Store the fixed domain attributes */
|
/* Store the fixed domain attributes */
|
||||||
Status = SampSetObjectAttribute(DomainObject,
|
Status = SampSetObjectAttribute(DomainObject,
|
||||||
L"F",
|
L"F",
|
||||||
REG_BINARY,
|
REG_BINARY,
|
||||||
&FixedDomainData,
|
&FixedDomainData,
|
||||||
ulSize);
|
ulSize);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -1898,11 +1891,9 @@ SamrCreateGroupInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the Name attribute */
|
/* Set the Name attribute */
|
||||||
Status = SampSetObjectAttribute(GroupObject,
|
Status = SampSetObjectAttributeString(GroupObject,
|
||||||
L"Name",
|
L"Name",
|
||||||
REG_SZ,
|
Name);
|
||||||
(LPVOID)Name->Buffer,
|
|
||||||
Name->MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -1910,11 +1901,9 @@ SamrCreateGroupInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the AdminComment attribute */
|
/* Set the AdminComment attribute */
|
||||||
Status = SampSetObjectAttribute(GroupObject,
|
Status = SampSetObjectAttributeString(GroupObject,
|
||||||
L"AdminComment",
|
L"AdminComment",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -2150,7 +2139,6 @@ SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
OUT SAMPR_HANDLE *UserHandle,
|
OUT SAMPR_HANDLE *UserHandle,
|
||||||
OUT unsigned long *RelativeId)
|
OUT unsigned long *RelativeId)
|
||||||
{
|
{
|
||||||
UNICODE_STRING EmptyString = RTL_CONSTANT_STRING(L"");
|
|
||||||
SAM_DOMAIN_FIXED_DATA FixedDomainData;
|
SAM_DOMAIN_FIXED_DATA FixedDomainData;
|
||||||
SAM_USER_FIXED_DATA FixedUserData;
|
SAM_USER_FIXED_DATA FixedUserData;
|
||||||
PSAM_DB_OBJECT DomainObject;
|
PSAM_DB_OBJECT DomainObject;
|
||||||
|
@ -2302,11 +2290,9 @@ SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the Name attribute */
|
/* Set the Name attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"Name",
|
L"Name",
|
||||||
REG_SZ,
|
Name);
|
||||||
(LPVOID)Name->Buffer,
|
|
||||||
Name->MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -2314,11 +2300,9 @@ SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the FullName attribute */
|
/* Set the FullName attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"FullName",
|
L"FullName",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -2326,11 +2310,9 @@ SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the HomeDirectory attribute */
|
/* Set the HomeDirectory attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"HomeDirectory",
|
L"HomeDirectory",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -2338,11 +2320,9 @@ SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the HomeDirectoryDrive attribute */
|
/* Set the HomeDirectoryDrive attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"HomeDirectoryDrive",
|
L"HomeDirectoryDrive",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -2350,11 +2330,9 @@ SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the ScriptPath attribute */
|
/* Set the ScriptPath attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"ScriptPath",
|
L"ScriptPath",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -2362,11 +2340,9 @@ SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the ProfilePath attribute */
|
/* Set the ProfilePath attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"ProfilePath",
|
L"ProfilePath",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -2374,11 +2350,9 @@ SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the AdminComment attribute */
|
/* Set the AdminComment attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"AdminComment",
|
L"AdminComment",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -2386,11 +2360,9 @@ SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the UserComment attribute */
|
/* Set the UserComment attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"UserComment",
|
L"UserComment",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -2398,11 +2370,9 @@ SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the WorkStations attribute */
|
/* Set the WorkStations attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"WorkStations",
|
L"WorkStations",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -2410,11 +2380,9 @@ SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the Parameters attribute */
|
/* Set the Parameters attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"Parameters",
|
L"Parameters",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -2736,7 +2704,6 @@ SamrCreateAliasInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
SAM_DOMAIN_FIXED_DATA FixedDomainData;
|
SAM_DOMAIN_FIXED_DATA FixedDomainData;
|
||||||
PSAM_DB_OBJECT DomainObject;
|
PSAM_DB_OBJECT DomainObject;
|
||||||
PSAM_DB_OBJECT AliasObject;
|
PSAM_DB_OBJECT AliasObject;
|
||||||
UNICODE_STRING EmptyString = RTL_CONSTANT_STRING(L"");
|
|
||||||
ULONG ulSize;
|
ULONG ulSize;
|
||||||
ULONG ulRid;
|
ULONG ulRid;
|
||||||
WCHAR szRid[9];
|
WCHAR szRid[9];
|
||||||
|
@ -2841,11 +2808,9 @@ SamrCreateAliasInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the Name attribute */
|
/* Set the Name attribute */
|
||||||
Status = SampSetObjectAttribute(AliasObject,
|
Status = SampSetObjectAttributeString(AliasObject,
|
||||||
L"Name",
|
L"Name",
|
||||||
REG_SZ,
|
AccountName);
|
||||||
(LPVOID)AccountName->Buffer,
|
|
||||||
AccountName->MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -2853,11 +2818,9 @@ SamrCreateAliasInDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the Description attribute */
|
/* Set the Description attribute */
|
||||||
Status = SampSetObjectAttribute(AliasObject,
|
Status = SampSetObjectAttributeString(AliasObject,
|
||||||
L"Description",
|
L"Description",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -4141,11 +4104,9 @@ SampSetGroupName(PSAM_DB_OBJECT GroupObject,
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = SampSetObjectAttribute(GroupObject,
|
Status = SampSetObjectAttributeString(GroupObject,
|
||||||
L"Name",
|
L"Name",
|
||||||
REG_SZ,
|
(PRPC_UNICODE_STRING)&NewGroupName);
|
||||||
NewGroupName.Buffer,
|
|
||||||
NewGroupName.Length + sizeof(WCHAR));
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("SampSetObjectAttribute failed (Status 0x%08lx)\n", Status);
|
TRACE("SampSetObjectAttribute failed (Status 0x%08lx)\n", Status);
|
||||||
|
@ -4226,11 +4187,9 @@ SamrSetInformationGroup(IN SAMPR_HANDLE GroupHandle,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GroupAdminCommentInformation:
|
case GroupAdminCommentInformation:
|
||||||
Status = SampSetObjectAttribute(GroupObject,
|
Status = SampSetObjectAttributeString(GroupObject,
|
||||||
L"Description",
|
L"Description",
|
||||||
REG_SZ,
|
&Buffer->AdminComment.AdminComment);
|
||||||
Buffer->AdminComment.AdminComment.Buffer,
|
|
||||||
Buffer->AdminComment.AdminComment.Length + sizeof(WCHAR));
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -4926,11 +4885,9 @@ SampSetAliasName(PSAM_DB_OBJECT AliasObject,
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = SampSetObjectAttribute(AliasObject,
|
Status = SampSetObjectAttributeString(AliasObject,
|
||||||
L"Name",
|
L"Name",
|
||||||
REG_SZ,
|
(PRPC_UNICODE_STRING)&NewAliasName);
|
||||||
NewAliasName.Buffer,
|
|
||||||
NewAliasName.Length + sizeof(WCHAR));
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("SampSetObjectAttribute failed (Status 0x%08lx)\n", Status);
|
TRACE("SampSetObjectAttribute failed (Status 0x%08lx)\n", Status);
|
||||||
|
@ -4976,11 +4933,9 @@ SamrSetInformationAlias(IN SAMPR_HANDLE AliasHandle,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AliasAdminCommentInformation:
|
case AliasAdminCommentInformation:
|
||||||
Status = SampSetObjectAttribute(AliasObject,
|
Status = SampSetObjectAttributeString(AliasObject,
|
||||||
L"Description",
|
L"Description",
|
||||||
REG_SZ,
|
&Buffer->AdminComment.AdminComment);
|
||||||
Buffer->AdminComment.AdminComment.Buffer,
|
|
||||||
Buffer->AdminComment.AdminComment.Length + sizeof(WCHAR));
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -7039,11 +6994,9 @@ SampSetUserName(PSAM_DB_OBJECT UserObject,
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"Name",
|
L"Name",
|
||||||
REG_SZ,
|
NewUserName);
|
||||||
NewUserName->Buffer,
|
|
||||||
NewUserName->Length + sizeof(WCHAR));
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("SampSetObjectAttribute failed (Status 0x%08lx)\n", Status);
|
TRACE("SampSetObjectAttribute failed (Status 0x%08lx)\n", Status);
|
||||||
|
@ -7089,27 +7042,21 @@ SampSetUserGeneral(PSAM_DB_OBJECT UserObject,
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"FullName",
|
L"FullName",
|
||||||
REG_SZ,
|
&Buffer->General.FullName);
|
||||||
Buffer->General.FullName.Buffer,
|
|
||||||
Buffer->General.FullName.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"AdminComment",
|
L"AdminComment",
|
||||||
REG_SZ,
|
&Buffer->General.AdminComment);
|
||||||
Buffer->General.AdminComment.Buffer,
|
|
||||||
Buffer->General.AdminComment.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"UserComment",
|
L"UserComment",
|
||||||
REG_SZ,
|
&Buffer->General.UserComment);
|
||||||
Buffer->General.UserComment.Buffer,
|
|
||||||
Buffer->General.UserComment.MaximumLength);
|
|
||||||
|
|
||||||
done:
|
done:
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -7144,11 +7091,9 @@ SampSetUserPreferences(PSAM_DB_OBJECT UserObject,
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"UserComment",
|
L"UserComment",
|
||||||
REG_SZ,
|
&Buffer->Preferences.UserComment);
|
||||||
Buffer->Preferences.UserComment.Buffer,
|
|
||||||
Buffer->Preferences.UserComment.MaximumLength);
|
|
||||||
|
|
||||||
done:
|
done:
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -7337,99 +7282,81 @@ SampSetUserAll(PSAM_DB_OBJECT UserObject,
|
||||||
|
|
||||||
if (WhichFields & USER_ALL_FULLNAME)
|
if (WhichFields & USER_ALL_FULLNAME)
|
||||||
{
|
{
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"FullName",
|
L"FullName",
|
||||||
REG_SZ,
|
&Buffer->All.FullName);
|
||||||
Buffer->All.FullName.Buffer,
|
|
||||||
Buffer->All.FullName.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WhichFields & USER_ALL_ADMINCOMMENT)
|
if (WhichFields & USER_ALL_ADMINCOMMENT)
|
||||||
{
|
{
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"AdminComment",
|
L"AdminComment",
|
||||||
REG_SZ,
|
&Buffer->All.AdminComment);
|
||||||
Buffer->All.AdminComment.Buffer,
|
|
||||||
Buffer->All.AdminComment.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WhichFields & USER_ALL_USERCOMMENT)
|
if (WhichFields & USER_ALL_USERCOMMENT)
|
||||||
{
|
{
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"UserComment",
|
L"UserComment",
|
||||||
REG_SZ,
|
&Buffer->All.UserComment);
|
||||||
Buffer->All.UserComment.Buffer,
|
|
||||||
Buffer->All.UserComment.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WhichFields & USER_ALL_HOMEDIRECTORY)
|
if (WhichFields & USER_ALL_HOMEDIRECTORY)
|
||||||
{
|
{
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"HomeDirectory",
|
L"HomeDirectory",
|
||||||
REG_SZ,
|
&Buffer->All.HomeDirectory);
|
||||||
Buffer->All.HomeDirectory.Buffer,
|
|
||||||
Buffer->All.HomeDirectory.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WhichFields & USER_ALL_HOMEDIRECTORYDRIVE)
|
if (WhichFields & USER_ALL_HOMEDIRECTORYDRIVE)
|
||||||
{
|
{
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"HomeDirectoryDrive",
|
L"HomeDirectoryDrive",
|
||||||
REG_SZ,
|
&Buffer->All.HomeDirectoryDrive);
|
||||||
Buffer->All.HomeDirectoryDrive.Buffer,
|
|
||||||
Buffer->All.HomeDirectoryDrive.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WhichFields & USER_ALL_SCRIPTPATH)
|
if (WhichFields & USER_ALL_SCRIPTPATH)
|
||||||
{
|
{
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"ScriptPath",
|
L"ScriptPath",
|
||||||
REG_SZ,
|
&Buffer->All.ScriptPath);
|
||||||
Buffer->All.ScriptPath.Buffer,
|
|
||||||
Buffer->All.ScriptPath.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WhichFields & USER_ALL_PROFILEPATH)
|
if (WhichFields & USER_ALL_PROFILEPATH)
|
||||||
{
|
{
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"ProfilePath",
|
L"ProfilePath",
|
||||||
REG_SZ,
|
&Buffer->All.ProfilePath);
|
||||||
Buffer->All.ProfilePath.Buffer,
|
|
||||||
Buffer->All.ProfilePath.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WhichFields & USER_ALL_WORKSTATIONS)
|
if (WhichFields & USER_ALL_WORKSTATIONS)
|
||||||
{
|
{
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"WorkStations",
|
L"WorkStations",
|
||||||
REG_SZ,
|
&Buffer->All.WorkStations);
|
||||||
Buffer->All.WorkStations.Buffer,
|
|
||||||
Buffer->All.WorkStations.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WhichFields & USER_ALL_PARAMETERS)
|
if (WhichFields & USER_ALL_PARAMETERS)
|
||||||
{
|
{
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"Parameters",
|
L"Parameters",
|
||||||
REG_SZ,
|
&Buffer->All.Parameters);
|
||||||
Buffer->All.Parameters.Buffer,
|
|
||||||
Buffer->All.Parameters.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
@ -7630,11 +7557,9 @@ SamrSetInformationUser(IN SAMPR_HANDLE UserHandle,
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"FullName",
|
L"FullName",
|
||||||
REG_SZ,
|
&Buffer->Name.FullName);
|
||||||
Buffer->Name.FullName.Buffer,
|
|
||||||
Buffer->Name.FullName.MaximumLength);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UserAccountNameInformation:
|
case UserAccountNameInformation:
|
||||||
|
@ -7643,11 +7568,9 @@ SamrSetInformationUser(IN SAMPR_HANDLE UserHandle,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UserFullNameInformation:
|
case UserFullNameInformation:
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"FullName",
|
L"FullName",
|
||||||
REG_SZ,
|
&Buffer->FullName.FullName);
|
||||||
Buffer->FullName.FullName.Buffer,
|
|
||||||
Buffer->FullName.FullName.MaximumLength);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UserPrimaryGroupInformation:
|
case UserPrimaryGroupInformation:
|
||||||
|
@ -7656,62 +7579,48 @@ SamrSetInformationUser(IN SAMPR_HANDLE UserHandle,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UserHomeInformation:
|
case UserHomeInformation:
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"HomeDirectory",
|
L"HomeDirectory",
|
||||||
REG_SZ,
|
&Buffer->Home.HomeDirectory);
|
||||||
Buffer->Home.HomeDirectory.Buffer,
|
|
||||||
Buffer->Home.HomeDirectory.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"HomeDirectoryDrive",
|
L"HomeDirectoryDrive",
|
||||||
REG_SZ,
|
&Buffer->Home.HomeDirectoryDrive);
|
||||||
Buffer->Home.HomeDirectoryDrive.Buffer,
|
|
||||||
Buffer->Home.HomeDirectoryDrive.MaximumLength);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UserScriptInformation:
|
case UserScriptInformation:
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"ScriptPath",
|
L"ScriptPath",
|
||||||
REG_SZ,
|
&Buffer->Script.ScriptPath);
|
||||||
Buffer->Script.ScriptPath.Buffer,
|
|
||||||
Buffer->Script.ScriptPath.MaximumLength);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UserProfileInformation:
|
case UserProfileInformation:
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"ProfilePath",
|
L"ProfilePath",
|
||||||
REG_SZ,
|
&Buffer->Profile.ProfilePath);
|
||||||
Buffer->Profile.ProfilePath.Buffer,
|
|
||||||
Buffer->Profile.ProfilePath.MaximumLength);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UserAdminCommentInformation:
|
case UserAdminCommentInformation:
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"AdminComment",
|
L"AdminComment",
|
||||||
REG_SZ,
|
&Buffer->AdminComment.AdminComment);
|
||||||
Buffer->AdminComment.AdminComment.Buffer,
|
|
||||||
Buffer->AdminComment.AdminComment.MaximumLength);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UserWorkStationsInformation:
|
case UserWorkStationsInformation:
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"WorkStations",
|
L"WorkStations",
|
||||||
REG_SZ,
|
&Buffer->WorkStations.WorkStations);
|
||||||
Buffer->WorkStations.WorkStations.Buffer,
|
|
||||||
Buffer->WorkStations.WorkStations.MaximumLength);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UserSetPasswordInformation:
|
case UserSetPasswordInformation:
|
||||||
TRACE("Password: %S\n", Buffer->SetPassword.Password.Buffer);
|
TRACE("Password: %S\n", Buffer->SetPassword.Password.Buffer);
|
||||||
TRACE("PasswordExpired: %d\n", Buffer->SetPassword.PasswordExpired);
|
TRACE("PasswordExpired: %d\n", Buffer->SetPassword.PasswordExpired);
|
||||||
|
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"Password",
|
L"Password",
|
||||||
REG_SZ,
|
&Buffer->SetPassword.Password);
|
||||||
Buffer->SetPassword.Password.Buffer,
|
|
||||||
Buffer->SetPassword.Password.MaximumLength);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UserControlInformation:
|
case UserControlInformation:
|
||||||
|
@ -7730,11 +7639,9 @@ SamrSetInformationUser(IN SAMPR_HANDLE UserHandle,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UserParametersInformation:
|
case UserParametersInformation:
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"Parameters",
|
L"Parameters",
|
||||||
REG_SZ,
|
&Buffer->Parameters.Parameters);
|
||||||
Buffer->Parameters.Parameters.Buffer,
|
|
||||||
Buffer->Parameters.Parameters.MaximumLength);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UserAllInformation:
|
case UserAllInformation:
|
||||||
|
@ -8378,7 +8285,6 @@ SamrCreateUser2InDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
OUT unsigned long *GrantedAccess,
|
OUT unsigned long *GrantedAccess,
|
||||||
OUT unsigned long *RelativeId)
|
OUT unsigned long *RelativeId)
|
||||||
{
|
{
|
||||||
UNICODE_STRING EmptyString = RTL_CONSTANT_STRING(L"");
|
|
||||||
SAM_DOMAIN_FIXED_DATA FixedDomainData;
|
SAM_DOMAIN_FIXED_DATA FixedDomainData;
|
||||||
SAM_USER_FIXED_DATA FixedUserData;
|
SAM_USER_FIXED_DATA FixedUserData;
|
||||||
PSAM_DB_OBJECT DomainObject;
|
PSAM_DB_OBJECT DomainObject;
|
||||||
|
@ -8537,11 +8443,9 @@ SamrCreateUser2InDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the Name attribute */
|
/* Set the Name attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"Name",
|
L"Name",
|
||||||
REG_SZ,
|
Name);
|
||||||
(LPVOID)Name->Buffer,
|
|
||||||
Name->MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -8549,11 +8453,9 @@ SamrCreateUser2InDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the FullName attribute */
|
/* Set the FullName attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"FullName",
|
L"FullName",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -8561,11 +8463,9 @@ SamrCreateUser2InDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the HomeDirectory attribute */
|
/* Set the HomeDirectory attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"HomeDirectory",
|
L"HomeDirectory",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -8573,11 +8473,9 @@ SamrCreateUser2InDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the HomeDirectoryDrive attribute */
|
/* Set the HomeDirectoryDrive attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"HomeDirectoryDrive",
|
L"HomeDirectoryDrive",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -8585,11 +8483,9 @@ SamrCreateUser2InDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the ScriptPath attribute */
|
/* Set the ScriptPath attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"ScriptPath",
|
L"ScriptPath",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -8597,11 +8493,9 @@ SamrCreateUser2InDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the ProfilePath attribute */
|
/* Set the ProfilePath attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"ProfilePath",
|
L"ProfilePath",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -8609,11 +8503,9 @@ SamrCreateUser2InDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the AdminComment attribute */
|
/* Set the AdminComment attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"AdminComment",
|
L"AdminComment",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -8621,11 +8513,9 @@ SamrCreateUser2InDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the UserComment attribute */
|
/* Set the UserComment attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"UserComment",
|
L"UserComment",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -8633,11 +8523,9 @@ SamrCreateUser2InDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the WorkStations attribute */
|
/* Set the WorkStations attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"WorkStations",
|
L"WorkStations",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
@ -8645,11 +8533,9 @@ SamrCreateUser2InDomain(IN SAMPR_HANDLE DomainHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the Parameters attribute */
|
/* Set the Parameters attribute */
|
||||||
Status = SampSetObjectAttribute(UserObject,
|
Status = SampSetObjectAttributeString(UserObject,
|
||||||
L"Parameters",
|
L"Parameters",
|
||||||
REG_SZ,
|
NULL);
|
||||||
EmptyString.Buffer,
|
|
||||||
EmptyString.MaximumLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
TRACE("failed with status 0x%08lx\n", Status);
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
|
|
@ -194,8 +194,12 @@ SampGetObjectAttribute(PSAM_DB_OBJECT DbObject,
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
SampGetObjectAttributeString(PSAM_DB_OBJECT DbObject,
|
SampGetObjectAttributeString(PSAM_DB_OBJECT DbObject,
|
||||||
LPWSTR AttributeName,
|
LPWSTR AttributeName,
|
||||||
RPC_UNICODE_STRING *String);
|
PRPC_UNICODE_STRING String);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
SampSetObjectAttributeString(PSAM_DB_OBJECT DbObject,
|
||||||
|
LPWSTR AttributeName,
|
||||||
|
PRPC_UNICODE_STRING String);
|
||||||
|
|
||||||
/* domain.c */
|
/* domain.c */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue