WinNT sharable driver blue screens!

Hi,
I would like someone to help me out with this really
perplexing problem. I have a kernel mode driver (that
does nothing much except map some kernel mode memory
in user mode and unmaps it) It is written as a WDM
driver and works fine on all Windows OS ie XP, 2K, 98
and Me but on Nt there is a strange issue. If
multiple apps are launched, they each try to get a
handle to the driver using CreateFile:
result = CreateFile(szDrvName,
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
0,
NULL);
each call is succesful and a valid handle is returned.
Then when the application try to exit and call
CloseHandle on the driver, the first application exits
fine but the second app will cause a blue screen with
BugCheck IRQL_NOT_LESSTHAN_EQUALTO. Interestingly the
fault is not in the driver it occurs in the run time
library.
The simplest explanation seemed that the first time
the app calls IRP_MJ_CLOSE it cleans out the driver
resources and the second blue screens. I have modifed
the IRP_MJ_CLOSE dispatch routine such that it doesn’t
free any resources. I still see the blue screen. no
documentation has helped me so far, I haven’t found
anything related.

This is on a Windows NT machine and my debugging setup
is not very reliable unfortuantely.I would appreciate
any help or ideas

Thanks for your help!


Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo

I forgot to also mention that I have run Driver
Verifier on the driver under Windows XP and forced
IRQL checking and all other tests and it comes up
absolutely clean under XP

thanks.
— Pallavi Sharma wrote:

> Hi,
> I would like someone to help me out with this really
> perplexing problem. I have a kernel mode driver
> (that
> does nothing much except map some kernel mode memory
> in user mode and unmaps it) It is written as a WDM
> driver and works fine on all Windows OS ie XP, 2K,
> 98
> and Me but on Nt there is a strange issue. If
> multiple apps are launched, they each try to get a
> handle to the driver using CreateFile:
> result = CreateFile(szDrvName,
> GENERIC_READ | GENERIC_WRITE,
> FILE_SHARE_READ,
> NULL,
> OPEN_EXISTING,
> 0,
> NULL);
> each call is succesful and a valid handle is
> returned.
> Then when the application try to exit and call
> CloseHandle on the driver, the first application
> exits
> fine but the second app will cause a blue screen
> with
> BugCheck IRQL_NOT_LESSTHAN_EQUALTO. Interestingly
> the
> fault is not in the driver it occurs in the run time
> library.
> The simplest explanation seemed that the first time
> the app calls IRP_MJ_CLOSE it cleans out the driver
> resources and the second blue screens. I have
> modifed
> the IRP_MJ_CLOSE dispatch routine such that it
> doesn’t
> free any resources. I still see the blue screen. no
> documentation has helped me so far, I haven’t found
> anything related.
>
>
> This is on a Windows NT machine and my debugging
> setup
> is not very reliable unfortuantely.I would
> appreciate
> any help or ideas
>
> Thanks for your help!
>
>
>
>
> Do you Yahoo!?
> Take Yahoo! Mail with you! Get it on your mobile
> phone.
> http://mobile.yahoo.com/maildemo
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>


Do you Yahoo!?
The all-new My Yahoo! - What will yours do?
http://my.yahoo.com

Say !analyze -v in WinDbg, this will help.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Pallavi Sharma”
To: “Windows System Software Devs Interest List”
Sent: Tuesday, December 07, 2004 4:50 AM
Subject: [ntdev] WinNT sharable driver blue screens!

> Hi,
> I would like someone to help me out with this really
> perplexing problem. I have a kernel mode driver (that
> does nothing much except map some kernel mode memory
> in user mode and unmaps it) It is written as a WDM
> driver and works fine on all Windows OS ie XP, 2K, 98
> and Me but on Nt there is a strange issue. If
> multiple apps are launched, they each try to get a
> handle to the driver using CreateFile:
> result = CreateFile(szDrvName,
> GENERIC_READ | GENERIC_WRITE,
> FILE_SHARE_READ,
> NULL,
> OPEN_EXISTING,
> 0,
> NULL);
> each call is succesful and a valid handle is returned.
> Then when the application try to exit and call
> CloseHandle on the driver, the first application exits
> fine but the second app will cause a blue screen with
> BugCheck IRQL_NOT_LESSTHAN_EQUALTO. Interestingly the
> fault is not in the driver it occurs in the run time
> library.
> The simplest explanation seemed that the first time
> the app calls IRP_MJ_CLOSE it cleans out the driver
> resources and the second blue screens. I have modifed
> the IRP_MJ_CLOSE dispatch routine such that it doesn’t
> free any resources. I still see the blue screen. no
> documentation has helped me so far, I haven’t found
> anything related.
>
>
> This is on a Windows NT machine and my debugging setup
> is not very reliable unfortuantely.I would appreciate
> any help or ideas
>
> Thanks for your help!
>
>
>
> __________________________________
> Do you Yahoo!?
> Take Yahoo! Mail with you! Get it on your mobile phone.
> http://mobile.yahoo.com/maildemo
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>