mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 23:03:00 +00:00
[SAMSRV]
- Implement SampGetObjectAttributeString to retrieve the size of a string, allocate a buffer and retrieve the string from the registry. - Use SampGetObjectAttributeString to retrieve string attributes in SamrQueryInformationXxx functions. - Add most missing cases to SamrQueryInformationUser. - Fix a type mismatch in ntsam.h. svn path=/trunk/; revision=56850
This commit is contained in:
parent
c4dbf5a011
commit
87f0a30cfe
5 changed files with 862 additions and 582 deletions
|
@ -705,5 +705,59 @@ SampGetObjectAttribute(PSAM_DB_OBJECT DbObject,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
SampGetObjectAttributeString(PSAM_DB_OBJECT DbObject,
|
||||||
|
LPWSTR AttributeName,
|
||||||
|
RPC_UNICODE_STRING *String)
|
||||||
|
{
|
||||||
|
ULONG Length = 0;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
Status = SampGetObjectAttribute(DbObject,
|
||||||
|
AttributeName,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&Length);
|
||||||
|
if (!NT_SUCCESS(Status) && Status != STATUS_BUFFER_OVERFLOW)
|
||||||
|
{
|
||||||
|
TRACE("Status 0x%08lx\n", Status);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
String->Length = Length - sizeof(WCHAR);
|
||||||
|
String->MaximumLength = Length;
|
||||||
|
String->Buffer = midl_user_allocate(Length);
|
||||||
|
if (String->Buffer == NULL)
|
||||||
|
{
|
||||||
|
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
TRACE("Length: %lu\n", Length);
|
||||||
|
Status = SampGetObjectAttribute(DbObject,
|
||||||
|
AttributeName,
|
||||||
|
NULL,
|
||||||
|
(PVOID)String->Buffer,
|
||||||
|
&Length);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
TRACE("Status 0x%08lx\n", Status);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
done:
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
if (String->Buffer != NULL)
|
||||||
|
{
|
||||||
|
midl_user_free(String->Buffer);
|
||||||
|
String->Buffer = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -149,6 +149,11 @@ SampGetObjectAttribute(PSAM_DB_OBJECT DbObject,
|
||||||
LPVOID AttributeData,
|
LPVOID AttributeData,
|
||||||
PULONG AttributeSize);
|
PULONG AttributeSize);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
SampGetObjectAttributeString(PSAM_DB_OBJECT DbObject,
|
||||||
|
LPWSTR AttributeName,
|
||||||
|
RPC_UNICODE_STRING *String);
|
||||||
|
|
||||||
/* registry.h */
|
/* registry.h */
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
SampRegCloseKey(IN HANDLE KeyHandle);
|
SampRegCloseKey(IN HANDLE KeyHandle);
|
||||||
|
|
|
@ -185,22 +185,22 @@ typedef enum _ALIAS_INFORMATION_CLASS
|
||||||
AliasAdminCommentInformation
|
AliasAdminCommentInformation
|
||||||
} ALIAS_INFORMATION_CLASS, *PALIAS_INFORMATION_CLASS;
|
} ALIAS_INFORMATION_CLASS, *PALIAS_INFORMATION_CLASS;
|
||||||
|
|
||||||
typedef struct _SAMPR_ALIAS_GENERAL_INFORMATION
|
typedef struct _ALIAS_GENERAL_INFORMATION
|
||||||
{
|
{
|
||||||
UNICODE_STRING Name;
|
UNICODE_STRING Name;
|
||||||
ULONG MemberCount;
|
ULONG MemberCount;
|
||||||
UNICODE_STRING AdminComment;
|
UNICODE_STRING AdminComment;
|
||||||
} SAMPR_ALIAS_GENERAL_INFORMATION, *PSAMPR_ALIAS_GENERAL_INFORMATION;
|
} ALIAS_GENERAL_INFORMATION, *PALIAS_GENERAL_INFORMATION;
|
||||||
|
|
||||||
typedef struct _SAMPR_ALIAS_NAME_INFORMATION
|
typedef struct _ALIAS_NAME_INFORMATION
|
||||||
{
|
{
|
||||||
UNICODE_STRING Name;
|
UNICODE_STRING Name;
|
||||||
} SAMPR_ALIAS_NAME_INFORMATION, *PSAMPR_ALIAS_NAME_INFORMATION;
|
} ALIAS_NAME_INFORMATION, *PALIAS_NAME_INFORMATION;
|
||||||
|
|
||||||
typedef struct _SAMPR_ALIAS_ADM_COMMENT_INFORMATION
|
typedef struct _ALIAS_ADM_COMMENT_INFORMATION
|
||||||
{
|
{
|
||||||
UNICODE_STRING AdminComment;
|
UNICODE_STRING AdminComment;
|
||||||
} SAMPR_ALIAS_ADM_COMMENT_INFORMATION, *PSAMPR_ALIAS_ADM_COMMENT_INFORMATION;
|
} ALIAS_ADM_COMMENT_INFORMATION, *PALIAS_ADM_COMMENT_INFORMATION;
|
||||||
|
|
||||||
|
|
||||||
typedef enum _DOMAIN_INFORMATION_CLASS
|
typedef enum _DOMAIN_INFORMATION_CLASS
|
||||||
|
|
|
@ -400,7 +400,6 @@ typedef [switch_type(GROUP_INFORMATION_CLASS)] union _SAMPR_GROUP_INFO_BUFFER
|
||||||
[case(GroupReplicationInformation)] SAMPR_GROUP_GENERAL_INFORMATION DoNotUse;
|
[case(GroupReplicationInformation)] SAMPR_GROUP_GENERAL_INFORMATION DoNotUse;
|
||||||
} SAMPR_GROUP_INFO_BUFFER, *PSAMPR_GROUP_INFO_BUFFER;
|
} SAMPR_GROUP_INFO_BUFFER, *PSAMPR_GROUP_INFO_BUFFER;
|
||||||
|
|
||||||
cpp_quote("#ifndef _NTSAM_")
|
|
||||||
typedef struct _SAMPR_ALIAS_GENERAL_INFORMATION
|
typedef struct _SAMPR_ALIAS_GENERAL_INFORMATION
|
||||||
{
|
{
|
||||||
RPC_UNICODE_STRING Name;
|
RPC_UNICODE_STRING Name;
|
||||||
|
@ -418,6 +417,7 @@ typedef struct _SAMPR_ALIAS_ADM_COMMENT_INFORMATION
|
||||||
RPC_UNICODE_STRING AdminComment;
|
RPC_UNICODE_STRING AdminComment;
|
||||||
} SAMPR_ALIAS_ADM_COMMENT_INFORMATION, *PSAMPR_ALIAS_ADM_COMMENT_INFORMATION;
|
} SAMPR_ALIAS_ADM_COMMENT_INFORMATION, *PSAMPR_ALIAS_ADM_COMMENT_INFORMATION;
|
||||||
|
|
||||||
|
cpp_quote("#ifndef _NTSAM_")
|
||||||
typedef enum _ALIAS_INFORMATION_CLASS
|
typedef enum _ALIAS_INFORMATION_CLASS
|
||||||
{
|
{
|
||||||
AliasGeneralInformation = 1,
|
AliasGeneralInformation = 1,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue