question

WebDAV-4685 avatar image
0 Votes"
WebDAV-4685 asked XiaopoYang-MSFT answered

How to detect the file sharing mode in FILE_OPEN_COMPLETION callback in Cloud Filter API?

How do we detect the file sharing mode inside the CF_CALLBACK_TYPE_NOTIFY_FILE_OPEN_COMPLETION callback in Cloud Filter API?

In the case the file is opened with FILE_SHARE_READ or FILE_SHARE_NONE we need to do certain operations in our back-end storage. Is it possible to detect the file sharing mode?

@XiaopoYang-MSFT @RitaHan-MSFT @FeiXue-MSFT

windows-api
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The NtQueryInformationFile function requires a file handle. But we do not have a file handle inside the CF_CALLBACK_TYPE_NOTIFY_FILE_OPEN_COMPLETION as far as I understand. Or can we obtain the file handle inside the FILE_OPEN_COMPLETION call?

0 Votes 0 ·

1 Answer

XiaopoYang-MSFT avatar image
0 Votes"
XiaopoYang-MSFT answered

Any application can open the file with different dwShareMode which triggers the CF_CALLBACK_TYPE_NOTIFY_FILE_OPEN_COMPLETION callback. It‘s impossible to detect the file sharing mode for no handle in the callback.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.