In this case, is unable to open one and the same file for read/write and read-only.
Code: Select all
Debug OpenFile(2, "C:\Test.txt", #PB_File_SharedRead)
Debug ReadFile(0, "C:\Test.txt" , #PB_File_SharedRead|#PB_File_SharedWrite) ; #PB_File_SharedWrite not supported!
Code: Select all
; Read / Write.
Debug CreateFile_("C:\Test.txt", #GENERIC_READ|#GENERIC_WRITE, #FILE_SHARE_READ, 0, #OPEN_ALWAYS, #FILE_ATTRIBUTE_NORMAL, 0)
; Read only.
Debug CreateFile_("C:\Test.txt", #GENERIC_READ, #FILE_SHARE_READ|#FILE_SHARE_WRITE, 0, #OPEN_EXISTING, #FILE_ATTRIBUTE_NORMAL, 0)