Compartilhar via


3.4.4.1 An RPC Client Application Opens a Named Pipe

The RPC client application provides:

  • The name of the server.

  • The name of the pipe.

  • Credentials to be used to connect to the server.

The client MUST first connect to the server as specified in section 3.2.4.2.1.

Next, the client MUST negotiate the protocol by any of the methods specified in [MS-SMB2] section 3.2.4.2.2, initially offering the highest protocol supported by the local client implementation.

If the negotiated protocol dialect is covered in [MS-CIFS] or in [MS-SMB], the client MUST:

  • Authenticate the user by invoking the processing logic specified in section 3.2.4.2.4, providing the credentials supplied by the caller; next, connect to the IPC$ share by invoking the processing logic specified in 3.2.4.2.5.

  • Open the named pipe by invoking the processing logic specified in section 3.2.4.5, supplying the following input parameters:

    • Client.TreeConnect: The ClientGenericContext.ProtocolSpecificOpen obtained in a preceding step.

    • Pathname: The name of the pipe supplied by the calling application.

    • Client.Session: The ClientGenericContext.ProtocolSpecificOpen obtained after the user authentication in a preceding step.

    • Access mode: Allow read and write operations.

    • Share Access: Allow read and write sharing.

    • Create disposition: If the file exists, open; otherwise, fail.

    • Create options: If the file is a directory, fail.

    • (Optional): Return the attributes and time stamps of the file in the response: FALSE.

    • (Optional): Return the total length of the file's extended attributes in the response: FALSE.

    • Open parent directory: FALSE.

    • Impersonation level: Impersonate.

    • Security flags: zero.

    • Optional allocation size: Not provided.

    • Timeout: zero.

    • Security descriptor: NULL

    • Request for an exclusive or batch OpLock: None.

If the negotiated protocol is that specified by [MS-SMB2], the client MUST:

  • Authenticate the user by invoking the processing logic specified in [MS-SMB2] section 3.2.4.2.3; next, connect to the IPC$ share by invoking the processing logic specified in [MS-SMB2] section 3.2.4.2.4.

  • Open the named pipe by invoking the processing logic specified in [MS-SMB2] section 3.2.4.3.1, supplying the following input parameters:

    • Client.TreeConnect: The ProtocolSpecificOpen obtained from ClientGenericContext in a preceding step.

    • Pathname: The name of the pipe supplied by the caller.

    • Client.Session: The ProtocolSpecificOpen obtained from ClientGenericContext in a preceding step.

    • Access mode: Allow read and write operations.

    • Sharing Mode: Allow read and write sharing.

    • Create disposition: If the file exists, open; otherwise, fail.

    • Create options: If the file is a directory, fail.

    • File attributes and flags: zero.

    • Impersonation level: Impersonate.

    • Security flags: zero.

    • OpLock or Lease state: None.

    • Create Contexts: None.

Any error incurred during the processing of the preceding steps MUST be returned to the caller.

Upon successful completion, a new ClientGenericContext structure MUST be initialized as follows and returned to the caller.

The ClientGenericContext.ProtocolDialect field MUST be set to an implementation-specific identifier indicating the protocol (either that specified by [MS-CIFS] or by [MS-SMB2]).

The ClientGenericContext.ProtocolSpecificOpen field MUST be set to the protocol-specific Client.Open returned from the processing logic specified in section 3.2.4.5 or in [MS-SMB2] section 3.2.4.3.1.