Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
Hi I am a newbie to driver development and I want to write a driver or a filter
driver to block and re enable usb ports.

Basically my project is to block/lock ce
rtain usb storage devices, which are
not registered with my user mode application. So I am looking if there is a way
that I could block the certain devices for other applications, but only
accessible from my application.

Any help would be appreciated

Thank you
Chathura
Posted
Comments
Chathura Sarathchandra 28-Jul-11 13:25pm    
anyone please?

Hi Chathura

Actually i'm facing the same problem. In my driver i have to connect my Network card with my usb device. So i have some knowledge about USB Devices.

if i have this problem than i will first goto the USB's PIDandVID number. i'll recognize those PID&VID which are stored in my Program.

It means that my Program has those USB's VID&PID numbers which can access him. So when any USB Device try to access that program ur driver will first get the VID&PID of USB Device; if it is recognized by my Program than it'll continue otherwise it'll not.

:)

--Naveen
 
Share this answer
 
Comments
Chathura Sarathchandra 29-Jul-11 5:57am    
Thanks for your reply :) What does it do if it does not recognize the device? how did you block the device?. My problem is to block the whole device so nothing can access it. And while I get the VID & PID numbers I do not want any other process to access the device either.
What you want to do is not easy, not reasonnable, and not recommanded.

Instead of "blocking" an USB port, I would suggest to check the name of the drive the user is attempting to access, and just prompt him/her he/she can't write there.

Check out this for example: System.IO.DriveInfo.GetDrives().
 
Share this answer
 
Comments
Chathura Sarathchandra 29-Jul-11 6:08am    
Thank you for your reply :)

Yes I would want to get the name of the device and register it with my application. But I want to prevent other services from accessing the device too, not only the users.
Olivier Levrey 29-Jul-11 6:11am    
So I can't help you further since I have very little knowledge in developping drivers...
Chathura Sarathchandra 29-Jul-11 6:16am    
Ok thanks anyway
mr_asadi 23-Sep-12 5:41am    
Hi,I have same problem also and I think it will never be solve.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900