Hi,
I am facing problem to query/enumerate registry keys. I get return
status code as -1073741816 and the ResultLength as 0. I could not find
help about the status code= -1073741816. The same behavior happens for
the registry path of driver object (DriverEntry 2nd argument).
Am I wrong in some basic concept?
Please see my below mentioned code.
UNICODE_STRING acpiRegPath;
OBJECT_ATTRIBUTES oa;
HANDLE hkey = NULL;
PKEY_FULL_INFORMATION fip=NULL;
ULONG size,size1;
NTSTATUS status;
RtlInitUnicodeString(&acpiRegPath,L"\REGISTRY\MACHINE\HARDWARE\ACPI\
\RSDT");
InitializeObjectAttributes(&oa,&acpiRegPath,OBJ_CASE_INSENSITIVE ,NULL,
NULL);
status = ZwOpenKey(&hkey, KEY_READ , &oa);
if(NT_SUCCESS(status)){
status = ZwQueryKey(&hkey,KeyFullInformation
,NULL,0, &size); //Returns size=0, status= -1073741816
status = ZwEnumerateKey(&hkey,0,
KeyFullInformation, NULL,0,&size ); //Returns size=0, status=
-1073741816
if(size>0){
fip =
(PKEY_FULL_INFORMATION)ExAllocatePool(PagedPool, size);
RtlZeroMemory(bip,size);
status = ZwEnumerateKey(&hkey,0,
KeyFullInformation, fip,size,&size1 );
}
}
ZwClose(hkey);
Please guide.
Thanks,
Aparna