Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi...

Can anyone Suggest me How to Write Protect the Hard-Disk/flash disk using WIn32 Source Code..

Thanks..
Posted

1 solution

You cannot.
The disk belongs to the operating system, not to the application that uses it.
You must write a driver for that. And it UNDER the win32, not using win32 itself.
 
Share this answer
 
Comments
Guru_C++ 14-Mar-12 2:06am    
Atleast, Can it be done for External USB or Flash Disk ??
Emilio Garavaglia 14-Mar-12 5:55am    
No, for that same reason: the hardware is managed by the OS, that hosts the applications (ALL of them).

Imagine two apps wishing to do different things to a same device or port...

What you can do is ask the system to give the full control of a port to you, hiding away to every other app, until you give it back (but now you have an USB serial: forget about file systems, you have to write your own), or writing something IN the system (a driver) that manipulates the data-flow towards a given port or device.

Note that some devices have this capability themselves (have a switch that can be positioned in a "deny write" mode). If you have that need, you probably should go towards that kind of devices.
Guru_C++ 14-Mar-12 8:33am    
Ok.. Thanks alot..

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