Hi, I have a SMB server that has a limited resources, I am trying to create a test using Windows APIs that creates a deep file tree.
I am looking for a WIN API that creates a file without asking for an oplock upon creation since I would like to create a file and close its handle immediately.
After investigation I found 2 relevant APIs, CreateFile(), which I used until now and CreateFile2() which can get additional flags such as FILE_FLAG_OPEN_REQUIRING_OPLOCK, however when using this API it seems that windows client ignores this flag and the request is the same (batch oplock still exists in the request).
I found a trick to break the oplock by moving/renaming the file after creation, but I am curious if there is any other elegant way or any other API that I can use in order to create a file without asking for an oplock upon request?