المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : WriteFile() API failed and GetLastError return 0x05 value.



C++ Programming
08-10-2010, 09:40 PM
I am writing to a USB device using the WriteFile() API in synchrounos mode but it returns 0x05
error code which means that access is denied.This error occur on Windows 7 though i am an administrator.

The following is the code i am working with it.

CreateFile() successfully create a file.

then I check via DeviceIoControl()that disk is write able , it return true.

and after that when i write via WriteFile() , the api fails and return.


Any help would be appreciated.