views:

67

answers:

2

hi how can i stop or freeze the kernel32 event? for example stop the copy file??

+2  A: 

You can't stop the kernel from copying files. If you want to stop the user from copying files, then you need to write a hook that implements the ICopyHook interface.

Remy Lebeau - TeamB
A: 

I'm not sure what exactly you want to do, but if you are using CopyFile winapi, then you should look at CopyFileEx You can pass there lpProgressRoutine - pointer to your function, and then return from it PROGRESS_CANCEL when you want stop your file copy operation.

Also, starting from Vista, you can cancel sync. IO operations from different thread by CancelSynchronousIo, so you should be able to stop CopyFile operation.

kibab