阅读:3024回复:4
MmGetSystemAddressForMdl都干了些什么呢?
ds中的文档:
问几个问题,和ds无关 KMemory::MapToSystemSpace PVOID MapToSystemSpace(void); Map the memory region into system space. ^^^^^^^^^^^^^指什么 Returns Returns the virtual address in system space of the start of the memory region described by the object. Comments The pages of the described memory object must be locked. When a driver other than a highest level driver receives a KMemory object, it is safe to assume it is locked. Memory allocated from the non-paged pool is locked. A driver that uses direct I/O but not DMA can use this service to map the buffer provided in a I/O request from a user subsystem. The driver can then transfer data directly to or from the client buffer. If the underlying MDL has already been mapped, the function returns the same address to which it was originally mapped. The underlying system service is MmGetSystemAddressForMdl. The caller must be running at IRQL <= DISPATCH_LEVEL. KMemory::MapToUserSpace PVOID MapToUserSpace(void); Map the memory region into the address space of the current process. 和上面的空间有什么区别呢??? Returns Returns the virtual address in the current process address space of the start of the memory region described by the object. The address takes into account the page offset. Comments The pages of the described memory object must be locked. See LockPages. Memory allocated from the non-paged pool is locked. Since the call maps the memory into the current process, only highest level drivers (including monolithic drivers) can reasonably use this function. The same memory object may be mapped into multiple processes. Use member function Unmap to unmap the memory mapped by this call. The underlying system service is MmMapLockedPages. The caller must be running at IRQL < DISPATCH_LEVEL. See Also LockPages, Unmap See Also LockPages |
|
最新喜欢:mapofl
|
沙发#
发布于:2002-08-15 11:46
ds中的文档: direct_io方法时,先把app的地址lock,保证他在物理内存,但是在2G上面的driver还是不能直接去用他,要在system空间(2G上面)建立他的映射,通过这个映射来访问app的被lock的内存。mdl就是描述这个的东东。我向ds的这个函数应该是干这个活的。
就是当前的进程的空间啊,看他的字面,应该是说app进程。大概这样做了,app也可以访问那个share的memory了吧。没有详细看。 :D |
|
板凳#
发布于:2002-08-15 13:01
[quote]ds中的文档: direct_io方法时,先把app的地址lock,保证他在物理内存,但是在2G上面的driver还是不能直接去用他,要在system空间(2G上面)建立他的映射,通过这个映射来访问app的被lock的内存。mdl就是描述这个的东东。我向ds的这个函数应该是干这个活的。
就是当前的进程的空间啊,看他的字面,应该是说app进程。大概这样做了,app也可以访问那个share的memory了吧。没有详细看。 :D [/quote] 给我程序加进了Lock 、unlock功能,错误似乎还存在 5555 要死了 :( |
|
|
地板#
发布于:2002-08-15 13:41
不需要你去lock、unlock啊,IO管理器会做事情的啊。〕
这是系统做的。 direct_io方法时,先把app的地址lock,保证他在物理内存,但是在2G上面的driver还是不能直接去用他,要在system空间(2G上面)建立他的映射,通过这个映射来访问app的被lock的内存。 |
|
地下室#
发布于:2002-08-15 14:12
不需要你去lock、unlock啊,IO管理器会做事情的啊。〕 现在又出 DRIVER_IRQL_NOT_OR_EQUAL 错误啦 位置还不一样,真要命。帮助我看看,怎么计算出错的位置的帖子 |
|
|