I have a kernel mode TDI filter driver. I install the driver by copying
it to \windows\system32\drivers directory and modifying the registry
entries to change the load order (i.e. to load after TCP/IP but before
NetBT).
Then, I have a application which uses CreateFile to get handle to
driver, but it returns INVALID_HANDLE_VALUE and Getlasterror() always
returns 2 (file not found). I was under the impression that calling
CreateFile() would load the driver and ultimately call DriverEntry() fn
of driver? Am I missing something here? I am calling as follows:
h = CreateFile(
“\\.\”,
GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED,
NULL
);
Appreciate any responses here…
Sanjay
Are you creating a symbolic link to your device object in ?? or
\Global??
?
(wow, punctuating that sentence was hard 
-p
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Sanjay Chadda
Sent: Wednesday, June 09, 2004 2:31 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Question on CreateFile
Importance: High
I have a kernel mode TDI filter driver. I install the driver by copying
it to \windows\system32\drivers directory and modifying the registry
entries to change the load order (i.e. to load after TCP/IP but before
NetBT).
Then, I have a application which uses CreateFile to get handle to
driver, but it returns INVALID_HANDLE_VALUE and Getlasterror() always
returns 2 (file not found). I was under the impression that calling
CreateFile() would load the driver and ultimately call DriverEntry() fn
of driver? Am I missing something here? I am calling as follows:
h = CreateFile(
"\\.\ <file:>> ",
GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED,
NULL
);
Appreciate any responses here…
Sanjay
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com</file:>
Question on CreateFileCreateFile is predicated on the driver being loaded (and on a few other things).
What was the Start value you put into the driver’s Services entry?
–
James Antognini
Windows DDK Support
This posting is provided “AS IS” with no warranties, and confers no rights.
“Sanjay Chadda” wrote in message news:xxxxx@ntdev…
I have a kernel mode TDI filter driver. I install the driver by copying it to \windows\system32\drivers directory and modifying the registry entries to change the load order (i.e. to load after TCP/IP but before NetBT).
Then, I have a application which uses CreateFile to get handle to driver, but it returns INVALID_HANDLE_VALUE and Getlasterror() always returns 2 (file not found). I was under the impression that calling CreateFile() would load the driver and ultimately call DriverEntry() fn of driver? Am I missing something here? I am calling as follows:
h = CreateFile(
“\\.\”,
GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED,
NULL
);
Appreciate any responses here…
Sanjay
First I create a device object in my driver using IoCreateDevice(). Then
I create a symbolic link for this device object using
IoCreateSymbolicLink().
The symbolic link name I give to IoCreateSymbolicLink() is
“\DosDevices\”
Sanjay
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Peter Wieland
Sent: Wednesday, June 09, 2004 2:46 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question on CreateFile
Are you creating a symbolic link to your device object in ?? or
\Global?? ?
(wow, punctuating that sentence was hard
-p
________________________________
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Sanjay Chadda
Sent: Wednesday, June 09, 2004 2:31 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Question on CreateFile
Importance: High
I have a kernel mode TDI filter driver. I install the driver by copying
it to \windows\system32\drivers directory and modifying the registry
entries to change the load order (i.e. to load after TCP/IP but before
NetBT).
Then, I have a application which uses CreateFile to get handle to
driver, but it returns INVALID_HANDLE_VALUE and Getlasterror() always
returns 2 (file not found). I was under the impression that calling
CreateFile() would load the driver and ultimately call DriverEntry() fn
of driver? Am I missing something here? I am calling as follows:
h = CreateFile(
"\\.\ <file:>> ",
GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED,
NULL
);
Appreciate any responses here…
Sanjay
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@netscreen.com To
unsubscribe send a blank email to xxxxx@lists.osr.com</file:>
the “Start” value is 1 at
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services,devicename>
Sanjay
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of James Antognini
[MSFT]
Sent: Wednesday, June 09, 2004 2:53 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Question on CreateFile
CreateFile is predicated on the driver being loaded (and on a
few other things).
What was the Start value you put into the driver’s Services
entry?
–
James Antognini
Windows DDK Support
This posting is provided “AS IS” with no warranties, and confers
no rights.
“Sanjay Chadda” wrote in message
news:xxxxx@ntdev…
I have a kernel mode TDI filter driver. I install the
driver by copying it to \windows\system32\drivers directory and
modifying the registry entries to change the load order (i.e. to load
after TCP/IP but before NetBT).
Then, I have a application which uses CreateFile to get
handle to driver, but it returns INVALID_HANDLE_VALUE and Getlasterror()
always returns 2 (file not found). I was under the impression that
calling CreateFile() would load the driver and ultimately call
DriverEntry() fn of driver? Am I missing something here? I am calling as
follows:
h = CreateFile(
"\\.\
<file:>> ",
GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL |
FILE_FLAG_OVERLAPPED,
NULL
);
Appreciate any responses here…
Sanjay
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@netscreen.com
To unsubscribe send a blank email to
xxxxx@lists.osr.com</file:>
Hi,
Refer following link.
http://support.microsoft.com/default.aspx?scid=kb;en-us;q115486
Jothi
----- Original Message -----
From: priya priya
To: Windows System Software Devs Interest List
Sent: Thursday, June 10, 2004 9:56 AM
Subject: Re: [ntdev] Question on CreateFile
Hi,
What is the load order in which your driver is getting loaded?
Is it boot or auto or manual?
CreateFile call in your application will not load the driver or go to
driver entry. CreateFile call in the application will be mapped to
IRP_MJ_CREATE in the driver routine.The driver should be loaded
during boot or manually. This setting should be made in the ini or
inf file.Before running your application check whether the driver is
up.
Right click “My Computer” -> Manage -> Services and applications ->
services
Check whether ur driver status is started. If it is not started ,
go to command prompt and type net start “drivername”.Now it will go
and hit the driverentry of your driver.(if there are breakpoints)
After this step run your application.The create file should be called
with your win32device name(Symbolic link created for your driver).
To view this use the DeviceTree and under ?? check whther the
symbolic name you created appears.I think if all these are proper
when you call createfile it will map to the IRP_MJ_CREATE of your
driver without giving any error.
Regards,
Priya
Get your Free E-mail at http://freelancewriting.zzn.com
Get your own Web-based E-mail Service at http://www.zzn.com
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@calsoft.co.in
To unsubscribe send a blank email to xxxxx@lists.osr.com