5.0 SMB Symbolic Constants

5.1 SMB Command Codes

The following values have been assigned for the SMB Commands.

SMB_COM_CREATE_DIRECTORY 0x00
SMB_COM_DELETE_DIRECTORY 0x01
SMB_COM_OPEN 0x02
SMB_COM_CREATE 0x03
SMB_COM_CLOSE 0x04
SMB_COM_FLUSH 0x05
SMB_COM_DELETE 0x06
SMB_COM_RENAME 0x07
SMB_COM_QUERY_INFORMATION 0x08
SMB_COM_SET_INFORMATION 0x09
SMB_COM_READ 0x0A
SMB_COM_WRITE 0x0B
SMB_COM_LOCK_BYTE_RANGE 0x0C
SMB_COM_UNLOCK_BYTE_RANGE 0x0D
SMB_COM_CREATE_TEMPORARY 0x0E
SMB_COM_CREATE_NEW 0x0F
SMB_COM_CHECK_DIRECTORY 0x10
SMB_COM_PROCESS_EXIT 0x11
SMB_COM_SEEK 0x12
SMB_COM_LOCK_AND_READ 0x13
SMB_COM_WRITE_AND_UNLOCK 0x14
SMB_COM_READ_RAW 0x1A
SMB_COM_READ_MPX 0x1B
SMB_COM_READ_MPX_SECONDARY 0x1C
SMB_COM_WRITE_RAW 0x1D
SMB_COM_WRITE_MPX 0x1E
SMB_COM_WRITE_COMPLETE 0x20
SMB_COM_SET_INFORMATION2 0x22
SMB_COM_QUERY_INFORMATION2 0x23
SMB_COM_LOCKING_ANDX 0x24
SMB_COM_TRANSACTION 0x25
SMB_COM_TRANSACTION_SECONDARY 0x26
SMB_COM_IOCTL 0x27
SMB_COM_IOCTL_SECONDARY 0x28
SMB_COM_COPY 0x29
SMB_COM_MOVE 0x2A
SMB_COM_ECHO 0x2B
SMB_COM_WRITE_AND_CLOSE 0x2C
SMB_COM_OPEN_ANDX 0x2D
SMB_COM_READ_ANDX 0x2E
SMB_COM_WRITE_ANDX 0x2F
SMB_COM_CLOSE_AND_TREE_DISC 0x31
SMB_COM_TRANSACTION2 0x32
SMB_COM_TRANSACTION2_SECONDARY 0x33
SMB_COM_FIND_CLOSE2 0x34
SMB_COM_FIND_NOTIFY_CLOSE 0x35
SMB_COM_TREE_CONNECT 0x70
SMB_COM_TREE_DISCONNECT 0x71
SMB_COM_NEGOTIATE 0x72
SMB_COM_SESSION_SETUP_ANDX 0x73
SMB_COM_LOGOFF_ANDX 0x74
SMB_COM_TREE_CONNECT_ANDX 0x75
SMB_COM_QUERY_INFORMATION_DISK 0x80
SMB_COM_SEARCH 0x81
SMB_COM_FIND 0x82
SMB_COM_FIND_UNIQUE 0x83
SMB_COM_NT_TRANSACT 0xA0
SMB_COM_NT_TRANSACT_SECONDARY 0xA1
SMB_COM_NT_CREATE_ANDX 0xA2
SMB_COM_NT_CANCEL 0xA4
SMB_COM_OPEN_PRINT_FILE 0xC0
SMB_COM_WRITE_PRINT_FILE 0xC1
SMB_COM_CLOSE_PRINT_FILE 0xC2
SMB_COM_GET_PRINT_QUEUE 0xC3
SMB_COM_READ_BULK 0xD8
SMB_COM_WRITE_BULK 0xD9
SMB_COM_WRITE_BULK_DATA 0xDA

5.2 SMB_COM_TRANSACTION2 Subcommand Codes

The subcommand code for SMB_COM_TRANSACTION2 request is placed in Setup[0]. The parameters associated with any particular request are placed in the Parameters vector of the request. The defined subcommand codes are:

