سؤال

Given a UNC path like \\server\share, is there any way to determine, using the Win32 API, whether the local and remote computers are connecting using SMB or SMB2?

هل كانت مفيدة؟

المحلول

After burning a paid support incident, the official answer from Microsoft is that this information isn't exposed by the driver in Windows 7. On Windows 8 it's available using WMI and the MSFT_SmbConnection class, or PowerShell's Get-SmbConnection cmdlet.

نصائح أخرى

Maybe you can find the answer in the SMB2 specification.

Server Message Block (SMB) Protocol Versions 2 and 3 specification

There should be a way to detect the version... Maybe you can try to implement a minimal part of the SMB protocol just to ask the server the protocol version?

one of the easyest way to find is by taking a network trace using the wireshark (on windows) or tcptrace/tcpdump on the unix (where SMB is running). The trace output should give you the version

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top