https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0e69bc3bce2c311ebde8039016a381afeb90a45f
commit 0e69bc3bce2c311ebde8039016a381afeb90a45f Author: Eric Kohl <[email protected]> AuthorDate: Sat Sep 8 19:23:00 2018 +0200 Commit: Eric Kohl <[email protected]> CommitDate: Sat Sep 8 19:24:13 2018 +0200 [SAMSRV] Fix SamrQueryInformationGroup - Use the registry value AdminComment for admin comments instead of Description. Fix SamrSetInformationGroup as well. - Add some TRACEs. - Do not fail if the Members value does not exist. --- dll/win32/samsrv/samrpc.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/dll/win32/samsrv/samrpc.c b/dll/win32/samsrv/samrpc.c index 45c550c499..5d3595c14a 100644 --- a/dll/win32/samsrv/samrpc.c +++ b/dll/win32/samsrv/samrpc.c @@ -4164,7 +4164,7 @@ SampQueryGroupGeneral(PSAM_DB_OBJECT GroupObject, } Status = SampGetObjectAttributeString(GroupObject, - L"Description", + L"AdminComment", &InfoBuffer->General.AdminComment); if (!NT_SUCCESS(Status)) { @@ -4179,7 +4179,10 @@ SampQueryGroupGeneral(PSAM_DB_OBJECT GroupObject, (PVOID)&FixedData, &Length); if (!NT_SUCCESS(Status)) + { + TRACE("Status 0x%08lx\n", Status); goto done; + } InfoBuffer->General.Attributes = FixedData.Attributes; @@ -4189,12 +4192,20 @@ SampQueryGroupGeneral(PSAM_DB_OBJECT GroupObject, NULL, &MembersLength); if (!NT_SUCCESS(Status) && Status != STATUS_OBJECT_NAME_NOT_FOUND) + { + TRACE("Status 0x%08lx\n", Status); goto done; + } if (Status == STATUS_OBJECT_NAME_NOT_FOUND) + { InfoBuffer->General.MemberCount = 0; + Status = STATUS_SUCCESS; + } else + { InfoBuffer->General.MemberCount = MembersLength / sizeof(ULONG); + } *Buffer = InfoBuffer; @@ -4279,7 +4290,10 @@ SampQueryGroupAttribute(PSAM_DB_OBJECT GroupObject, (PVOID)&FixedData, &Length); if (!NT_SUCCESS(Status)) + { + TRACE("Status 0x%08lx\n", Status); goto done; + } InfoBuffer->Attribute.Attributes = FixedData.Attributes; @@ -4312,7 +4326,7 @@ SampQueryGroupAdminComment(PSAM_DB_OBJECT GroupObject, return STATUS_INSUFFICIENT_RESOURCES; Status = SampGetObjectAttributeString(GroupObject, - L"Description", + L"AdminComment", &InfoBuffer->AdminComment.AdminComment); if (!NT_SUCCESS(Status)) { @@ -4540,7 +4554,7 @@ SamrSetInformationGroup(IN SAMPR_HANDLE GroupHandle, case GroupAdminCommentInformation: Status = SampSetObjectAttributeString(GroupObject, - L"Description", + L"AdminComment", &Buffer->AdminComment.AdminComment); break;
