Hello,
Synopsis of the problem :
I am developing an application, which interacts with a driver through shared memory created using section objects. The problem here is, the memory shared through section objects can’t be accessed at DISPATCH_LEVEL in the driver, but I could access it at PASSIVE_LEVEL and could share propely with application.
Can anyone help me to share the memory between driver and application using section objects at DISPATCH_LEVEL?
Details of the problem :
The driver is a storage miniport driver. I am creating memory using ZwCreateSection and mapping it using ZwMapViewOfSection functions. I am able to creates and access the memory in HwFindAdaptor function of the miniport driver. But when try to access the same memory in HwInitialize, the system crashes. The reason I could see is that the memory that is created through section objects is pagable, which is getting paged-out when the driver runs in DISTACH_LEVEL (HwInitialize). I could not find anyways to lock this memory to access in HwInitialize.
PLEASE HELP!!! I have tried sharing memory using IOCTLs. But this method is of no use in our case. Please suggest any other methods, either to share memory or to lock the section objects created above.
Well as you said, it is pagable memory so you can’t access it at
dispatch level. Unless of course you lock it down with an MDL. This is
an unusual situation for a non-virtual storage miniport driver.
Mark Roddy
On Mon, Oct 25, 2010 at 5:05 AM, wrote:
> Hello,
>
> Synopsis of the problem :
>
> I am developing an application, which interacts with a driver through shared memory created using section objects. The problem here is, the memory shared through section objects can’t be accessed at DISPATCH_LEVEL in the driver, but I could access it at PASSIVE_LEVEL and could share propely with application.
>
> Can anyone help me to share the memory between driver and application using section objects at DISPATCH_LEVEL?
>
> Details of the problem :
>
> The driver is a storage miniport driver. I am creating memory using ZwCreateSection and mapping it using ZwMapViewOfSection functions. I am able to creates and access the memory in HwFindAdaptor function of the miniport driver. But when try to access the same memory in HwInitialize, the system crashes. The reason I could see is that the memory that is created through section objects is pagable, which is getting paged-out when the driver runs in DISTACH_LEVEL (HwInitialize). I could not find anyways to lock this memory to access in HwInitialize.
>
> PLEASE HELP!!! I have tried sharing memory using IOCTLs. But this method is of no use in our case. Please suggest any other methods, either to share memory or to lock the section objects created above.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
Why did ioctls not work?
d
dent from a phpne with no keynoard
-----Original Message-----
From: xxxxx@yahoo.co.in
Sent: October 25, 2010 2:04 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Section Objects Sharing At DISPATCH_LEVEL
Hello,
Synopsis of the problem :
I am developing an application, which interacts with a driver through shared memory created using section objects. The problem here is, the memory shared through section objects can’t be accessed at DISPATCH_LEVEL in the driver, but I could access it at PASSIVE_LEVEL and could share propely with application.
Can anyone help me to share the memory between driver and application using section objects at DISPATCH_LEVEL?
Details of the problem :
The driver is a storage miniport driver. I am creating memory using ZwCreateSection and mapping it using ZwMapViewOfSection functions. I am able to creates and access the memory in HwFindAdaptor function of the miniport driver. But when try to access the same memory in HwInitialize, the system crashes. The reason I could see is that the memory that is created through section objects is pagable, which is getting paged-out when the driver runs in DISTACH_LEVEL (HwInitialize). I could not find anyways to lock this memory to access in HwInitialize.
PLEASE HELP!!! I have tried sharing memory using IOCTLs. But this method is of no use in our case. Please suggest any other methods, either to share memory or to lock the section objects created above.
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
Doron,
To use the IOCTLs, the driver should be installed and be running. But our case is different, the driver initialization (HwInitialize) depends on the data shared by the application, but to share the data by the application through IOCTLs, the driver must be initialized and must be up (otherwise we don’t get a handle for the driver in the application). This is an inter-dependency problem (in fact, deadlock). So we concluded that the IOCTL method can’t be used here.
Please suggest, if you see any solution.
If the amount of data is not too large, can you write it to the registry
for that driver under a parameter identifying the specific device? Or
consider creating a control device object that the data can be sent to
via an IOCTL, before the HwInitialize.
Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
“xxxxx@yahoo.co.in” wrote in message
news:xxxxx@ntdev:
> Doron,
>
> To use the IOCTLs, the driver should be installed and be running. But our case is different, the driver initialization (HwInitialize) depends on the data shared by the application, but to share the data by the application through IOCTLs, the driver must be initialized and must be up (otherwise we don’t get a handle for the driver in the application). This is an inter-dependency problem (in fact, deadlock). So we concluded that the IOCTL method can’t be used here.
>
> Please suggest, if you see any solution.
Don,
We need to share large amounts of data. In fact, after using the data written by the application in Hwinitialize, the driver writes back some more data into the shared memory for the application to use. We are using this shared memory as a medium for interaction between driver and application (do not bother about sync issues here, we can take care those issues).
Mark,
I could not find a way to get MDL for this section objects. Could you please suggest an existing API for this?
Thanks for your help!!
Sarma.
Thanks folks!!
I am able to access the section objects by locking using MDLs!!
But now I got many doubts on paged and non-paged memory, mapping using section objects (ZwMapViewSection) and mapping through MDLs (MmMapLockedPagesSpecifyCache) etc., in Windows!! will clarify it …
