关于访问设备内存的应用程序 [英] About application to access Device memory
问题描述
您好,
Hi,
我们开发了storport微型端口驱动程序和应用程序。
我们使用StorPortGetDeviceBase映射设备寄存器(BAR0 / BAR4)到内核虚拟地址。
然后使用MmMapLockedPagesSpecifyCache将其映射到用户空间地址。
在这种情况下,当应用程序尝试访问用户空间地址时,出现访问冲突错误。
We have developed storport miniport driver and application.
We use StorPortGetDeviceBase to map Device registers (BAR0/BAR4) to kernel virtual address.
Then use MmMapLockedPagesSpecifyCache to map it to user space address.
In this case, when application tried accessing user space address, got access violation error.
请告知我设备内存是否可以映射并访问用户空间。
在其他情况下,Driver使用MmMapLockedPagesSpecifyCache分配非分页池和映射。
应用程序可以写入和读取用户空间地址。
In other case, Driver allocated non paged pool and map with MmMapLockedPagesSpecifyCache.
Application could write and read user space address.
谢谢&问候,
Raphel
Thanks & Regards,
Raphel
推荐答案
技术上是的,您可以将设备注册表映射到用户空间,但它会打开巨大的安全漏洞。 另外,你是从一个storport这样做的吗? 如果storport接收到SCSI请求,你认为这是怎么回事,其中一些是
DISPATCH_LEVEL?
Technically yes you can map Device Registers to user space, but it opens huge security holes. Also, you are doing this out of a storport? How do you think this is going to work, with the storport receiving SCSI requests, some of them at DISPATCH_LEVEL?
这篇关于关于访问设备内存的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!