Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Everyone..

Let me explain the situation..

Am having two drives mainly D-Drive & I-Removable Disk. In normal suitation we can copy the files from I drive to D drive.
And my question is: Can it be done to avoid copying the files from I Drive to D drive Programmatically(WIN32). ?


Thank you..
Posted
Comments
Sergey Alexandrovich Kryukov 19-Mar-12 3:44am    
Aha, copy but not copy? No, please explain what do you want to achieve and why? What's the ultimate goal.
--SA
Guru_C++ 19-Mar-12 3:55am    
Actually.. Using WIN32 Programmatically, i want to make I:Drive as Copy Protect that is,The files in I:Drive should not copy to Other Drives. Am not sure can it be done like this ? Am having lot confusion about this concept, because all drives will be under Device Drivers control.. If i want to achieve this, Should i need to change Device Drivers program or what ??
Jochen Arndt 19-Mar-12 4:10am    
When a file is copied, it will be read. To avoid copying, reading must be denied. But this will also deny any other kind of read access like opening the files with applications. On modern file systems (not FAT), this can be done using permissions. But this is not feasable with removable media which often have FAT file systems. So the only solution is to avoid mounting of the removable media.

1 solution

Hi.
what I hope to know is which way you copy files from I: Drive to D: Drive.
If you want to block copying through explorer, it can be possible.
Because explorer uses Windows API function for copying files.
so you can implement it by hooking WINDOS API.

But if you want to block all the ways of copying. I think it is impossible.
because many programs read data from I: drive and write that to D: Drive without using Windows API.
First we need to detect the copying for blocking it.
but in above way, when one process read data from I: drive, how can we know if that process's going to write that data to D: drive.

But we can block all writing to D: drive, or block all reading from I:
can this be solution for your problem?
 
Share this answer
 
v3
Comments
Guru_C++ 19-Mar-12 5:05am    
Yes.. I agree with this point. We can block all writing to D:Drive or block all reading from I:Drive.
Just assuming that, In I:Drive am having three .txt files. And, If we made block all reading from I:Drive, Can i copy all three .txt files to Other Drives ?
[no name] 19-Mar-12 5:36am    
If you block all the readings from (I:Drive), you can't even access to all files in (I:drive). So you can't copy those to other drives.
[no name] 19-Mar-12 5:39am    
I'm thinking about one solution.
that is using File System Driver.
In that driver, we can do as follow.
1. we should save the names of all the process, which read from I:drive.
2. then we' ll block if those process try to write data to D:drive.
Guru_C++ 19-Mar-12 6:38am    
Ok.. Can u provide any usefull links to block all the readings from Drive using WIN32 Programmatically.
[no name] 21-Mar-12 1:47am    
If you want to implement by WIN32 programming, you should hook ReadFile() function in userland.
In that case, you should all the processes in current session.
http://www.codeproject.com/Articles/27637/EasyHook-The-reinvention-of-Windows-API-hooking

And most anti-virus will block those attempts and you can't hook in some process, which protect themselves.
So I think this is not efficient way.
I'm not sure some more problem about that way.

There's also a way of using System Filter Driver to implement blocking reading.
I recommend you to use System Filter Driver.

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