// JP opened flex table

Click to See Complete Forum and Search --> : Need Help on USB


RYK
February 19th, 2007, 07:37 AM
Hi All

i am quite new to device drivers development so can anyone guid me.
How I can allow only read access to a particular USB but not write access on that USB programmatically without manipulating registry settings using VC++?

i have been wondering here and there to get the solution since a week but yet i have not got anything if some code would be available then that will help me alot..

Thanks in advance
R e h a n

tigran_g
February 22nd, 2007, 06:35 AM
Sorry.
Are you developing driver.

RYK
February 23rd, 2007, 01:32 AM
No I am not developing driver,

my problem is,

i want to set security (allow read only, allow write only or allow read/write both etc.) to USB.

suppose i have an organisation and there are n number of users and centrally i have to control, who will avail only read permission of USB drive and who will avail Only write permission and who will avail both.

basically it will protect from data stealing, means nobady will directly copy from their USB and nobady will write something to USB.

please dear if you got the problem then give me some eyes to it.

Thanks in advance
R e h a n

Kannan.in
February 27th, 2007, 10:27 AM
How to write protect USB mapped drive?

I need to know the set of API's (and if possible the pseudocode) to make a drive read only (write protect) any drive, especially USB mass storage device.
I tried modifying ACE in ACL in SD and applying that on folder... this seems to work on folders, but not with a USB mapped drive.

Any help would be highly appreciated!

Thanks,
Kannan
My e-mail ID is kannan[dot]in[at]gmail[dot]com (I'll post answer if I find/explore/etc definitely, you too do so if you find by any chance. Thanks in advance)

Kannan.in
March 1st, 2007, 09:17 AM
I dont know if there are any VC++ solutions for the query... but I managed to find one alternative... find that below.

Windows XP Service Pack 2 (SP2) introduces a new registry subkey that lets you mark USB-based storage devices such as memory sticks as read-only devices. This is a useful security capability that can prevent users from copying data from their systems and taking that data offsite via a USB device. To enable the USB write protection, perform the following steps:

1. Start the registry editor (regedit.exe).
2. Navigate to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies subkey. (Create the StorageDevicePolicies subkey if it doesn't already exist.)
3. From the Edit menu, select New, DWORD Value.
4. Type the name WriteProtect and press Enter.
5. Double-click the new value and set it to 1. Click OK.
6. Close the registry editor.
7. Restart the computer.

To disable this change, you can either set WriteProtect to 0 or delete it.

RYK
March 6th, 2007, 02:15 AM
Hi Kannan

How will i avoid to reboot the system

Thanks in advance
R e h a n

djai
March 29th, 2007, 01:52 AM
Use SystemParameterInfo it will change value without rebooting

thanx

RYK
April 16th, 2007, 09:23 AM
Hi kanan

if i want to set security (allow read only, allow write only or allow read/write both etc.) to CD Drive as well as Floppy drive so setting should be required in registry like USB.
Thanks in advance
R e h a n

//JP added flex table