能力值:
( LV2,RANK:10 )
|
-
-
2 楼
//初始化objectAttributes
InitializeObjectAttributes(&objectAttributes,
RegistryPath,
OBJ_CASE_INSENSITIVE|OBJ_KERNEL_HANDLE,
NULL,
NULL );
//打开注册表
ntStatus = ZwOpenKey( &hRegister,
KEY_ALL_ACCESS,
&objectAttributes);
if (!NT_SUCCESS(ntStatus)) {
KdPrint(("Open register error\n"));
return;
}
|
能力值:
( LV9,RANK:260 )
|
-
-
3 楼
写了个例子,楼主对比一下吧:
#include <ntddk.h>
VOID OnUnload(IN PDRIVER_OBJECT DriverObject){
return;
}
NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject,PUNICODE_STRING RegistryPath){
OBJECT_ATTRIBUTES oa;
UNICODE_STRING path;
HANDLE hReg;
NTSTATUS status;
DriverObject->DriverUnload=OnUnload;
RtlInitUnicodeString(&path,L"\\Registry\\Machine\\Software\\Classes");
InitializeObjectAttributes(
&oa,&path,
OBJ_CASE_INSENSITIVE|OBJ_KERNEL_HANDLE,
NULL,NULL
);
status = ZwOpenKey( &hReg,KEY_ALL_ACCESS,&oa);
if (!NT_SUCCESS(status)){
DbgPrint("error");
}else{
DbgPrint("success");
ZwClose(hReg);
}
return status;
}
|
能力值:
( LV9,RANK:610 )
|
-
-
4 楼
楼主不懂得如何提问~
|
|
|