/* Initialize the attributes and open the key */
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
- OBJ_CASE_INSENSITIVE,
+ OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
UserKey,
NULL);
Status = ZwOpenKey(&KeyHandle, KEY_QUERY_VALUE,&ObjectAttributes);
/* Fail */
Status = STATUS_UNSUCCESSFUL;
}
-
- /* Close the key */
- ZwClose(KeyHandle);
}
+
+ /* Close the key */
+ ZwClose(KeyHandle);
}
/* Close the user key and return */