You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Why is GENERC_WRITE flag set like this in dokan.c ? #1285
Another question, if I want to use outDesiredAccess(mean genericDesiredAccess in func mirrorCreateFile) and outDesiredAccess(mean creationDisposition in func mirrorCreateFile) to determine whether the operation in the current mirrorCreateFile is a write operation, what should I do? Please give me some advice. Thank u so much
Why not use "if ((*outDesiredAccess & FILE_GENERIC_WRITE) !=0) " ?
This function is a helper to map the kernel FILE_GENERIC_WRITE to GENERIC_WRITE SYNCHRONIZE is present in all ``FILE_GENERIC_, if we would do !=0` , all `GENERIC_` would be set.
I agree that maybe something better could be done here for when `FILE_GENERIC_` isn't set but `FILE_WRITE_DATA` only is set 👍
determine whether the operation in the current mirrorCreateFile is a write operation, what should I do?
Why not use "if ((*outDesiredAccess & FILE_GENERIC_WRITE) !=0) " ?
This function is a helper to map the kernel FILE_GENERIC_WRITE to GENERIC_WRITESYNCHRONIZE is present in all ``FILE_GENERIC__, if we would do !=0` , all `GENERIC__` would be set. I agree that maybe something better could be done here for when `FILE_GENERIC_` isn't set but `FILE_WRITE_DATA` only is set 👍
determine whether the operation in the current mirrorCreateFile is a write operation, what should I do?
Thks for your reply. I have implemented a read-write separation demo based on mirror. c and implemented COW. However, I am currently experiencing an issue. While testing Steam CS2, the game entered normally and the human-machine battle started normally. But once real person matching is performed, there will be the following situations:
If there is only one real person in the current battle (including me, there are two real people, and the rest are robots), the game is normal
But once multiple real people are matched in the battle, the game will immediately not respond(looklike hangup).
Is there any good troubleshooting idea for this?
PS:
I used processMonitor to filter cs2 process operations that are not 'Success', the output is
QueryDirectory
CreateFile
ReadFile
RegQueryValue
FileSystemControl
RegOpenKey
The operation of Reg can be ignored. I found that there is a FileSystemControl part, why doesn't Dokany need to map it?
In the same environment, there is no such problem when starting a real person battle of "League of Legends (LOL)".
This has been bothering me for a long time, looking forward to your reply :-)
Add another piece of information:
1、The above situation of CS2 occurs in the lower layer (rootDir) where it is RO disk
If the lower layer (rootDir) is RW disk, there won't be any problem.
At first, I thought it was a read-write separation problem, such as attempting to write a read-only file causing a hang up. But I found that in RW disk, the game runs normally until the end, and the files in the entire lower layer have not been changed (I used the "everything" tool to analyze the file modification time of the latest modified lower directory)
2、param is : mirror.exe /o /m /l e /f /p
Activity
lymGitHub0123 commentedon Apr 17, 2025
Another question, if I want to use outDesiredAccess(mean genericDesiredAccess in func mirrorCreateFile) and outDesiredAccess(mean creationDisposition in func mirrorCreateFile) to determine whether the operation in the current mirrorCreateFile is a write operation, what should I do? Please give me some advice. Thank u so much
Liryna commentedon Apr 17, 2025
This function is a helper to map the kernel
FILE_GENERIC_WRITEtoGENERIC_WRITESYNCHRONIZEis present in all ``FILE_GENERIC_, if we would do!=0` , all `GENERIC_` would be set.I agree that maybe something better could be done here for when `FILE_GENERIC_` isn't set but `FILE_WRITE_DATA` only is set 👍
https://github.com/dokan-dev/dokany/blob/master/samples/dokan_memfs/memfs_operations.cpp#L140-L154
and you can check desiredaccess against
FILE_GENERIC_WRITEand other bit it is composed of https://learn.microsoft.com/en-us/windows/win32/fileio/file-security-and-access-rightslymGitHub0123 commentedon Apr 27, 2025
Thks for your reply. I have implemented a read-write separation demo based on mirror. c and implemented COW. However, I am currently experiencing an issue. While testing Steam CS2, the game entered normally and the human-machine battle started normally. But once real person matching is performed, there will be the following situations:
Is there any good troubleshooting idea for this?
PS:
QueryDirectory
CreateFile
ReadFile
RegQueryValue
FileSystemControl
RegOpenKey
The operation of Reg can be ignored. I found that there is a FileSystemControl part, why doesn't Dokany need to map it?
This has been bothering me for a long time, looking forward to your reply :-)
lymGitHub0123 commentedon Apr 27, 2025
Add another piece of information:
1、The above situation of CS2 occurs in the lower layer (rootDir) where it is RO disk
If the lower layer (rootDir) is RW disk, there won't be any problem.
At first, I thought it was a read-write separation problem, such as attempting to write a read-only file causing a hang up. But I found that in RW disk, the game runs normally until the end, and the files in the entire lower layer have not been changed (I used the "everything" tool to analyze the file modification time of the latest modified lower directory)
2、param is : mirror.exe /o /m /l e /f /p