Setup[0] Transaction2
Subcommand Code
===================
Value

====
Description

========================
TRANS2_OPEN2 0x00 Create file with extended attributes
TRANS2_FIND_FIRST2 0x01 Begin search for files
TRANS2_FIND_NEXT2 0x02 Resume search for files
TRANS2_QUERY_FS_INFORMATION 0x03 Get file system information
0x04 Reserved
TRANS2_QUERY_PATH_INFORMATION 0x05 Get information about a named file or directory
TRANS2_SET_PATH_INFORMATION 0x06 Set information about a named file or directory
TRANS2_QUERY_FILE_INFORMATION 0x07 Get information about a handle
TRANS2_SET_FILE_INFORMATION 0x08 Set information by handle
TRANS2_FSCTL 0x09 Not implemented by NT server
TRANS2_IOCTL2 0x0A Not implemented by NT server
TRANS2_FIND_NOTIFY_FIRST 0x0B Not implemented by NT server
TRANS2_FIND_NOTIFY_NEXT 0x0C Not implemented by NT server
TRANS2_CREATE_DIRECTORY 0x0D Create directory with extended attributes
TRANS2_SESSION_SETUP 0x0E Session setup with extended security information
TRANS2_GET_DFS_REFERRAL 0x10 Get a Dfs referral
TRANS2_REPORT_DFS_INCONSISTENCY 0x11 Report a Dfs knowledge inconsistency

5.3 SMB_COM_NT_TRANSACTION Subcommand Codes

For these transactions, Function in the primary client request indicates the operation to be performed. It may assume one of the following values:

SubCommand Code
=======================
Value
===
Description
=================
NT_TRANSACT_CREATE 1 File open/create
NT_TRANSACT_IOCTL 2 Device IOCTL
NT_TRANSACT_SET_SECURITY_DESC 3 Set security descriptor
NT_TRANSACT_NOTIFY_CHANGE 4 Start directory watch
NT_TRANSACT_RENAME 5 Reserved (Handle-based rename)
NT_TRANSACT_QUERY_SECURITY_DESC 6 Retrieve security descriptor info

5.4 SMB Protocol Dialect Constants

This is the list of CIFS protocol dialects, ordered from least functional (earliest) version to most functional (most recent) version:

Dialect Name
==================
Comment
==========================
PC NETWORK PROGRAM 1.0 This is the original MSNET SMB protocol (otherwise known as the "core protocol").
PCLAN1.0 Some versions of the original MSNET defined this as an alternate to the core protocol name.
MICROSOFT NETWORKS 1.03 This is used for the MS-NET 1.03 product. It defines Lock&Read,Write&Unlock, and a special version of raw read and raw write.
MICROSOFT NETWORKS 3.0 This is the DOS LANMAN 1.0 specific protocol. It is equivalent to the LANMAN 1.0 protocol, except the server is required to map errors from the OS/2 error to an appropriate DOS error.
LANMAN1.0 This is the first version of the full LANMAN 1.0 protocol.
LM1.2X002 This is the first version of the full LANMAN 2.0 protocol.
DOS LM1.2X002 This is the DOS equivalent of the LM1.2X002 protocol. It is identical to the LM1.2X002 protocol, but the server will perform error mapping to appropriate DOS errors.
DOS LANMAN2.1 DOS LANMAN2.1
LANMAN2.1 OS/2 LANMAN2.1
Windows for Workgroups 3.1a Windows for Workgroups Version 1.0
NT LM 0.12 This is the SMB protocol designed for NT networking. It has special SMBs that duplicate the NT semantics.

CIFS servers select the most recent version of the protocol known to both client and server. Any CIFS server that supports dialects newer than the original core dialect must support all the messages and semantics of the dialects between the core dialect and the newer one. In other words, a server that supports the NT LM 0.12 dialect must also support all messages of the previous 10 dialects. It is the client's responsibility to ensure that it only sends SMBs that are appropriate to the dialect negotiated. Clients must be prepared to receive an SMB response from an earlier protocol dialect—even if the client used the most recent form of the request.