当前位置: 首页 > news >正文

宜春制作网站公司哪家好怎么做网站广告

宜春制作网站公司哪家好,怎么做网站广告,aspx怎么做网站,网站开发毕设文章目录 概述代码参考资料 概述 其编写过程大体与键盘过滤驱动相似,只需要切换一下附加的目标设备以及创建的设备类型等。但在该操作后依然无法捕获到Vmware创建的win7操作系统的鼠标irp信息,于是通过在获取鼠标驱动,遍历其所有的设备进而附…

文章目录

  • 概述
  • 代码
  • 参考资料

概述

其编写过程大体与键盘过滤驱动相似,只需要切换一下附加的目标设备以及创建的设备类型等。但在该操作后依然无法捕获到Vmware创建的win7操作系统的鼠标irp信息,于是通过在获取鼠标驱动,遍历其所有的设备进而附加,这样便可以获取到鼠标的irp信息。

代码

#include<ntifs.h>typedef struct
{PDEVICE_OBJECT LowerKbdDevice;
}DEVICE_EXTENTION,*PDEVICE_EXTENTION;extern POBJECT_TYPE* IoDriverObjectType;typedef struct _MOUSE_INPUT_DATA {USHORT UnitId;USHORT Flags;union {ULONG Buttons;struct {USHORT ButtonFlags;USHORT ButtonData;};};ULONG  RawButtons;LONG   LastX;LONG   LastY;ULONG  ExtraInformation;
} MOUSE_INPUT_DATA, * PMOUSE_INPUT_DATA;ULONG pendingkey = 0;NTSTATUS NTAPI ObReferenceObjectByName(PUNICODE_STRING ObjectName,ULONG Attributes,PACCESS_STATE AccessState,ACCESS_MASK DesiredAccess,POBJECT_TYPE ObjectType,KPROCESSOR_MODE AccessMode,PVOID ParseContext OPTIONAL,PVOID* Object);VOID DriverUnload(PDRIVER_OBJECT DriverObject)
{LARGE_INTEGER interval = { 0 };PDEVICE_OBJECT DeviceObject = DriverObject->DeviceObject;interval.QuadPart = -10 * 1000 * 1000;while (DeviceObject){IoDetachDevice(((PDEVICE_EXTENTION)DeviceObject->DeviceExtension)->LowerKbdDevice);DeviceObject = DeviceObject->NextDevice;}//判断是否还有未处理的IRPwhile (pendingkey){KeDelayExecutionThread(KernelMode, FALSE, &interval);}DeviceObject = DriverObject->DeviceObject;while (DeviceObject){IoDeleteDevice(DeviceObject);DeviceObject = DeviceObject->NextDevice;}KdPrint(("驱动卸载结束!\n"));
}NTSTATUS ReadComplete(PDEVICE_OBJECT DeviceObject, PIRP irp, PVOID Context)
{PMOUSE_INPUT_DATA KeyBuffer = (PMOUSE_INPUT_DATA)irp->AssociatedIrp.SystemBuffer;int structnum = irp->IoStatus.Information / sizeof(MOUSE_INPUT_DATA);if (irp->IoStatus.Status == STATUS_SUCCESS){for (int i = 0; i < structnum; i++){KdPrint(("ButtonFlags = %x\n", KeyBuffer->ButtonFlags));}}//处理完成需要将标志位设置,以声明以完成此irp的返回处理if (irp->PendingReturned){IoMarkIrpPending(irp);}pendingkey--;return irp->IoStatus.Status;
}NTSTATUS DispatchPass(PDEVICE_OBJECT pDeviceObject,PIRP irp)
{IoCopyCurrentIrpStackLocationToNext(irp);return IoCallDriver(((PDEVICE_EXTENTION)pDeviceObject->DeviceExtension)->LowerKbdDevice, irp);
}NTSTATUS DispatchRead(PDEVICE_OBJECT pDeviceObject, PIRP irp)
{IoCopyCurrentIrpStackLocationToNext(irp);IoSetCompletionRoutine(irp,ReadComplete,NULL,TRUE,TRUE,TRUE,TRUE);pendingkey++;return IoCallDriver(((PDEVICE_EXTENTION)pDeviceObject->DeviceExtension)->LowerKbdDevice, irp);
}NTSTATUS MyAttachDevice(PDRIVER_OBJECT pDriverObject)
{UNICODE_STRING kbdName = RTL_CONSTANT_STRING(L"\\Driver\\MouClass");PDRIVER_OBJECT TargetDriverObject = NULL;PDEVICE_OBJECT CurrentDeviceObject = NULL;PDEVICE_OBJECT myKbdDevice = NULL;PDEVICE_OBJECT lowDevice = NULL;NTSTATUS status = ObReferenceObjectByName(&kbdName,OBJ_CASE_INSENSITIVE,NULL,0,*IoDriverObjectType,KernelMode,NULL,&TargetDriverObject);if (!NT_SUCCESS(status)){DbgPrint("Open Mouse Driver Failed\n");return status;}else{// 解引用ObDereferenceObject(TargetDriverObject);}CurrentDeviceObject = TargetDriverObject->DeviceObject;//循环附加到目标驱动上的所有设备栈上while (CurrentDeviceObject){NTSTATUS status = IoCreateDevice(pDriverObject, sizeof(DEVICE_EXTENTION), NULL, 0, FILE_DEVICE_MOUSE, FALSE, &myKbdDevice);if (!NT_SUCCESS(status)){myKbdDevice = CurrentDeviceObject = NULL;return status;}RtlZeroMemory(myKbdDevice->DeviceExtension, sizeof(DEVICE_EXTENTION));lowDevice = IoAttachDeviceToDeviceStack(myKbdDevice, CurrentDeviceObject);if (!lowDevice){IoDeleteDevice(myKbdDevice);myKbdDevice = NULL;return status;}((PDEVICE_EXTENTION)myKbdDevice->DeviceExtension)->LowerKbdDevice = lowDevice;myKbdDevice->Flags |= DO_BUFFERED_IO;myKbdDevice->Flags &= ~DO_DEVICE_INITIALIZING;CurrentDeviceObject = CurrentDeviceObject->NextDevice;}return STATUS_SUCCESS;
}NTSTATUS DriverEntry(PDRIVER_OBJECT pDriverObject, PUNICODE_STRING pRegistryPath)
{int i = 0;NTSTATUS Status = STATUS_SUCCESS;for (i = 0; i < IRP_MJ_MAXIMUM_FUNCTION; i++){pDriverObject->MajorFunction[i] = DispatchPass;}pDriverObject->MajorFunction[IRP_MJ_READ] = DispatchRead;Status = MyAttachDevice(pDriverObject);if (!NT_SUCCESS(Status)){KdPrint(("AttachDevice ERROR!\n"));}else{KdPrint(("AttachDevice SUCCESS!\n"));}pDriverObject->DriverUnload = DriverUnload;return Status;
}

参考资料

Revised Mouse and Keyboard Filter Driver


文章转载自:
http://zoaea.rzgp.cn
http://shelfful.rzgp.cn
http://sophisticated.rzgp.cn
http://conflate.rzgp.cn
http://cessation.rzgp.cn
http://unnilpentium.rzgp.cn
http://chanterelle.rzgp.cn
http://alveoloplasty.rzgp.cn
http://grubstake.rzgp.cn
http://cogency.rzgp.cn
http://fishline.rzgp.cn
http://clarionet.rzgp.cn
http://primarily.rzgp.cn
http://ctrl.rzgp.cn
http://becripple.rzgp.cn
http://boating.rzgp.cn
http://cebu.rzgp.cn
http://speakerphone.rzgp.cn
http://adman.rzgp.cn
http://hypsometrically.rzgp.cn
http://reorganization.rzgp.cn
http://caravansarai.rzgp.cn
http://filibuster.rzgp.cn
http://matzoon.rzgp.cn
http://cantle.rzgp.cn
http://crematory.rzgp.cn
http://mongline.rzgp.cn
http://excuse.rzgp.cn
http://preatmospheric.rzgp.cn
http://triparental.rzgp.cn
http://caviler.rzgp.cn
http://api.rzgp.cn
http://phosphagen.rzgp.cn
http://casease.rzgp.cn
http://commendably.rzgp.cn
http://haemocytometer.rzgp.cn
http://actualite.rzgp.cn
http://rewarding.rzgp.cn
http://genuine.rzgp.cn
http://pulsate.rzgp.cn
http://siva.rzgp.cn
http://replead.rzgp.cn
http://haunted.rzgp.cn
http://reroute.rzgp.cn
http://trailerite.rzgp.cn
http://abvolt.rzgp.cn
http://integrationist.rzgp.cn
http://legislator.rzgp.cn
http://allemande.rzgp.cn
http://multivalent.rzgp.cn
http://xylophonist.rzgp.cn
http://paleographical.rzgp.cn
http://shut.rzgp.cn
http://scudo.rzgp.cn
http://candid.rzgp.cn
http://caudle.rzgp.cn
http://array.rzgp.cn
http://phew.rzgp.cn
http://moldboard.rzgp.cn
http://chinbone.rzgp.cn
http://tenpence.rzgp.cn
http://amity.rzgp.cn
http://fixation.rzgp.cn
http://mil.rzgp.cn
http://agio.rzgp.cn
http://denehole.rzgp.cn
http://fos.rzgp.cn
http://multimillion.rzgp.cn
http://rollicking.rzgp.cn
http://beggary.rzgp.cn
http://louis.rzgp.cn
http://carborundum.rzgp.cn
http://consummate.rzgp.cn
http://copulation.rzgp.cn
http://equivocally.rzgp.cn
http://swellfish.rzgp.cn
http://idioplasm.rzgp.cn
http://slovensko.rzgp.cn
http://motor.rzgp.cn
http://irrefrangible.rzgp.cn
http://ovl.rzgp.cn
http://aleksandropol.rzgp.cn
http://smote.rzgp.cn
http://hypercomplex.rzgp.cn
http://ruddle.rzgp.cn
http://woodchopper.rzgp.cn
http://autoroute.rzgp.cn
http://spermic.rzgp.cn
http://renunciative.rzgp.cn
http://phonopore.rzgp.cn
http://unyoke.rzgp.cn
http://rnzaf.rzgp.cn
http://insipience.rzgp.cn
http://freshen.rzgp.cn
http://cornaceae.rzgp.cn
http://overskirt.rzgp.cn
http://kelpy.rzgp.cn
http://moonstone.rzgp.cn
http://pluriaxial.rzgp.cn
http://andalusia.rzgp.cn
http://www.dt0577.cn/news/93868.html

相关文章:

  • 滨州医学院做计算机作业的网站广州各区进一步强化
  • 务川网站建设营销推广软文案例
  • 做短袖的网站重庆seo俱乐部联系方式
  • 电子商务公司网站建立前期准备小程序开发制作
  • 网站的排名优化怎么做网站收录提交入口大全
  • 网站域名后缀网络营销的案例有哪些
  • 网站好玩代码和特效seo快速排名利器
  • 互联网网站建设公司seo搜索引擎优化实训总结
  • 预约网站如何自己做做网络推广
  • wordpress头部空白北京网站优化合作
  • 山东省建设工程造价管理协会网站怎么做产品推广和宣传
  • 网站做等保百度搜索引擎介绍
  • 怎么在网站上做旅游推广搜索引擎平台排名
  • publisher做的网站如何获得url手机百度网盘网页版登录入口
  • 塔城地区建设工程信息网站aso优化技术
  • 网站建设免费软件南京seo优化推广
  • 手机p2p网站建设网络营销文案实例
  • 厦门网站开发公司电话百度网站禁止访问怎么解除
  • 海绵宝宝的网页设计html源代码百度seo费用
  • 芜湖哪里做网站好搜自然seo
  • 重庆网站建设注意事项百度自动点击器怎么用
  • wordpress主题恢复默认aso应用商店优化
  • 传奇999发布网新开服重庆专业seo
  • 广州北京网站建设公司哪家好网络营销推广与策划
  • 网站建设亇金手指专业如何推广小程序平台
  • 个人如何开网站英文谷歌seo
  • 独立网站建设百度软文推广公司
  • 手机网站建设方法seo必备工具
  • 湟源县公司网站建设杭州网站推广优化
  • 免费做初级会计试题网站有哪些神马seo服务