内核API笔记之IoBuildPartialMdl
来源:互联网 发布:宏业软件教学视频 编辑:程序博客网 时间:2024/05/16 19:26
IoBuildPartialMdl
VOID
IoBuildPartialMdl(
__in PMDL SourceMdl,
__inout PMDL TargetMdl,
__in PVOID VirtualAddress,
__in ULONG Length
);
驱动程序可以使用IoBuildPartialMdl来把一个IRP请求分解成多个IRP请求. The physical pages that the source MDL describesmust be locked before the driver callsIoBuildPartialMdl. Typically, the source MDL describes a buffer in user address space, and the driver calls theMmProbeAndLockPages routine to lock the pages in this buffer. However, the driver can build the source MDL from nonpaged memory by calling theMmBuildMdlForNonPagedPool, MmAllocatePagesForMdlEx, orMmAllocatePagesForMdl routine.
意思就是说,如果分配的内存是不可置换的,则没什么事情,需要注意的是,如果源MDL是用户空间的,那么必须使用MmProbeAndLockPages 函数来锁定内存。
驱动程序可以使用MmGetSystemAddressForMdlSafe 宏来映射一部分用户空间MDL到系统空间中。如果这一部分用户空间的源MDL已经映射到系统空间,那么MmGetSystemAddressForMdlSafe宏使用已存在的源映射。否则,MmGetSystemAddressForMdlSafe宏就会创建一个新的映射, 为了防止新映射的内存存在泄漏,驱动在重新使用那一部分的MDL之前必须调用MmPrepareMdlForReuse。另外,IoFreeMdl函数会释放系统地址空间的映射, 当然了,前提是这个映射必须要存在啊, 。
- 内核API笔记之IoBuildPartialMdl
- 内核API笔记之IoBuildPartialMdl
- 内核API之IoAllocateMdl
- 内核API之IoAllocateMdl
- 内核笔记之链表篇
- Windows内核API HOOK 之 Inline Hook
- Windows内核API HOOK 之 Inline Hook
- Windows 内核API HOOK 之 Inline Hook
- Windows内核API HOOK 之 Inline Hook
- 内核学习笔记之IRP
- Android之内核学习笔记
- linux 内核笔记之watchdog
- 内核API
- hibernate 笔记之api详解
- Linux 内核设备驱动之GPIO驱动之GPIO API
- Linux内核笔记(2) 内核引导之initrd.img
- redhat9调试笔记之编译内核
- Linux下USB内核之学习笔记
- iOS Programming – 触摸事件处理
- 睿智平台中超完整的日期处理工具类DateUtil
- 解决没有找到tbb_debug.dll
- COleVariant 类型和其他类型之间的转换方法
- iccid
- 内核API笔记之IoBuildPartialMdl
- ASP.NET安装问题
- OpenCV运行出现0xc000000d的解决方法
- Hive.g文件的编译
- ctags 为系统相关头文件生成tags
- ashx页面中 Session值出现“未将对象引用设置到对象的实例”错误
- 点击文本框的时候才弹出验证码信息
- 【设计模式攻略】结构型模式之Proxy模式
- 有源和无源蜂鸣器的区别