2.2.6.2.1 Request

The TRANS2_FIND_FIRST2 request and response formats are special cases of the SMB_COM_TRANSACTION2 (section 2.2.4.46) SMB. Only the TRANS2_FIND_FIRST2 specifics are described here.

SMB_Parameters

WordCount (1 byte): This field MUST be 0x0F.

Words (30 bytes):

TotalDataCount (2 bytes): If no Trans2_Data is supplied, this field MUST be 0x0000. If Trans2_Parameters.InformationLevel is SMB_INFO_QUERY_EAS_FROM_LIST (see following), this field MUST be the total size of the extended attribute list.

SetupCount (1 byte): This field MUST be 0x01.

Setup (2 bytes): This field MUST be TRANS2_FIND_FIRST2 (0x0001).

Trans2_Parameters

 Trans2_Parameters
   {
   SMB_FILE_ATTRIBUTES SearchAttributes;
   USHORT              SearchCount;
   USHORT              Flags;
   USHORT              InformationLevel;
   ULONG               SearchStorageType;
   SMB_STRING          FileName;
   }


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

SearchAttributes

SearchCount

Flags

InformationLevel

SearchStorageType

FileName (variable)

...

SearchAttributes (2 bytes): File attributes to apply as a constraint to the file search. Exclusive search attributes (see section 2.2.1.2.4) can also be set.

SearchCount (2 bytes): The server MUST NOT return more entries than indicated by the value of this field.

Flags (2 bytes): This bit field contains flags used to request that the server manage the state of the transaction based on how the client attempts to traverse the results.

Name and bitmask

Description

SMB_FIND_CLOSE_AFTER_REQUEST

0x0001

Close the search after this request.

SMB_FIND_CLOSE_AT_EOS

0x0002

Close search when end of search is reached.

SMB_FIND_RETURN_RESUME_KEYS

0x0004

Return resume keys for each entry found.

SMB_FIND_CONTINUE_FROM_LAST

0x0008

Continue search from previous ending place.

SMB_FIND_WITH_BACKUP_INTENT

0x0010

Find with backup intent.

InformationLevel (2 bytes): This field contains an information level code, which determines the information contained in the response. The list of valid information level codes is specified in section 2.2.2.3.1. A client that has not negotiated long names support MUST request only SMB_INFO_STANDARD. If a client that has not negotiated long names support requests an InformationLevel other than SMB_INFO_STANDARD, the server MUST return a status of STATUS_INVALID_PARAMETER (ERRDOS/ERRinvalidparam).

SearchStorageType (4 bytes): The client MUST set this field to zero and the server MUST ignore it on receipt.

FileName (variable): The file pattern to search for. This field MAY contain wildcard characters.

Trans2_Data

The following Trans2_Data structure MUST be included if the Trans2_Parameters.InformationLevel field is set to SMB_INFO_QUERY_EAS_FROM_LIST; otherwise, it MUST NOT be included.

 Trans2_Data
   {
            
            
   SMB_GEA_LIST GetExtendedAttributeList;
   }


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

GetExtendedAttributeList (variable)

...

GetExtendedAttributeList (variable):  A list of extended attribute (EA) names. The value of the AttributeName fields MUST be used by the server to query the set of extended attributes that match the set of AttributeName values provided in this list.