Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello, Guys!

I have small question about 2 parameters of IoCreateFile. What means combination of DesiredAccess = SYNCHRONIZE and ShareAccess = 0? Is it full access to the file, can I read and write to file opened only with this flags?

Thanks!
Posted

to know the mean of DesiredAccess values go there http://www.osronline.com/ddkx/kmarch/k111_9dte.htm[^]

share access:is means what to shared between threads on the program

FILE_SHARE_READ : all threads can read this file
FILE_SHARE_WRITE : all threads can write on this file
FILE_SHARE_DELETE : all threads can delete this file
 
Share this answer
 
Comments

The following standard specific access rights apply to all types of executive objects.


DELETE The caller can delete the object.

READ_CONTROL The caller can read the access control list (ACL) and ownership information for the file.

SYNCHRONIZE The caller can perform a wait operation on the object. (For example, the object can be passed to KeWaitForMultipleObjects.)

WRITE_DAC The caller can change the discretionary access control list (DACL) information for the object.

WRITE_OWNER The caller can change the ownership information for the file.

-----------------------------------------------------------------------------
ShareAccess
Specifies the type of share access that the caller would like to the file, as zero, or as one or a combination of the following:

ShareAccess flags Meaning

FILE_SHARE_READ The file can be opened for read access by other threads' calls to IoCreateFile.

FILE_SHARE_WRITE The file can be opened for write access by other threads' calls to IoCreateFile.

FILE_SHARE_DELETE The file can be opened for delete access by other threads' calls to IoCreateFile
 
Share this answer
 

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