WriteFile return access denied?
-
WriteFile return access denied? while i providing admin privileges please help me for this.
HANDLE hCD = CreateFile (file_Name, GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
NULL);WriteFile (hCD, Buffer, Size, &bytesWritten, NULL);
its fails with access denied.
thanks in advance.
-
WriteFile return access denied? while i providing admin privileges please help me for this.
HANDLE hCD = CreateFile (file_Name, GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
NULL);WriteFile (hCD, Buffer, Size, &bytesWritten, NULL);
its fails with access denied.
thanks in advance.
-
Check the file name and make sure that it is where you think it is, and is not protected against write access.
-
I just tried your actual code on my system and it works fine, so the problem must definitely be something to do with the file or its location.
-
WriteFile return access denied? while i providing admin privileges please help me for this.
HANDLE hCD = CreateFile (file_Name, GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
NULL);WriteFile (hCD, Buffer, Size, &bytesWritten, NULL);
its fails with access denied.
thanks in advance.
Two things First you are a person which has specific access to the file system. Your application is not you. The access it has depends on how it runs. You as a person are likely checking the access but that does not mean the application has it. Second the directories also determine access. You can programmatically request information about permissions. Write some code that returns that information from EACH level of the directory tree including the drive letter. Then inspect that.