mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
- Fix wrong access-rights when referencing the object (fixes NtEnumerateKey() API).
- Add DPRINTs for problems with objects referencing. svn path=/trunk/; revision=26880
This commit is contained in:
parent
2691c6bc92
commit
03356a723c
1 changed files with 38 additions and 10 deletions
|
@ -726,7 +726,11 @@ NtDeleteKey(IN HANDLE KeyHandle)
|
||||||
ExGetPreviousMode(),
|
ExGetPreviousMode(),
|
||||||
(PVOID *)&KeyObject,
|
(PVOID *)&KeyObject,
|
||||||
NULL);
|
NULL);
|
||||||
if (!NT_SUCCESS(Status)) return Status;
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT("ObReferenceObjectByHandle() failed with Status = 0x%08X\n");
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
/* Setup the callback */
|
/* Setup the callback */
|
||||||
PostOperationInfo.Object = (PVOID)KeyObject;
|
PostOperationInfo.Object = (PVOID)KeyObject;
|
||||||
|
@ -775,14 +779,16 @@ NtEnumerateKey(IN HANDLE KeyHandle,
|
||||||
|
|
||||||
/* Verify that the handle is valid and is a registry key */
|
/* Verify that the handle is valid and is a registry key */
|
||||||
Status = ObReferenceObjectByHandle(KeyHandle,
|
Status = ObReferenceObjectByHandle(KeyHandle,
|
||||||
(KeyInformationClass !=
|
KEY_ENUMERATE_SUB_KEYS,
|
||||||
KeyNameInformation) ?
|
|
||||||
KEY_QUERY_VALUE : 0,
|
|
||||||
CmpKeyObjectType,
|
CmpKeyObjectType,
|
||||||
ExGetPreviousMode(),
|
ExGetPreviousMode(),
|
||||||
(PVOID *)&KeyObject,
|
(PVOID *)&KeyObject,
|
||||||
NULL);
|
NULL);
|
||||||
if (!NT_SUCCESS(Status)) return Status;
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT("ObReferenceObjectByHandle() failed with Status = 0x%08X\n");
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
/* Setup the callback */
|
/* Setup the callback */
|
||||||
PostOperationInfo.Object = (PVOID)KeyObject;
|
PostOperationInfo.Object = (PVOID)KeyObject;
|
||||||
|
@ -839,7 +845,11 @@ NtEnumerateValueKey(IN HANDLE KeyHandle,
|
||||||
ExGetPreviousMode(),
|
ExGetPreviousMode(),
|
||||||
(PVOID *)&KeyObject,
|
(PVOID *)&KeyObject,
|
||||||
NULL);
|
NULL);
|
||||||
if (!NT_SUCCESS(Status)) return Status;
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT("ObReferenceObjectByHandle() failed with Status = 0x%08X\n");
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
/* Setup the callback */
|
/* Setup the callback */
|
||||||
PostOperationInfo.Object = (PVOID)KeyObject;
|
PostOperationInfo.Object = (PVOID)KeyObject;
|
||||||
|
@ -898,7 +908,11 @@ NtQueryKey(IN HANDLE KeyHandle,
|
||||||
ExGetPreviousMode(),
|
ExGetPreviousMode(),
|
||||||
(PVOID *)&KeyObject,
|
(PVOID *)&KeyObject,
|
||||||
NULL);
|
NULL);
|
||||||
if (!NT_SUCCESS(Status)) return Status;
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT("ObReferenceObjectByHandle() failed with Status = 0x%08X\n");
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
/* Setup the callback */
|
/* Setup the callback */
|
||||||
PostOperationInfo.Object = (PVOID)KeyObject;
|
PostOperationInfo.Object = (PVOID)KeyObject;
|
||||||
|
@ -954,7 +968,11 @@ NtQueryValueKey(IN HANDLE KeyHandle,
|
||||||
ExGetPreviousMode(),
|
ExGetPreviousMode(),
|
||||||
(PVOID *)&KeyObject,
|
(PVOID *)&KeyObject,
|
||||||
NULL);
|
NULL);
|
||||||
if (!NT_SUCCESS(Status)) return Status;
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT("ObReferenceObjectByHandle() failed with Status = 0x%08X\n");
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
/* Setup the callback */
|
/* Setup the callback */
|
||||||
PostOperationInfo.Object = (PVOID)KeyObject;
|
PostOperationInfo.Object = (PVOID)KeyObject;
|
||||||
|
@ -981,6 +999,8 @@ NtQueryValueKey(IN HANDLE KeyHandle,
|
||||||
CmiCallRegisteredCallbacks(RegNtPostQueryValueKey, &PostOperationInfo);
|
CmiCallRegisteredCallbacks(RegNtPostQueryValueKey, &PostOperationInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DPRINT("NtQueryValueKey() returning 0x%08X\n", Status);
|
||||||
|
|
||||||
/* Dereference and return status */
|
/* Dereference and return status */
|
||||||
ObDereferenceObject(KeyObject);
|
ObDereferenceObject(KeyObject);
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -1011,7 +1031,11 @@ NtSetValueKey(IN HANDLE KeyHandle,
|
||||||
ExGetPreviousMode(),
|
ExGetPreviousMode(),
|
||||||
(PVOID *)&KeyObject,
|
(PVOID *)&KeyObject,
|
||||||
NULL);
|
NULL);
|
||||||
if (!NT_SUCCESS(Status)) return(Status);
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT("ObReferenceObjectByHandle() failed with Status = 0x%08X\n");
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
/* Setup callback */
|
/* Setup callback */
|
||||||
PostOperationInfo.Object = (PVOID)KeyObject;
|
PostOperationInfo.Object = (PVOID)KeyObject;
|
||||||
|
@ -1063,7 +1087,11 @@ NtDeleteValueKey(IN HANDLE KeyHandle,
|
||||||
PreviousMode,
|
PreviousMode,
|
||||||
(PVOID *)&KeyObject,
|
(PVOID *)&KeyObject,
|
||||||
NULL);
|
NULL);
|
||||||
if (!NT_SUCCESS(Status)) return Status;
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT("ObReferenceObjectByHandle() failed with Status = 0x%08X\n");
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
/* Do the callback */
|
/* Do the callback */
|
||||||
DeleteValueKeyInfo.Object = (PVOID)KeyObject;
|
DeleteValueKeyInfo.Object = (PVOID)KeyObject;
|
||||||
|
|
Loading…
Reference in a new issue