mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:25:39 +00:00
- Implement CmpQueryKeyName as a wrapper around CmpConstructName helper function (which is stubbed now).
svn path=/trunk/; revision=35705
This commit is contained in:
parent
0a12af7eab
commit
ac962ebea4
3 changed files with 82 additions and 3 deletions
|
@ -886,6 +886,14 @@ CmpCreateKeyControlBlock(IN PHHIVE Hive,
|
||||||
return Kcb;
|
return Kcb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PUNICODE_STRING
|
||||||
|
NTAPI
|
||||||
|
CmpConstructName(IN PCM_KEY_CONTROL_BLOCK Kcb)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
EnlistKeyBodyWithKCB(IN PCM_KEY_BODY KeyBody,
|
EnlistKeyBodyWithKCB(IN PCM_KEY_BODY KeyBody,
|
||||||
|
|
|
@ -119,9 +119,74 @@ CmpQueryKeyName(IN PVOID ObjectBody,
|
||||||
OUT PULONG ReturnLength,
|
OUT PULONG ReturnLength,
|
||||||
IN KPROCESSOR_MODE PreviousMode)
|
IN KPROCESSOR_MODE PreviousMode)
|
||||||
{
|
{
|
||||||
DPRINT1("CmpQueryKeyName() called\n");
|
PUNICODE_STRING KeyName;
|
||||||
ASSERT(FALSE);
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
return STATUS_SUCCESS;
|
PCM_KEY_BODY KeyBody = (PCM_KEY_BODY)ObjectBody;
|
||||||
|
PCM_KEY_CONTROL_BLOCK Kcb = KeyBody->KeyControlBlock;
|
||||||
|
|
||||||
|
/* Acquire hive lock */
|
||||||
|
CmpLockRegistry();
|
||||||
|
|
||||||
|
/* Lock KCB shared */
|
||||||
|
CmpAcquireKcbLockShared(Kcb);
|
||||||
|
|
||||||
|
/* Check if it's a deleted block */
|
||||||
|
if (Kcb->Delete)
|
||||||
|
{
|
||||||
|
/* Release the locks */
|
||||||
|
CmpReleaseKcbLock(Kcb);
|
||||||
|
CmpUnlockRegistry();
|
||||||
|
|
||||||
|
/* Let the caller know it's deleted */
|
||||||
|
return STATUS_KEY_DELETED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get the name */
|
||||||
|
KeyName = CmpConstructName(Kcb);
|
||||||
|
|
||||||
|
/* Release the locks */
|
||||||
|
CmpReleaseKcbLock(Kcb);
|
||||||
|
CmpUnlockRegistry();
|
||||||
|
|
||||||
|
/* Check if we got the name */
|
||||||
|
if (!KeyName) return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
|
||||||
|
/* Set the returned length */
|
||||||
|
*ReturnLength = KeyName->Length + sizeof(OBJECT_NAME_INFORMATION) + sizeof(WCHAR);
|
||||||
|
|
||||||
|
/* Check if it fits into the provided buffer */
|
||||||
|
if ((Length < sizeof(OBJECT_NAME_INFORMATION)) ||
|
||||||
|
(Length < (*ReturnLength - sizeof(OBJECT_NAME_INFORMATION))))
|
||||||
|
{
|
||||||
|
/* Free the buffer allocated by CmpConstructName */
|
||||||
|
ExFreePool(KeyName->Buffer);
|
||||||
|
|
||||||
|
/* Return buffer length failure */
|
||||||
|
return STATUS_INFO_LENGTH_MISMATCH;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Fill in the result */
|
||||||
|
_SEH_TRY
|
||||||
|
{
|
||||||
|
/* Return data to user */
|
||||||
|
ObjectNameInfo->Name.Buffer = (PWCHAR)(ObjectNameInfo + 1);
|
||||||
|
ObjectNameInfo->Name.MaximumLength = KeyName->Length;
|
||||||
|
ObjectNameInfo->Name.Length = KeyName->Length;
|
||||||
|
|
||||||
|
/* Copy string content*/
|
||||||
|
RtlCopyMemory(ObjectNameInfo->Name.Buffer, KeyName->Buffer, *ReturnLength);
|
||||||
|
}
|
||||||
|
_SEH_HANDLE
|
||||||
|
{
|
||||||
|
/* Get the status */
|
||||||
|
Status = _SEH_GetExceptionCode();
|
||||||
|
}
|
||||||
|
_SEH_END;
|
||||||
|
|
||||||
|
/* Free the buffer allocated by CmpConstructName */
|
||||||
|
ExFreePool(KeyName->Buffer);
|
||||||
|
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
|
|
@ -899,6 +899,12 @@ CmpCleanUpSubKeyInfo(
|
||||||
IN PCM_KEY_CONTROL_BLOCK Kcb
|
IN PCM_KEY_CONTROL_BLOCK Kcb
|
||||||
);
|
);
|
||||||
|
|
||||||
|
PUNICODE_STRING
|
||||||
|
NTAPI
|
||||||
|
CmpConstructName(
|
||||||
|
IN PCM_KEY_CONTROL_BLOCK Kcb
|
||||||
|
);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
CmpDereferenceKeyControlBlockWithLock(
|
CmpDereferenceKeyControlBlockWithLock(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue