From b68216e503cc52f81ce9cc641b963f683745e91b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Bi=C8=99oc?= Date: Thu, 25 Mar 2021 13:05:49 +0100 Subject: [PATCH] [NTOS:SE] Annotate the function parameters of SepRegQueryHelper with SAL And add a documentation comment header --- ntoskrnl/se/srm.c | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/ntoskrnl/se/srm.c b/ntoskrnl/se/srm.c index 6517d997c1d..468b724f2da 100644 --- a/ntoskrnl/se/srm.c +++ b/ntoskrnl/se/srm.c @@ -74,14 +74,38 @@ PSEP_LOGON_SESSION_TERMINATED_NOTIFICATION SepLogonNotifications = NULL; /* PRIVATE FUNCTIONS **********************************************************/ +/** + * @brief + * A private registry helper that returns the desired value + * data based on the specifics requested by the caller. + * + * @param[in] KeyName + * Name of the key. + * + * @param[in] ValueName + * Name of the registry value. + * + * @param[in] ValueType + * The type of the registry value. + * + * @param[in] DataLength + * The data length, in bytes, representing the size of the registry value. + * + * @param[out] ValueData + * The requested value data provided by the function. + * + * @return + * Returns STATUS_SUCCESS if the operations have completed successfully, + * otherwise a failure NTSTATUS code is returned. + */ NTSTATUS NTAPI SepRegQueryHelper( - PCWSTR KeyName, - PCWSTR ValueName, - ULONG ValueType, - ULONG DataLength, - PVOID ValueData) + _In_ PCWSTR KeyName, + _In_ PCWSTR ValueName, + _In_ ULONG ValueType, + _In_ ULONG DataLength, + _Out_ PVOID ValueData) { UNICODE_STRING ValueNameString; UNICODE_STRING KeyNameString; @@ -128,7 +152,6 @@ SepRegQueryHelper( goto Cleanup; } - if (ValueType == REG_BINARY) { RtlCopyMemory(ValueData, KeyValueInformation.Partial.Data, DataLength);