PCAUSA
Sun Mar 30 09:55:50 CDT 2008
On Mar 29, 3:18=A0pm, Anand Choubey
<AnandChou...@discussions.microsoft.com> wrote:
> Hi,
> I have developped NDIS IM driver. I am facing one problem with driver.
> Sometimes, Driver gets installed but If user land test application is not
> able to
> open Driver handle. I have to restart the system the everything works fine=
.
>
> Please suggset me how to look this problem.
>
> -- =A0
> With regards
> thanks
> Anand Choubey
Well, you start by finding out why the open failed...
Handles don't just "fail to open". They fail for a reason. Typically
you can use the GetLastError function to find out the reason.
With the reason in hand you go forward. If it is an access denied
error, study about permissions.
If it is a "not found" error, then you need to use WinDbg and see if
your IRP_MJ_CREATE callback is being called. If not, then you need to
examine your symbolic link and other naming conventions. If yes, then
use WinDbg to step through other I/O calls related to opening the
handle.
You need to study the fault and see if the useless term "sometimes"
can be sorted out into something more useful. Does it work fine on
some machines, but not others? Then what is the difference. If it
works when logged in as admin, but not as non-admin user, then that
would be helpful information.
Study the docs and study simple DDK samples that demonstrate opening
handles to drivers.
Thomas F. Divine
http://www.pcausa.com