delphi驱动结束进程


本文整理自网络,侵删。

 弄了一天,用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 实现窗体倒计时进度条显示

Delphi实现类似android锁屏的密码锁控件

Delphi 获取当前系统语言环境(en,fr,ja等)

Delphi 在ie上增添一个按钮

Delphi cef4 忽略不安全网站

Delphi中showmodal 和 show 的区别

Delphi findwindow的一些用法

Delphi 文字的高度与宽度: canvas.textextent

Delphi windows api判断文件共享锁定状态

Delphi 过滤字符串特殊符号的函数

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...