Hi all,
Thank you for your infor of my message"CreateFile on win98".But the
problem still puzzles me.
I use createfile to open a device with its symbolic link name. I work on
win98.
In the driver,I use IoCreateDevice and IoCreateSymbolicLink .They return
success.
I use “device” command in the softice and see the device the driver
created.
My driver 's name is protocol.sys .
In the driver,I defined:
#define NT_DEVICE_NAME L"\Device\MYDRIVER"
#define DOS_DEVICE_NAME L"\DosDevices\OURDRIVER"
In the application ,I can use
" hFile=CreateFile((“c:\windows\system\protocol.sys”),
0,
0,
NULL,
OPEN_EXISTING,
FILE_FLAG_RANDOM_ACCESS,
0
);"to get the valid file handle,but I can’t use
the “\DosDevice\OURDRIVER” to get a valid file handle.
Because I need use DeviceIoControl to communicate with the .sys file.If
I open the .sys file with “c:\windows\system\protocol.sys”,I can’t go
on. Every DeviceIoControl call returns fail.
About the first parameter of Createfile ,I use the following formats:
“\\.\OURDRIVER”,
“\\??\OURDRIVER”.
Addtionally,on win2k,If the first parameter is the symbolic link name in
the registry ,likes
“\\.\ROOT#NET_DRIVER#0000#{ad498944-762f-11d0-8dcb-00c04fc3358c}”,
Createfile returns success but DeviceIOControl returns fail.NET_DRIVER is
the deviceid of miniport part in the inf.It is virtual.My driver is an im
driver. If I use “\\.\OURDRIVER” to open the device,DeviceIoControl
return success. Why must use “\\.\OURDRIVER” ?QueryDosDevice displays
that the symbolic link name of the device “MYDRIVER”
is
“\\.\ROOT#NET_DRIVER#0000#{ad498944-762f-11d0-8dcb-00c04fc3358c}” .Why
DeviceIoControl fail when using
“\\.\ROOT#NET_DRIVER#0000#{ad498944-762f-11d0-8dcb-00c04fc3358c}” ? If I
want to use
“\\.\ROOT#NET_DRIVER#0000#{ad498944-762f-11d0-8dcb-00c04fc3358c}” with
DeviceIoControl ,how can i do?
Any help will be appreciated.
xxxxx@hotmail.com
Äú¿ÉÒÔÔÚ MSN Hotmail Õ¾µã http://www.hotmail.com/cn Ãâ·ÑÊÕ·¢µç×ÓÓʼþ
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com