Sir,can you help me
-
Hi! When I use DeviceIoControl() to communicate with a special device in my VC++ application,the DeviceIoControl() returns zero,and the Getlasterror() returns 50. I defined an IOCTL command in my driver,and used CreateFile to retrieve the device handle. I set a breakpoint at IRP dispatch instance in my driver code with SoftICE, but it seems that the DeviceIoControl() can not communictate with the driver. What's the matter then? Thanks for help! momer -- modified at 2:03 Tuesday 20th September, 2005
-
Hi! When I use DeviceIoControl() to communicate with a special device in my VC++ application,the DeviceIoControl() returns zero,and the Getlasterror() returns 50. I defined an IOCTL command in my driver,and used CreateFile to retrieve the device handle. I set a breakpoint at IRP dispatch instance in my driver code with SoftICE, but it seems that the DeviceIoControl() can not communictate with the driver. What's the matter then? Thanks for help! momer -- modified at 2:03 Tuesday 20th September, 2005
-
Did you use open, start, stop and close device driver (sys) dinamicly? It is look like driver not started.
Hi!Branislav, Before use DeviceIoControl() I have used the CreateFile() to retrieve the device handle,and I suppose the CreateFile() can open the device driver. And I can know that the CreateFile() resposes by the IRP_MJ_CREATE with SoftICE,so I think the device driver (sys) has been opened before the application runs to DeviceIoControl(). Thanks! momer
-
Hi!Branislav, Before use DeviceIoControl() I have used the CreateFile() to retrieve the device handle,and I suppose the CreateFile() can open the device driver. And I can know that the CreateFile() resposes by the IRP_MJ_CREATE with SoftICE,so I think the device driver (sys) has been opened before the application runs to DeviceIoControl(). Thanks! momer
Before use any function to call driver you must start driver service if you did not have automatic start during instalation driver. For more details see http://www.l5sg.com/products/source_code.php source code for tipical install, start and stop a service or driver. You can use that code to open and start driver before call CreateFile, ... and after, before the end of your program, close service or driver. All you can check in Administrative Tools\Services. And most important thing is that you must be Administrator or privelege level like administrator.
-
Before use any function to call driver you must start driver service if you did not have automatic start during instalation driver. For more details see http://www.l5sg.com/products/source_code.php source code for tipical install, start and stop a service or driver. You can use that code to open and start driver before call CreateFile, ... and after, before the end of your program, close service or driver. All you can check in Administrative Tools\Services. And most important thing is that you must be Administrator or privelege level like administrator.
Hi!Branislav, Yes.My device is an USB vedio capture and the driver is a streaming minidriver,so when I plug the device into pc,the pnp manager can load and install the minidriver automaticly and then the I/O manager start the minidriver.In fact,as long as the vedio capture device plug into pc,my minidriver begins capturing vedio and audio data from the usb bus.So,I believe that the driver have been started before my calling CreateFile. And,every time the application runs to CreateFile,the SoftICE tells me that the minidriver have recieved a SRB,which is SRB_UNKNOWN_DEVICE_COMMAND. Thanks for help! momer