Cause of Excessive SMB2 FIND Requests When Writing Files to a Windows Server?

15 Views Asked by At

I have a Win32 application that runs on Windows 10 and writes files to a Windows Server 2016. It creates new files on the server and also opens binary files on the server, locks a portion of the files, and writes to the files. Then it releases the locks and closes the files.

In this process, we see in a network packet scan that we get many of these requests:

SMB2_FIND_ID_BOTH_DIRECTORY_INFO pattern: *

This causes the entire dir listing of the folder on the server we're writing to to be sent back to the client machine. Our application makes no such requests, and we don't know where they are coming from. These directory listings can contain thousands of files and are putting a big load on our network bandwidth--so much so that our application can't keep up with the work it has to do in writing files.

We suspected that Windows Defender might be the cause, but we turned Defender off and that did not make a difference.

Is this possibly just a function of the SMB2 protocol? Is the server sending back these directory listings just automatic responses to the file opens and writes that we are doing?

Can someone refer me to the SMB2 documentation that explains this behavior of the constant SMB2 FIND requests?

Is there any way to stop these directory listings from being sent?

Tried network packet capture and could not find the cause of the SMB2 FIND requests.

Tried removing Windows Defender.

0

There are 0 best solutions below