32 L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Wdf\\Kmdf\\%s\\Versions",
37 __DBGPRINT((
"ERROR: RtlUnicodeStringPrintf failed with Status 0x%x\n",
status));
48 __DBGPRINT((
"ERROR: ZwOpenKey (%wZ) failed with Status 0x%x\n", &
string,
status));
56 __DBGPRINT((
"ERROR: ConvertUlongToWString failed with Status 0x%x\n",
status));
65 __DBGPRINT((
"ERROR: ZwOpenKey (%wZ) failed with Status 0x%x\n",
string,
status));
93 static const SIZE_T regPathLength =
sizeof(
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Wdf01000") -
sizeof(
WCHAR);
105 __DBGPRINT((
"ERROR: ExAllocatePoolWithTag failed with status 0x%x\n",
status));
113 L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Wdf%02d000",
123 __DBGPRINT((
"ERROR: RtlUnicodeStringCopyString failed with Status 0x%x\n",
status));
154 __DBGPRINT((
"ERROR: GetVersionRegistryHandle failed with Status 0x%x\n",
status));
177 __DBGPRINT((
"ERROR: GetVersionServicePath failed with Status 0x%x\n",
status));
185 if (handleRegKey !=
NULL)
243 keyValue.
Data[0] = 0;
277 *KeyValPartialInfo =
NULL;
291 status = RtlULongAdd(resultLength, 0xCu, &resultLength);
301 if (pKeyInfo ==
NULL)
317 *KeyValPartialInfo = pKeyInfo;
346 CONST WCHAR regPath[] =
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\%wZ";
348 if (KeyValueInformation->Type !=
REG_SZ &&
356 if (KeyValueInformation->DataLength == 0 ||
357 KeyValueInformation->DataLength > 0xFFFF)
364 name.Buffer = (
PWCH)KeyValueInformation->Data;
365 name.Length = (
USHORT)KeyValueInformation->DataLength;
366 name.MaximumLength = (
USHORT)KeyValueInformation->DataLength;
368 lastChar = (
PWCHAR)KeyValueInformation->Data + KeyValueInformation->DataLength /
sizeof(
WCHAR);
369 if (KeyValueInformation->DataLength >=
sizeof(
WCHAR) && *lastChar ==
UNICODE_NULL)
392 __DBGPRINT((
"ERROR: ExAllocatePoolWithTag failed with Status 0x%x\n",
status));
#define DECLARE_UNICODE_STRING_SIZE(_var, _size)
#define STATUS_OBJECT_TYPE_MISMATCH
#define NT_SUCCESS(StatCode)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define OBJ_KERNEL_HANDLE
#define OBJ_CASE_INSENSITIVE
_In_ PCUNICODE_STRING ServicePath
#define ExFreePoolWithTag(_P, _T)
FORCEINLINE PVOID ExAllocatePoolZero(ULONG PoolType, SIZE_T NumberOfBytes, ULONG Tag)
#define InitializeObjectAttributes(p, n, a, r, s)
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
@ KeyValuePartialInformation
NTSYSAPI NTSTATUS NTAPI RtlIntegerToUnicodeString(ULONG Value, ULONG Base, PUNICODE_STRING String)
#define STATUS_INVALID_BUFFER_SIZE
NTSTRSAFEVAPI RtlUnicodeStringPrintf(_In_ PUNICODE_STRING DestinationString, _In_ NTSTRSAFE_PCWSTR pszFormat,...)
NTSTATUS FxLdrQueryData(_In_ HANDLE KeyHandle, _In_ PUNICODE_STRING ValueName, _In_ ULONG Tag, _Out_ PKEY_VALUE_PARTIAL_INFORMATION *KeyValPartialInfo)
NTSTATUS NTAPI GetDefaultServiceName(_In_ PWDF_BIND_INFO BindInfo, _Out_ PUNICODE_STRING RegistryPath)
Create default service path from bind info.
NTSTATUS BuildServicePath(_In_ PKEY_VALUE_PARTIAL_INFORMATION KeyValueInformation, _In_ PUNICODE_STRING ServicePath)
NTSTATUS GetVersionServicePath(_In_ PWDF_BIND_INFO BindInfo, _Out_ PUNICODE_STRING ServicePath)
Get service path from bind info and registry.
NTSTATUS NTAPI GetVersionRegistryHandle(_In_ PWDF_BIND_INFO BindInfo, _Out_ PHANDLE HandleRegKey)
Open framework version registry key.
BOOLEAN ServiceCheckBootStart(_In_ PUNICODE_STRING Service)
NTSTATUS FxLdrQueryUlong(_In_ HANDLE KeyHandle, _In_ PUNICODE_STRING ValueName, _Out_ PULONG Value)
#define STATUS_BUFFER_TOO_SMALL
#define RTL_CONSTANT_STRING(s)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
#define STATUS_OBJECT_NAME_NOT_FOUND
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value