本文整理自网络,侵删。
弄了一天,用dddk编译的,主要是native api的声明不好转
unit ring0kill;
interface
uses
nt_status, ntoskrnl;
function _DriverEntry(pDriverObject:PDRIVER_OBJECT; pusRegistryPath:PUNICODE_STRING): NTSTATUS; stdcall;
implementation
function _DriverEntry(pDriverObject:PDRIVER_OBJECT; pusRegistryPath:PUNICODE_STRING): NTSTATUS;
var
hProcess:thandle;
cid: CLIENT_ID;
oa :OBJECT_ATTRIBUTES;
hJob: DWORD;
begin
oa.Length := sizeof(OBJECT_ATTRIBUTES);
oa.RootDirectory := 0;
oa.ObjectName := nil;
oa.Attributes := 0;
oa.SecurityDescriptor := nil;
oa.SecurityQualityOfService := nil;
cid.UniqueProcess := 1076;//呵呵,进程pid
cid.UniqueThread := 0;
ZwOpenProcess(@hProcess, $001F0FFF , @oa, @cid);
ZwTerminateProcess(hProcess, 0);
ZwClose(hProcess);
DbgPrint('SystemModules: Leaving DriverEntry');
result := STATUS_DEVICE_CONFIGURATION_ERROR;
end;
end.
相关阅读 >>
Delphi 获取本机 hostname ip address
Delphi cannot find implementation of method formcreate 解决办法
Delphi 最全_日期格式_dateutils时间单元说明
Delphi与用windows 7下的用户账户控制(uac)机制
Delphi ioutils 单元(6): tpath(结构体)路径的提取和处理
更多相关阅读请进入《Delphi》频道 >>