Partager via


2.2.4.3.1 Request

 SMB_Parameters
   {
   UCHAR  WordCount;
   Words
     {
     USHORT              AccessMode;
     SMB_FILE_ATTRIBUTES SearchAttributes;
     }
   }
 SMB_Data
   {
   USHORT ByteCount;
   Bytes
     {
     UCHAR      BufferFormat;
     SMB_STRING FileName;
     }
   }
  

SMB_Header:

Flags (1 byte):

Name and bitmask

Description

SMB_FLAGS_OPLOCK

0x20

If set, the client is requesting an Exclusive Opportunistic Lock (OpLock) on the file.

SMB_FLAGS_OPBATCH

0x40

If set, the client is requesting a Batch Exclusive OpLock on the file. The SMB_FLAGS_OPLOCK bit MUST be set if this bit is set.


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

SMB_Parameters

...

SMB_Data (variable)

...

SMB_Parameters (5 bytes):


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

WordCount

Words

...

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

Words (4 bytes): The message-specific parameters structure.


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

AccessMode

SearchAttributes

AccessMode (2 bytes): A 16-bit field for encoding the requested access mode. See section 3.2.4.5.1 for a discussion on sharing modes.

Name and bitmask

Values

Meaning

AccessMode

0x0007

0

Open for reading

1

Open for writing

2

Open for reading and writing

3

Open for execution

4-7

Reserved. For compatibility with older dialects, the server MUST return STATUS_OS2_INVALID_ACCESS (ERRDOS/ERRbadaccess) if these values are requested.

0x0008

Reserved. MUST be ignored by the server.

SharingMode

0x0070

0

Compatibility mode

1

Deny read/write/execute to others (exclusive use requested)

2

Deny write to others

3

Deny read/execute to others

4

Deny nothing to others

0x0080

Reserved

ReferenceLocality

0x0700

0

Unknown locality of reference

1

Mainly sequential access

2

Mainly random access

3

Random access with some locality

4-7

Undefined

0x0800

Reserved

CacheMode

0x1000

0

Perform caching on file

1

Do not cache the file

0x2000

Reserved

WritethroughMode

0x4000

0

Write-through mode. If this bit is set, no read ahead or write behind is allowed on this file or device. When the response is returned, data is expected to be on the disk or device.

1

0x8000

Reserved

SearchAttributes (2 bytes): Specifies the type of file. This field is used as a search mask. Both the FileName and the SearchAttributes of a file MUST match in order for the file to be opened.<28>

SMB_Data (variable):


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

ByteCount

Bytes (variable)

...

ByteCount (2 bytes): This field MUST be greater than or equal to 0x0002.

Bytes (variable): The message-specific data structure, which follows.


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

BufferFormat

FileName (variable)

...

BufferFormat (1 byte): A buffer format identifier. The value of this field MUST be 0x04.

FileName (variable): A null-terminated string containing the file name of the file to be opened.