My application is reading / writing data to removable media (USB DOK) in the background. The problem is that when you remove the USB while the application is running, the computer displays an error message:
Invalid volume
The wrong volume is in the drive. Insert the volume into drive E :.
Cancel attempt to continue again
This happens during operations such as GetFileSize, ReadFile. Obviously, since the application should run in the background, I would like to suppress these messages and worked silently.
BTW. It seems that the process sending these messages is not my process, but CSRSS.EXE (although the reason, of course, is the operation of my process).
One direction I'm considering is switching to NtQueryInformationFile, NtReadFile, etc., but I would rather not ...
thank
source
share