内核API笔记之IoBuildPartialMdl
来源:互联网 发布:心怀大局 知责有为 编辑:程序博客网 时间:2024/05/17 01:22
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 describes must be locked before the driver calls IoBuildPartialMdl. Typically, the source MDL describes a buffer in user address space, and the driver calls the MmProbeAndLockPages routine to lock the pages in this buffer. However, the driver can build the source MDL from nonpaged memory by calling the MmBuildMdlForNonPagedPool, MmAllocatePagesForMdlEx, or MmAllocatePagesForMdl 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内核之学习笔记
- C#:30行数据插入到数据库中的效率测试-一行行执行、构造SQL一次执行、SqlBulkCopy
- MultiByteToWideChar,字符编码转换
- [.NET] MVC with .NET interface
- 打造自定义的 AfxMessageBox
- 【SQL基础用法】——行列转换
- 内核API笔记之IoBuildPartialMdl
- JDBC访问所有数据库的完整步骤
- JS上下滚动(不停歇)
- frt
- 动态代理Proxy
- 哈哈,博客开通了
- 父与子
- JS上下滚动(含停歇)
- 腾讯商品滚动效果