mirror of
https://github.com/reactos/reactos.git
synced 2024-09-30 22:47:28 +00:00
[NTOS:CM] Minor fixes.
- Validate the information class parameter in NtQueryValueKey(). - Call the post-callback in NtSetValueKey() only if the callback has been registered and the CmSetValueKey() call is executed.
This commit is contained in:
parent
5322969186
commit
29b2fdcc4d
|
@ -533,10 +533,23 @@ NtQueryValueKey(IN HANDLE KeyHandle,
|
||||||
REG_QUERY_VALUE_KEY_INFORMATION QueryValueKeyInfo;
|
REG_QUERY_VALUE_KEY_INFORMATION QueryValueKeyInfo;
|
||||||
REG_POST_OPERATION_INFORMATION PostOperationInfo;
|
REG_POST_OPERATION_INFORMATION PostOperationInfo;
|
||||||
UNICODE_STRING ValueNameCopy = *ValueName;
|
UNICODE_STRING ValueNameCopy = *ValueName;
|
||||||
|
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
DPRINT("NtQueryValueKey() KH 0x%p, VN '%wZ', KVIC %d, Length %lu\n",
|
DPRINT("NtQueryValueKey() KH 0x%p, VN '%wZ', KVIC %d, Length %lu\n",
|
||||||
KeyHandle, ValueName, KeyValueInformationClass, Length);
|
KeyHandle, ValueName, KeyValueInformationClass, Length);
|
||||||
|
|
||||||
|
/* Reject classes we don't know about */
|
||||||
|
if ((KeyValueInformationClass != KeyValueBasicInformation) &&
|
||||||
|
(KeyValueInformationClass != KeyValueFullInformation) &&
|
||||||
|
(KeyValueInformationClass != KeyValuePartialInformation) &&
|
||||||
|
(KeyValueInformationClass != KeyValueFullInformationAlign64) &&
|
||||||
|
(KeyValueInformationClass != KeyValuePartialInformationAlign64))
|
||||||
|
{
|
||||||
|
/* Fail */
|
||||||
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
/* 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,
|
||||||
KEY_QUERY_VALUE,
|
KEY_QUERY_VALUE,
|
||||||
|
@ -723,11 +736,11 @@ NtSetValueKey(IN HANDLE KeyHandle,
|
||||||
Type,
|
Type,
|
||||||
Data,
|
Data,
|
||||||
DataSize);
|
DataSize);
|
||||||
}
|
|
||||||
|
|
||||||
/* Do the post-callback */
|
/* Do the post-callback */
|
||||||
PostOperationInfo.Status = Status;
|
PostOperationInfo.Status = Status;
|
||||||
CmiCallRegisteredCallbacks(RegNtPostSetValueKey, &PostOperationInfo);
|
CmiCallRegisteredCallbacks(RegNtPostSetValueKey, &PostOperationInfo);
|
||||||
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
/* Dereference and return status */
|
/* Dereference and return status */
|
||||||
|
|
Loading…
Reference in a new issue