- Status = IopOpenRegistryKeyEx(&hKey, NULL, &KeyName, KEY_QUERY_VALUE | KEY_SET_VALUE);
- if (!NT_SUCCESS(Status))
- goto cleanup;
- RtlInitUnicodeString(&ValueName, L"ParentIdPrefix");
- Status = ZwQueryValueKey(
- hKey, &ValueName,
- KeyValuePartialInformation, ParentIdPrefixInformation,
- KeyNameBufferLength, &KeyNameBufferLength);
- if (NT_SUCCESS(Status))
- {
- if (ParentIdPrefixInformation->Type != REG_SZ)
- Status = STATUS_UNSUCCESSFUL;
- else
- {
- KeyValue.Length = KeyValue.MaximumLength = (USHORT)ParentIdPrefixInformation->DataLength;
- KeyValue.Buffer = (PWSTR)ParentIdPrefixInformation->Data;
- }
- goto cleanup;
- }
- if (Status != STATUS_OBJECT_NAME_NOT_FOUND)
- {
- KeyValue.Length = KeyValue.MaximumLength = (USHORT)ParentIdPrefixInformation->DataLength;
- KeyValue.Buffer = (PWSTR)ParentIdPrefixInformation->Data;
- goto cleanup;
- }
+ Status = IopOpenRegistryKeyEx(&hKey, NULL, &KeyName, KEY_QUERY_VALUE | KEY_SET_VALUE);
+ if (!NT_SUCCESS(Status))
+ {
+ goto cleanup;
+ }
+ RtlInitUnicodeString(&ValueName, L"ParentIdPrefix");
+ Status = ZwQueryValueKey(hKey,
+ &ValueName,
+ KeyValuePartialInformation,
+ ParentIdPrefixInformation,
+ KeyNameBufferLength,
+ &KeyNameBufferLength);
+ if (NT_SUCCESS(Status))
+ {
+ if (ParentIdPrefixInformation->Type != REG_SZ)
+ {
+ Status = STATUS_UNSUCCESSFUL;
+ }
+ else
+ {
+ KeyValue.Length = KeyValue.MaximumLength = (USHORT)ParentIdPrefixInformation->DataLength;
+ KeyValue.Buffer = (PWSTR)ParentIdPrefixInformation->Data;
+ }
+ goto cleanup;
+ }
+ if (Status != STATUS_OBJECT_NAME_NOT_FOUND)
+ {
+ KeyValue.Length = KeyValue.MaximumLength = (USHORT)ParentIdPrefixInformation->DataLength;
+ KeyValue.Buffer = (PWSTR)ParentIdPrefixInformation->Data;
+ goto cleanup;
+ }