home *** CD-ROM | disk | FTP | other *** search
/ ftp.microsoft.com / 2002-07-02_ftp.microsoft.com.zip / developr / drg / CIFS / SMB.TXT < prev    next >
Text File  |  1990-11-30  |  149KB  |  4,706 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                      MMMMiiiiccccrrrroooossssoooofffftttt NNNNeeeettttwwwwoooorrrrkkkkssss
  11.  
  12.             SSSSMMMMBBBB FFFFIIIILLLLEEEE SSSSHHHHAAAARRRRIIIINNNNGGGG PPPPRRRROOOOTTTTOOOOCCCCOOOOLLLL EEEEXXXXTTTTEEEENNNNSSSSIIIIOOOONNNNSSSS
  13.  
  14.  
  15.       SSSSMMMMBBBB FFFFiiiilllleeee SSSShhhhaaaarrrriiiinnnngggg PPPPrrrroooottttooooccccoooollll EEEExxxxtttteeeennnnssssiiiioooonnnnssss VVVVeeeerrrrssssiiiioooonnnn 3333....0000
  16.  
  17.  
  18.  
  19.                    DDDDooooccccuuuummmmeeeennnntttt VVVVeeeerrrrssssiiiioooonnnn 1111....00009999
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.                      NNNNoooovvvveeeemmmmbbbbeeeerrrr 22229999,,,, 1111999988889999
  27.  
  28.  
  29.                    Microsoft Corporation
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SMB Protocol Extensions    - 2 -           November 29, 1989
  71.  
  72.  
  73. _1.  _I_N_T_R_O_D_U_C_T_I_O_N
  74.  
  75. This document defines extensions to the LANMAN 1.0 Microsoft
  76. file  sharing  protocol  as  defined in the SMB File Sharing
  77. Protocol Extension version 2.0 , document version  3.2,  and
  78. the  OenNet/Microsoft  Networks File Sharing Protocol (Intel
  79. PN 136329-001) (sometimes referred to as the  "core"  proto-
  80. col).  These extensions are primarily to provide support for
  81. Operating Systems which use installable  file  systems.  The
  82. support  for  installable file systems require that extended
  83. attribute data blocks, of potentially greater  size  than  a
  84. negotiated  buffer, are supplied with requests that could be
  85. transported in a negotiated buffer in the LANMAN 1.0 enviro-
  86. ment.  The extended file sharing protocol is not intended to
  87. be specific to OS/2.  It is anticipated that other Operating
  88. Systems  will  have  many similar requirements and that they
  89. will use the same services and protocols to meet them.
  90.  
  91. This extension, when combined with the LANMAN 1.0  and  core
  92. protocol,  allows  all  file oriented OS/2 version 1.2 func-
  93. tions to be performed on remote files using LANMAN 1.2.
  94.  
  95. The extended protocol defined in this document  is  selected
  96. by the dialect string "LANMAN1.2" in the core protocol nego-
  97. tiate request.
  98.  
  99. Acronyms used include:
  100.  
  101.  
  102. VC   - Virtual Circuit.  A transport level connection (some-
  103.      times  called a session) between two networked machines
  104.      (nodes).
  105.  
  106. TID  - Tree Identifier.  A token representing an instance of
  107.      authenticated use of a network resource (often a shared
  108.      subdirectory tree structure).
  109.  
  110. UID  - User Identifier.  A token representing  an  authenti-
  111.      cated user of a network resource.
  112.  
  113. PID  - Process Identifier.  A number which uniquely  identi-
  114.      fies a process on a node.
  115.  
  116. MID  - Multiplex Identifier.  A number which uniquely  iden-
  117.      tifies  a  protocol  request and response within a pro-
  118.      cess.
  119.  
  120. FID  -  File  Identifier.   A  number  which  identifies  an
  121.      instance  of  an open file ( sometimes called file han-
  122.      dle).
  123.  
  124. T.B.D.- To Be Defined.  Further detail will be provided at a
  125.      later time.
  126.  
  127.  
  128.  
  129.  
  130. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  131.  
  132.  
  133.  
  134.  
  135.  
  136. SMB Protocol Extensions    - 3 -           November 29, 1989
  137.  
  138.  
  139. MBZ  - Must Be Zero.  All reserved fields  must  be  set  to
  140.      zero by the consumer.
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  197.  
  198.  
  199.  
  200.  
  201.  
  202. SMB Protocol Extensions    - 4 -           November 29, 1989
  203.  
  204.  
  205. _2.  _M_E_S_S_A_G_E _F_O_R_M_A_T
  206.  
  207. All messages sent while using the  extended  protocol  (both
  208. the  core  messages used and the additional messages defined
  209. in this document) will have the following format.
  210.  
  211. BYTE   smb_idf[4];   /* contains 0xFF,'SMB' */
  212. BYTE   smb_com;      /* command code */
  213. BYTE   smb_rcls;     /* error class */
  214. BYTE   smb_reh;      /* reserved for future */
  215. WORD   smb_err;      /* error code */
  216. BYTE   smb_flg;      /* flags */
  217. WORD   smb_flg2;     /* flags */
  218. WORD   smb_res[6];   /* reserved for future */
  219. WORD   smb_tid;      /* authenticated resource identifier */
  220. WORD   smb_pid;      /* caller's process id */
  221. WORD   smb_uid;      /* authenticated user id */
  222. WORD   smb_mid;      /* multiplex id */
  223. BYTE   smb_wct;      /* count of 16-bit words that follow */
  224. WORD   smb_vwv[];    /* variable number of 16-bit words */
  225. WORD   smb_bcc;      /* count of bytes that follow */
  226. BYTE   smb_buf[];    /* variable number of bytes */
  227.  
  228.  
  229. The structure defined from smb_idf through  smb_wct  is  the
  230. fixed  portion of the SMB structure sometimes referred to as
  231. the SMB header.  Following the header there  is  a  variable
  232. number  of  words (defined by smb_wct) and following that is
  233. smb_bcc which  defines  an  additional  variable  number  of
  234. bytes.
  235.  
  236.  
  237.         A BYTE is 8 bits.
  238.         A WORD is two BYTEs.
  239.         The BYTEs within a WORD are ordered such that the low BYTE precedes the high
  240.         BYTE.
  241.         A DWORD is two WORDs.
  242.         The WORDs within a DWORD are ordered such that the low WORD precedes the
  243.         high WORD.
  244.  
  245.  
  246. smb_com: - command code.
  247.  
  248. smb_rcls: - error class (see below).
  249.  
  250. smb_ret: - error returned (see below).
  251.  
  252. smb_tid: - Used by the server to identify a resource  (e.g.,
  253.      a disk sub-tree).  (see below)
  254.  
  255. smb_pid: - caller's process id.  Generated by  the  consumer
  256.      (redirector)  to uniquely identify a process within the
  257.      consumer's system.  A response message will always con-
  258.      tain  the same value in smb_pid (and smb_mid) as in the
  259.  
  260.  
  261.  
  262. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  263.  
  264.  
  265.  
  266.  
  267.  
  268. SMB Protocol Extensions    - 5 -           November 29, 1989
  269.  
  270.  
  271.      corresponding request message.
  272.  
  273. smb_mid: - this field is used for multiplexing multiple mes-
  274.      sages  on  a  single Virtual Circuit (VC) normally when
  275.      multiple requests are from the same  process.  The  PID
  276.      (in smb_pid) and the MID (in smb_mid) uniquely identify
  277.      a request and are used by  the  consumer  to  correlate
  278.      incoming responses to previously sent requests.
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  329.  
  330.  
  331.  
  332.  
  333.  
  334. SMB Protocol Extensions    - 6 -           November 29, 1989
  335.  
  336.  
  337. _3.  _N_O_T_E_S:
  338.  
  339. 1.   smb_flg can have the following values:
  340.  
  341. bit0 - When set (returned) from the server in the  Negotiate
  342.      response  protocol,  this bit indicates that the server
  343.      supports the "sub dialect" consisting  of  the  Lockan-
  344.      dRead  and  WriteandUnlock protocols defined in the SMB
  345.      File Sharing Protocol Extension version 2.0 ,  document
  346.      version 3.2
  347.  
  348.  
  349. bit1 - When on (on a protocol  request  being  sent  to  the
  350.      server),  the  consumer  guarantees  that  there  is  a
  351.      receive buffer posted such that a "Send.No.Ack" can  be
  352.      used  by  the  server  to  respond  to  the  consumer's
  353.      request.  The LANMAN 1.2 Redirector for OS/2  will  not
  354.      set this bit.
  355.  
  356.  
  357. bit2 - Reserved (must be zero).
  358.  
  359.  
  360.  
  361. bit3 - When on,  all  pathnames  in  the  protocol  must  be
  362.      treated  as caseless.  When off, the pathnames are case
  363.      sensitive.  This allows forwarding of the protocol mes-
  364.      sage  on various extended VCs where caseless may not be
  365.      the norm.  The LANMAN  1.2  Redirector  for  OS/2  will
  366.      always have this bit on to indicate caseless pathnames.
  367.  
  368.  
  369. bit4 - When on (on the Session Setup and X protocol  defined
  370.      later  in  this document), all paths sent to the server
  371.      by the consumer are already in the canonicalized format
  372.      used by OS/2.  This means that file/directory names are
  373.      in upper case, are valid characters and backslashes are
  374.      used as seperators.
  375.  
  376.  
  377. bit5 - When on (on core  protocols  Open,  Create  and  Make
  378.      New),  this  indicates  that the consumer is requesting
  379.      that the file be "opportunisticaly" locked if this pro-
  380.      cess is the only process which has the file open at the
  381.      time of the open request.  If the server "grants"  this
  382.      oplock  request, then this bit should remain set in the
  383.      coresponding response protocol to indicate to the  con-
  384.      sumer that the oplock request was granted. See the dis-
  385.      cussion of "oplock" in the sections defining the  "Open
  386.      and  X"  and  "Locking  and  X" protocols later in this
  387.      document (this bit has the same function as  bit  1  of
  388.      smb_flags of the "Open and X" protocol).
  389.  
  390.  
  391.  
  392.  
  393.  
  394. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  395.  
  396.  
  397.  
  398.  
  399.  
  400. SMB Protocol Extensions    - 7 -           November 29, 1989
  401.  
  402.  
  403. bit6 - When on (on core  protocols  Open,  Create  and  Make
  404.      New),  this indicates that the server should notify the
  405.      consumer on  any  action  which  can  modify  the  file
  406.      (delete,  setattrib,  rename,  etc.).   If not set, the
  407.      server need only notify the consumer  on  another  open
  408.      request.   See  the  discussion of "oplock" in the sec-
  409.      tions defining the "Open and X"  and  "Locking  and  X"
  410.      protocols later in this document (this bit has the same
  411.      function as bit 2 of smb_flags of the "Open and X" pro-
  412.      tocol).
  413.  
  414.  
  415. bit7 - When on, this protocol is being sent from the  server
  416.      in  response  to  a consumer request. The smb_com (com-
  417.      mand) field usually contains the same value in a proto-
  418.      col  request  from the consumer to the server as in the
  419.      matching response from  the  server  to  the  consumer.
  420.      This   bit   unambiguously  distinguishes  the  command
  421.      request from the command response.  On a multiplexed VC
  422.      on  a  node  where both server and consumer are active,
  423.      this bit can be used by the node's SMB delivery  system
  424.      to help identify whether this protocol should be routed
  425.      to a waiting consumer process or to the server.
  426.  
  427.  
  428. 2.   smb_flg2 can have the following values:
  429.  
  430.  
  431. bit0 - When set by the  consumer,  the  running  application
  432.      understands OS/2 1.2 style file names.
  433.  
  434.  
  435. bit1 - When set by the  consumer,  the  running  application
  436.      understands extended attributes.
  437.  
  438.  
  439. bit2 through bit15 - Reserved (MBZ).
  440.  
  441.  
  442. 3.   smb_uid is the user identifier.  It is used by the LAN-
  443.      MAN  1.0 extended protocol when the server is executing
  444.      in "user level security mode"  to  validate  access  on
  445.      protocols  which  reference  symbolicly named resources
  446.      (such as file open).  Thus  differing  users  accessing
  447.      the  same  TID  may  be granted differing access to the
  448.      resources defined by the TID based on smb_uid. The  UID
  449.      is returned by the server via the Session Set Up proto-
  450.      col.  This UID must be used in all SMB's following Ses-
  451.      sion Set Up And X.
  452.  
  453.  
  454. 4.   In the LANMAN 1.2 extended protocol environment the TID
  455.      represents  an instance of an authenticated use.   This
  456.      is the result of a successful NET USE to a server using
  457.  
  458.  
  459.  
  460. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  461.  
  462.  
  463.  
  464.  
  465.  
  466. SMB Protocol Extensions    - 8 -           November 29, 1989
  467.  
  468.  
  469.      a valid netname and password (if any).
  470.  
  471.      If the server is executing in a "share  level  security
  472.      mode",  the  tid is the only thing used to allow access
  473.      to the shared resource.  Thus if the user  is  able  to
  474.      perform  a  successful NET USE to the server specifying
  475.      the  appropriate  netname  and  passwd  (if  any)   the
  476.      resource may be accessed according to the access rights
  477.      associated with the shared resource (same for  all  who
  478.      gained access this way).
  479.  
  480.      If however the server is executing in "user level secu-
  481.      rity  mode", access to the resource is based on the UID
  482.      (validated on the Session Setup protocol) and  the  TID
  483.      is NOT associated with access control but rather merely
  484.      defines the resource  (such  as  the  shared  directory
  485.      tree).
  486.  
  487.      In most SMB protocols, smb_tid  must  contain  a  valid
  488.      TID.   Exceptions  include prior to getting a TID esta-
  489.      blished    including    NEGOTIATE,    TREE     CONNECT,
  490.      SESS_SETUPandX   and  TREE_CONNandX  protocols.   Other
  491.      exceptions include QUERY_SRV_INFO  some  forms  of  the
  492.      TRANSACTION  protocol  and ECHO.  A NULL TID is defined
  493.      as 0xFFFF. The server is responsible for enforcing  use
  494.      of a valid TID where appropriate.
  495.  
  496.  
  497. 5.   As in the core, smb_pid uniquely identifies a  consumer
  498.      process.  Consumers inform servers of the creation of a
  499.      new process by simply introducing a new  smb_pid  value
  500.      into the dialogue (for new processes).
  501.  
  502.      In the core protocol however, the "Process Exit" proto-
  503.      col  was  used to indicate the catastrophic termination
  504.      of a process (or session).  In the single  tasking  DOS
  505.      system,  it was possible for hard errors to occur caus-
  506.      ing the destruction of the process with files remaining
  507.      open.   Thus  a Process Exit protocol was used for this
  508.      occurrence to allow  the  server  to  close  all  files
  509.      opened by that process.
  510.  
  511.      In the LANMAN 1.2 extended protocol, no "Process  Exit"
  512.      protocol  will  be  sent.   The  operating  system will
  513.      ensure that the "close Protocol" will be sent when  the
  514.      last  process referencing the file closes it.  From the
  515.      server's point of view, there is  no  concept  of  FIDs
  516.      "belonging to" processes.  A FID returned by the server
  517.      to one process may be used by any other  process  using
  518.      the  same  VC and TID. There is no "birth announcement"
  519.      (no "fork" protocol) sent to the server.  It is  up  to
  520.      the consumer to ensure only valid processes gain access
  521.      to FIDs (and TIDs).  On TREE DISCONNECT (or when the VC
  522.      environment  is  terminated)  the server may invalidate
  523.  
  524.  
  525.  
  526. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  527.  
  528.  
  529.  
  530.  
  531.  
  532. SMB Protocol Extensions    - 9 -           November 29, 1989
  533.  
  534.  
  535.      any files opened by any process within the VC  environ-
  536.      ment using that TID.
  537.  
  538.  
  539. 6.   Systems using the LANMAN  1.2  extended  protocol  will
  540.      typically be multi-tasked and will allow multiple asyn-
  541.      chronous input/output requests per task.   Therefore  a
  542.      multiplex  ID (smb_mid) is used (along with smb_pid) to
  543.      allow multiplexing the single consumer/server VC  among
  544.      the consumer's multiple processes, threads and requests
  545.      per thread.
  546.  
  547.      The consumer is responsible  for  ensuring  that  every
  548.      request  includes  a  value  in the smb_mid field which
  549.      will allow the  response  to  be  associated  with  the
  550.      correct  request (at least the smb_pid and smb_mid must
  551.      uniquely  identify  the  request/response  relationship
  552.      system wide).
  553.  
  554.      The server  is  responsible  for  ensuring  that  every
  555.      response  contains  the same smb_mid value (and smb_pid
  556.      value) as its request.  The consumer may then  use  the
  557.      smb_mid  value (along with smb_pid value) for associat-
  558.      ing requests and responses and may have up to the nego-
  559.      tiated  number of requests outstanding at any time on a
  560.      multiplexed file server VC.
  561.  
  562.  
  563. 7.   The LANMAN 1.2 extended protocol enhances the semantics
  564.      of the pathname.
  565.  
  566.      Two special pathname component values -- "."  and  ".."
  567.      --  must be recognized.  There may be multiple of these
  568.      components in a path  name.   They  have  the  standard
  569.      meanings  --  "."  points  to  its  own directory, ".."
  570.      points to its directory's parent.
  571.  
  572.      Note that it is the server's responsibility  to  ensure
  573.      that  the  ".."  can  not  be  used  to  gain access to
  574.      files/directories above the "virtual root"  as  defined
  575.      by the Tree Connect (TID).
  576.  
  577.  
  578. 8.   The new  LANMAN  1.2  extended  protocol  requests  and
  579.      responses  are variable length (as was true in "core").
  580.      Thus additional words may be  added  in  the  smb_vwv[]
  581.      area  in  the  future as well as additional bytes added
  582.      within the smb_buf[] area.  Servers must be implemented
  583.      such  that  additional  fields in either of these areas
  584.      will not cause the  command  to  fail.   If  additional
  585.      fields  are encountered which are not recognized by the
  586.      server's level of SMB implementation,  they  should  be
  587.      ignored. This allows for future upgrade of the protocol
  588.      and eliminates the need for "reserved fields".
  589.  
  590.  
  591.  
  592. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  593.  
  594.  
  595.  
  596.  
  597.  
  598. SMB Protocol Extensions    - 10 -          November 29, 1989
  599.  
  600.  
  601. 9.   The contents of response parameters is  not  guaranteed
  602.      in  the  case of an error return (any protocol response
  603.      with an error set in the SMB header may have smb_wct of
  604.      zero and smb_bcc count of zero).
  605.  
  606.  
  607. 10.  When LANMAN 1.2 extended protocol has been  negotiated,
  608.      the ERRDOS error class has been expanded to include all
  609.      errors which may be generated  by  the  OS/2  operating
  610.      system.   As  such,  the  error code values defined for
  611.      error class ERRDOS in this document are a subset of the
  612.      possible  error  values.  See the OS/2 operating system
  613.      documentation for the complete  set  of  possible  OS/2
  614.      (ERRDOS) error codes.
  615.  
  616.  
  617.  
  618. These semantic changes apply to all "core" requests used  by
  619. the  extended protocol.  Where there are additional changes,
  620. they are documented with the new requests.  The server  hav-
  621. ing  negotiated  LANMAN 1.2 is expected to still support all
  622. LANMAN 1.0 and core protocol requests.
  623.  
  624.  
  625. The following are the  core  protocol  requests  which  must
  626. still  be  supported  in  the  LANMAN  1.2 extended protocol
  627. without change.  See  "File  Sharing  Protocol"  Intel  Part
  628. number  136329-001 for detailed explanation of each protocol
  629. request/response.
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  659.  
  660.  
  661.  
  662.  
  663.  
  664. SMB Protocol Extensions    - 11 -          November 29, 1989
  665.  
  666.  
  667.  
  668.         TREE CONNECT
  669.         TREE DISCONNECT
  670.         OPEN FILE
  671.         CREATE FILE
  672.         CLOSE FILE
  673.         FLUSH FILE
  674.         READ
  675.         WRITE
  676.         SEEK
  677.         CREATE DIRECTORY
  678.         DELETE DIRECTORY
  679.         DELETE FILE
  680.         RENAME FILE
  681.         GET FILE ATTRIBUTES
  682.         SET FILE ATTRIBUTES
  683.         LOCK RECORD
  684.         UNLOCK RECORD
  685.         CREATE TEMPORARY FILE (no longer used by LANMAN 1.2 Redirector)
  686.         PROCESS EXIT          (no longer used by LANMAN 1.2 Redirector)
  687.         MAKE NEW FILE
  688.         CHECK PATH
  689.         GET SERVER ATTRIBUTES
  690.         NEGOTIATE PROTOCOL (additional fields in response if LANMAN 1.2 negotiated)
  691.         FILE SEARCH
  692.         CREATE PRINT FILE
  693.         CLOSE PRINT FILE
  694.         WRITE PRINT FILE
  695.         (core Message Commands are also supported)
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  725.  
  726.  
  727.  
  728.  
  729.  
  730. SMB Protocol Extensions    - 12 -          November 29, 1989
  731.  
  732.  
  733. The following are the LANMAN 1.0 extended protocol  requests
  734. which  must  still  be  supported in the LANMAN 1.2 extended
  735. protocol without change.   See  SMB  File  Sharing  Protocol
  736. Extensions  Version  2.0, doument version 3.2,  for detailed
  737. explanation of each protocol request/response.
  738.  
  739.         SESS_SETUPandX  (X is another valid protocol request e.g. TREE_CONNandX)
  740.         TREE_CONNandX   (X is another valid protocol request e.g. OPEN)
  741.         OPENandX        (X is another valid protocol request e.g. READ)
  742.         READandX        (X is another valid protocol request e.g. CLOSE)
  743.         WRITEandX       (X is another valid protocol request e.g. READ)
  744.         FIND    (matches OS/2 form of FILE SEARCH)
  745.         FIND_UNIQUE     (matches OS/2 form of FILE SEARCH)
  746.         FIND_CLOSE      (matches OS/2 form of FILE SEARCH)
  747.         READ_BLOCK_RAW  (read larger than negotiated buffer size request raw)
  748.         READ_BLOCK_MPX  (read larger than negotiated buffer size request multiplexed)
  749.         WRITE_BLOCK_RAW (write larger than negotiated buffer size request raw)
  750.         WRITE_BLOCK_MPX (write larger than negotiated buffer size request multiplexed)
  751.         GET_E_FILE_ATTR (accommodate new OS/2 system call)
  752.         SET_E_FILE_ATTR (accommodate new OS/2 system call)
  753.         LOCKINGandX     (accommodate new OS/2 system call)
  754.         COPY_FILE       (used when both source and target are remote)
  755.         MOVE_FILE       (used when both source and target are remote)
  756.         IOCTL   (pass IOCTL request on to server and retrieve results)
  757.         TRANSACTION     (allows bytes in/out associated with name)
  758.         ECHO    (echo sent data back)
  759.         WRITEandCLOSE   (write final bytes then close file)
  760.         LOCKandREAD     (Lock bytes then Read locked bytes)
  761.         WRITEandUnlock  (Write bytes then Unlock bytes)
  762.  
  763.  
  764. Of   the   LANMAN   1.0   extended   protocols,   only   the
  765. SESS_SETUPandX  request  and the COPY_FILE SMB have extended
  766. features when LANMAN 1.2 protocol has been  negotiated.  The
  767. format  of  these  SMBs, and their functionality when LANMAN
  768. 1.0 protocol has been negotiated is compatible  with  LANMAN
  769. 1.0  protocol  but will support new features when LANMAN 1.2
  770. protocol  is   negotiated.    The   extended   features   of
  771. SESS_SETUPandX and COPY_FILE SMBs are detailed later in this
  772. document.
  773.  
  774. Support of all core requests within the LANMAN 1.2  extended
  775. protocol is mandatory.  However, the following core requests
  776. will no longer be generated by the  OS/2  implementation  of
  777. the  redirector  when  LANMAN  1.0  or  LANMAN  1.2 extended
  778. protocol has been negotiated.
  779.  
  780.         PROCESS EXIT
  781.         CREATE TEMPORARY FILE
  782.         CREATE PRINT FILE
  783.         CLOSE PRINT FILE
  784.         WRITE PRINT FILE
  785.  
  786.  
  787.  
  788.  
  789.  
  790. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  791.  
  792.  
  793.  
  794.  
  795.  
  796. SMB Protocol Extensions    - 13 -          November 29, 1989
  797.  
  798.  
  799. The only protocol format change to a core  protocol  service
  800. is  that  the  response to the negotiate protocol (NEGOTIATE
  801. PROTOCOL) will contain additional fields  if  the  LANMAN1.2
  802. string  has  been  selected  by  the server thus effectively
  803. placing the session into LANMAN 1.2 extended protocol.   The
  804. additional  fields  returned  will  be  documented in detail
  805. later in this document.
  806.  
  807. All other protocol requests within the LANMAN  1.2  extended
  808. protocol  have  a  new  command value from that of a similar
  809. function in core protocol.  Thus the server  need  not  con-
  810. stantly  test the protocol version negotiated.  The consumer
  811. is expected to only submit appropriate requests  within  the
  812. dialect negotiated.
  813.  
  814.  
  815. The following are  the  new  LANMAN  1.2  extended  protocol
  816. requests, each will be defined in detail later in this docu-
  817. ment.
  818.  
  819.  
  820.  
  821.         TRANSACT2
  822.  
  823.         FIND_CLOSE
  824.         FIND_NOTIFY_CLOSE   (close a notification handle)
  825.         USER LOGOFF and X   (logoff a user id)
  826.  
  827.  
  828.  
  829.  
  830.  
  831. _4.  _A_R_C_H_I_T_E_C_T_U_R_A_L _M_O_D_E_L
  832.  
  833.  
  834. The Network File Access system fundemental architecture  for
  835. LANMAN  1.2  is unchanged from the LANMAN 1.0 architecure as
  836. described in the SMB File Sharing Protocol  Extensions  Ver-
  837. sion 2.0, document version 3.2.
  838.  
  839.  
  840. _5.  _L_A_N_M_A_N _1._0 _S_M_B _E_X_T_E_N_S_I_O_N_S
  841.  
  842.  
  843. This section describes modifications to the LANMAN  1.0  SMB
  844. extensions  which  may  be used when the LANMAN 1.2 protocol
  845. has been negotiated.
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  857.  
  858.  
  859.  
  860.  
  861.  
  862. SMB Protocol Extensions    - 14 -          November 29, 1989
  863.  
  864.  
  865. _5._1.  _S_E_S_S_I_O_N _S_E_T_U_P _a_n_d _X
  866.  
  867. Request Format:
  868.  
  869.   BYTE   smb_wct;          /* value = 10 */
  870.   BYTE   smb_com2;         /* secondary (X) command, 0xFF = none */
  871.   BYTE   smb_reh2;         /* reserved (must be zero) */
  872.   WORD   smb_off2;         /* offset (from SMB hdr start) to next cmd (@smb_wct) */
  873.   WORD   smb_bufsize;      /* the consumers max buffer size */
  874.   WORD   smb_mpxmax;       /* actual maximum multiplexed pending requests */
  875.   WORD   smb_vc_num;       /* 0 = first (only), non zero - additional VC number */
  876.  DWORD   smb_sesskey;      /* Session Key (valid only if smb_vc_num != 0) */
  877.   WORD   smb_apasslen;     /* size of account password (smb_apasswd) */
  878.   WORD   smb_encryptlen;   /* size of encryption key (smb_encrypt) */
  879.   WORD   smb_encryptoff;   /* offset (from SMB hdr start) to smb_encrypt */
  880.   WORD   smb_bcc;          /* minimum value = 0 */
  881.   BYTE   smb_apasswd[*];   /* account password (* = smb_apasslen value) */
  882.   BYTE   smb_aname[];      /* account name string */
  883.   BYTE   smb_encrypt[*];   /* encryption key. (* = smb_encryptlen value) */
  884.  
  885.  
  886. Response Format:
  887.  
  888.   BYTE   smb_wct;         /* value = 3 */
  889.   BYTE   smb_com2;        /* secondary (X) command, 0xFF = none */
  890.   BYTE   smb_res2;        /* reserved (pad to word) */
  891.   WORD   smb_off2;        /* offset (from SMB hdr start) to next cmd (@smb_wct) */
  892.   WORD   smb_action;      /* request mode:
  893.                           bit0 = Logged in successfully - BUT as GUEST */
  894.   WORD   smb_bcc;         /* min value = 0 */
  895.   BYTE   smb_encresp[];   /* server response to request encryption key */
  896.  
  897.  
  898. Service definition:
  899.  
  900.  
  901. This protocol function is unchanged from LANMAN  1.0  except
  902. that  the station establishing the connection may now verify
  903. the validity of the server to which the  request  was  made.
  904. The  LANMAN 1.2 SESS_SETUPandX request uses a reserved DWORD
  905. field from the LANMAN 1.0 request to  pass  the  length  and
  906. offset  of  an  encryption  key contained in the data of the
  907. request to the server.  The server will use  the  encryption
  908. key  to  format the smb_encresp field of the response proto-
  909. col. The station may then use this response to validate  the
  910. server session.
  911.  
  912.  
  913. The LANMAN 1.2 SESS_SETUPandX also  returns  a  UID  in  the
  914. smb_uid  field.   This is a validated UID which must be sup-
  915. plied by the workstation on all subsequent requests  to  the
  916. server.
  917.  
  918.  
  919.  
  920.  
  921.  
  922. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  923.  
  924.  
  925.  
  926.  
  927.  
  928. SMB Protocol Extensions    - 15 -          November 29, 1989
  929.  
  930.  
  931. _5._1._1.  _C_O_P_Y
  932.  
  933. Request Format:
  934.  
  935.   BYTE   smb_wct;          /* value = 3 */
  936.   WORD   smb_tid2;         /* second (destination) path tid */
  937.   WORD   smb_ofun;         /* what to do if destination file exists */
  938.   WORD   smb_flags;        /* flags to control copy operations:
  939.                            bit 0 - destination must be a file.
  940.                            bit 1 - destination must be a directory.
  941.                            bit 2 - copy destination mode: 0 = binary, 1 = ASCII.
  942.                            bit 3 - copy source mode: 0 = binary, 1 = ASCII.
  943.                            bit 4 - verify all writes. */
  944.                            bit 5 - tree copy. Source must be a directory.
  945.                                    Copy mode must be binary.
  946.                                    When tree copy is selected smb_cct field in the
  947.                                    response protocol is undefined.
  948.   WORD   smb_bcc;          /* minimum value = 2 */
  949.   BYTE   smb_path[];       /* pathname of source file */
  950.   BYTE   smb_new_path[];   /* pathname of destination file */
  951.  
  952. Response Format:
  953.  
  954.   BYTE   smb_wct;         /* value = 1 */
  955.   WORD   smb_cct;         /* number of files copied */
  956.   WORD   smb_bcc;         /* minimum value = 0 */
  957.   BYTE   smb_errfile[];   /* pathname of file where error occured - ASCIIZ */
  958.  
  959. Service:
  960.  
  961.  
  962. The COPY protocol function for LANMAN 1.2 is unchanged  from
  963. LANMAN  1.0  except  that  the  request  may  now be used to
  964. specify a tree copy on the remote server. The tree copy mode
  965. is  selected  by  setting bit 5 of the smb_flags word in the
  966. COPY request.  When the tree copy  option  is  selected  the
  967. destination must not be an existing file and the source mode
  968. must be binary. A request with bit 5 of the  smb_flags  word
  969. set  and  either  bit  0 or bit 3 set is therefore an error.
  970. When the tree copy mode is selected the smb_cct word of  the
  971. response protocol is undefined.
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  989.  
  990.  
  991.  
  992.  
  993.  
  994. SMB Protocol Extensions    - 16 -          November 29, 1989
  995.  
  996.  
  997. _6.  _E_X_T_E_N_D_E_D _P_R_O_T_O_C_O_L
  998.  
  999. The format of enhanced and new commands is defined  commenc-
  1000. ing  at  the  smb_wct  field.  All messages will include the
  1001. standard SMB header defined in section 1.0.  When  an  error
  1002. is encountered a server may choose to return only the header
  1003. portion of the response (i.e., smb_wct and smb_bcc both con-
  1004. tain zero).
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. SMB Protocol Extensions    - 17 -          November 29, 1989
  1061.  
  1062.  
  1063. _6._0._1.  _T_R_A_N_S_A_C_T_2
  1064.  
  1065. Primary Request Format:
  1066.  
  1067.  
  1068.   BYTE   smb_wct;        /* value = (14 + value of smb_suwcnt) */
  1069.   WORD   smb_tpscnt;     /* total number of parameter bytes being sent */
  1070.   WORD   smb_tdscnt;     /* total number of data bytes being sent */
  1071.   WORD   smb_mprcnt;     /* max number of parameter bytes to return */
  1072.   WORD   smb_mdrcnt;     /* max number of data bytes to return */
  1073.   BYTE   smb_msrcnt;     /* max number of setup words to return */
  1074.   BYTE   smb_rsvd;       /* reserved (pad above to word) */
  1075.   WORD   smb_flags;      /* additional information:
  1076.                          bit 0 - if set, also disconnect TID in smb_tid
  1077.                          bit 1 - if set, transaction is one way (no final response) */
  1078.  DWORD   smb_timeout;    /* number of milliseconds to wait for completion */
  1079.   WORD   smb_rsvd1;      /* reserved */
  1080.   WORD   smb_pscnt;      /* number of parameter bytes being sent this buffer */
  1081.   WORD   smb_psoff;      /* offset (from start of SMB hdr) to parameter bytes */
  1082.   WORD   smb_dscnt;      /* number of data bytes being sent this buffer */
  1083.   WORD   smb_dsoff;      /* offset (from start of SMB hdr) to data bytes */
  1084.   BYTE   smb_suwcnt;     /* set up word count */
  1085.   BYTE   smb_rsvd2;      /* reserved (pad above to word) */
  1086.   WORD   smb_setup[*];   /* variable number of set up words (* = smb_suwcnt) */
  1087.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  1088.   BYTE   smb_name[1];    /* Must be a null byte */
  1089.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  1090.   BYTE   smb_param[*];   /* param bytes (* = value of smb_pscnt) */
  1091.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  1092.   BYTE   smb_data[*];    /* data bytes (* = value of smb_dscnt) */
  1093.  
  1094.  
  1095.  
  1096. Interim Response Format (if no error  -  ok  send  remaining
  1097. data):
  1098.  
  1099.   BYTE   smb_wct;   /* value = 0 */
  1100.   WORD   smb_bcc;   /* value = 0 */
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. SMB Protocol Extensions    - 18 -          November 29, 1989
  1127.  
  1128.  
  1129. Secondary Request Format (more data - may be zero or more of
  1130. these):
  1131.  
  1132.   BYTE   smb_wct;        /* value = 9 */
  1133.   WORD   smb_tpscnt;     /* total number of parameter bytes being sent */
  1134.   WORD   smb_tdscnt;     /* total number of data bytes being sent */
  1135.   WORD   smb_pscnt;      /* number of parameter bytes being sent this buffer */
  1136.   WORD   smb_psoff;      /* offset (from start of SMB hdr) to parameter bytes */
  1137.   WORD   smb_psdisp;     /* byte displacement for these parameter bytes */
  1138.   WORD   smb_dscnt;      /* number of data bytes being sent this buffer */
  1139.   WORD   smb_dsoff;      /* offset (from start of SMB hdr) to data bytes */
  1140.   WORD   smb_dsdisp;     /* byte displacement for these data bytes */
  1141.   WORD   smb_fid;        /* file id for handle based requests, else 0xffff */
  1142.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  1143.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  1144.   BYTE   smb_param[*];   /* param bytes (* = value of smb_pscnt) */
  1145.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  1146.   BYTE   smb_data[*];    /* data bytes (* = value of smb_dscnt) */
  1147.  
  1148.  
  1149. Response Format (may respond with zero or more of these):
  1150.  
  1151.   BYTE   smb_wct;        /* value = 10 + value of smb_suwcnt */
  1152.   WORD   smb_tprcnt;     /* total number of parameter bytes being returned */
  1153.   WORD   smb_tdrcnt;     /* total number of data bytes being returned */
  1154.   WORD   smb_rsvd;       /* reserved */
  1155.   WORD   smb_prcnt;      /* number of parameter bytes being returned this buf */
  1156.   WORD   smb_proff;      /* offset (from start of SMB hdr) to parameter bytes */
  1157.   WORD   smb_prdisp;     /* byte displacement for these parameter bytes */
  1158.   WORD   smb_drcnt;      /* number of data bytes being returned this buffer */
  1159.   WORD   smb_droff;      /* offset (from start of SMB hdr) to data bytes */
  1160.   WORD   smb_drdisp;     /* byte displacement for these data bytes */
  1161.   BYTE   smb_suwcnt;     /* set up return word count */
  1162.   BYTE   smb_rsvd1;      /* reserved (pad above to word) */
  1163.   WORD   smb_setup[*];   /* variable # of set up return words (* = smb_suwcnt) */
  1164.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  1165.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  1166.   BYTE   smb_param[*];   /* param bytes (* = value of smb_prcnt) */
  1167.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  1168.   BYTE   smb_data[*];    /* data bytes (* = value of smb_drcnt) */
  1169.  
  1170.  
  1171. Service:
  1172.  
  1173.  
  1174. The Transaction2 protocol allows transfer of  parameter  and
  1175. data  blocks  greater  than a negotiated buffer size between
  1176. the requester and the server.
  1177.  
  1178. The Transaction2 command scope includes (but is not  limited
  1179. to)  IOCTL  device  requests  and file system requests which
  1180. require the transfer of an extended attribute list.
  1181.  
  1182. The Transaction2 protocol is used to transer a  request  for
  1183.  
  1184.  
  1185.  
  1186. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192. SMB Protocol Extensions    - 19 -          November 29, 1989
  1193.  
  1194.  
  1195. any  of a set of supported functions on the server which may
  1196. require the transfer of  large  data  blocks.  The  function
  1197. requested  is  identified  by the first word in the transac-
  1198. tion2 smb_setup field. Other function  specific  information
  1199. may  follow the function identifier in the smb_setup file id
  1200. or in the smb_param filed.  The functions supported are  not
  1201. defined  by the protocol, but by consumer/server implementa-
  1202. tions.  The protocol simply provides a means  of  delivering
  1203. them and retrieving the results.
  1204.  
  1205. The number of bytes needed in order to perform the TRANSACT2
  1206. request may be more than will fit in a single buffer.
  1207.  
  1208. At the time of the request, the consumer knows the number of
  1209. parameter and data bytes expected to be sent and passes this
  1210. information  to  the  server   via   the   primary   request
  1211. (smb_tpscnt and smb_tdscnt). This may be reduced by lowering
  1212. the  total  number  of  bytes  expected  (smb_tpscnt  and/or
  1213. smbtdscnt) in each (any) secondary request.
  1214.  
  1215. Thus when the amount of parameter bytes received  (total  of
  1216. each  smb_pscnt)  equals the total amount of parameter bytes
  1217. expected (smallest smb_tpscnt) received, then the server has
  1218. received all the parameter bytes.
  1219.  
  1220. Likewise, when the amount of data bytes received  (total  of
  1221. each  smb_dscnt)  equals  the  total  amount  of  data bytes
  1222. expected (smallest smb_tdscnt) received, then the server has
  1223. received all the data bytes.
  1224.  
  1225. The parameter bytes should normally be sent  first  followed
  1226. by  the  data  bytes.  However,  the server knows where each
  1227. begins  and  ends  in  each  buffer  by  the  offset  fields
  1228. (smb_psoff  and  smb_dsoff) and the length fields (smb_pscnt
  1229. and smb_dscnt).  The displacement of the bytes (relative  to
  1230. start  of  each)  is also known (smb_psdisp and smb_dsdisp).
  1231. Thus the server is able to reasemble the parameter and  data
  1232. bytes  should  the  "packets"  (buffers)  be received out of
  1233. sequence.
  1234.  
  1235. If all parameter bytes and data  bytes  fit  into  a  single
  1236. buffer,  then no interim response is expected (and no secon-
  1237. dary request is sent).
  1238.  
  1239. The Consumer knows the maximum  amount  of  data  bytes  and
  1240. parameter bytes which the server may return (from smb_mprcnt
  1241. and smb_mdrcnt of the request).   Thus  it  initializes  its
  1242. bytes  expected  variables to these values.  The Server then
  1243. informs the consumer of the actual  amounts  being  returned
  1244. via  each  "packet" (buffer) of the response (smb_tprcnt and
  1245. smb_tdrcnt).
  1246.  
  1247. The server may reduce the expected  bytes  by  lowering  the
  1248. total   number   of   bytes   expected   (smb_tprcnt  and/or
  1249.  
  1250.  
  1251.  
  1252. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258. SMB Protocol Extensions    - 20 -          November 29, 1989
  1259.  
  1260.  
  1261. smb_tdrcnt) in each (any) response.
  1262.  
  1263. Thus when the amount of parameter bytes received  (total  of
  1264. each  smb_prcnt)  equals the total amount of parameter bytes
  1265. expected (smallest smb_tprcnt) received, then  the  consumer
  1266. has received all the parameter bytes.
  1267.  
  1268. Likewise, when the amount of data bytes received  (total  of
  1269. each  smb_drcnt)  equals  the  total  amount  of  data bytes
  1270. expected (smallest smb_tdrcnt) received, then  the  consumer
  1271. has received all the data bytes.
  1272.  
  1273. The parameter bytes should normally be returned  first  fol-
  1274. lowed  by  the data bytes. However, the consumer knows where
  1275. each begins and ends in each buffer  by  the  offset  fields
  1276. (smb_proff  and  smb_droff) and the length fields (smb_prcnt
  1277. and smb_drcnt).  The displacement of the bytes (relative  to
  1278. start  of  each)  is also known (smb_prdisp and smb_drdisp).
  1279. Thus the consumer is able to  reasemble  the  parameter  and
  1280. data bytes should the "packets" (buffers) be received out of
  1281. sequence.
  1282.  
  1283. Thus the flow is:
  1284.  
  1285.  
  1286. 1    The consumer sends the first  (primary)  request  which
  1287.      identifies  the  total bytes (both parameters and data)
  1288.      which are expected to be sent and contains the  set  up
  1289.      words and as many of the parameter and data bytes bytes
  1290.      as will fit in a negotiated size buffer.   This request
  1291.      also  identifies  the  maximum  number of bytes (setup,
  1292.      parameters and data) the server is to return  on  TRAN-
  1293.      SACT2  completion.  If  all the bytes fit in the single
  1294.      buffer, skip to step 4.
  1295.  
  1296.  
  1297. 2    The server responds  with  a  single  interim  response
  1298.      meaning  "ok,  send  the remainder of the bytes" or (if
  1299.      error response) terminate the transaction.
  1300.  
  1301.  
  1302. 3    The consumer then sends another buffer full of bytes to
  1303.      the   server.  On  each  iteration  of  this  secondary
  1304.      request, smb_tpscnt and/or smb_tdscnt could be reduced.
  1305.      This  step  is  repeated  until  all  bytes  have  been
  1306.      delivered to the server (total of all smb_pscnt  equals
  1307.      smallest  smb_tpscnt  and total of all smb_dscnt equals
  1308.      smallest smb_tdscnt).
  1309.  
  1310.  
  1311. 4    The Server sets up and performs the TRANSACT2 with  the
  1312.      information provided.
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324. SMB Protocol Extensions    - 21 -          November 29, 1989
  1325.  
  1326.  
  1327. 5    Upon completion of the TRANSACT2, the server sends back
  1328.      (up   to)  the  number  of  parameter  and  data  bytes
  1329.      requested (or as many as will  fit  in  the  negotiated
  1330.      buffer  size).   This step is repeated until all result
  1331.      bytes have been returned.  On each  iteration  of  this
  1332.      response,   smb_tprcnt   and/or   smb_tdrcnt  could  be
  1333.      reduced.  This step is repeated until  all  bytes  have
  1334.      been  delivered to the consumer (total of all smb_prcnt
  1335.      equals smallest smb_tprcnt and total of  all  smb_drcnt
  1336.      equals smallest smb_tdrcnt).
  1337.  
  1338.  
  1339.      Thus the flow is:
  1340.  
  1341.  
  1342. 1    The consumer sends the first  (primary)  request  which
  1343.      identifies  the total bytes (parameters and data) which
  1344.      are to be sent, contains the set up words and  as  many
  1345.      of  the parameter and data bytes as will fit in a nego-
  1346.      tiated size buffer.   This request also identifies  the
  1347.      maximum  number  of  bytes (setup, parameters and data)
  1348.      the server is to return on  TRANSACT2  completion.  The
  1349.      parameter  bytes  are  immediately followed by the data
  1350.      bytes (the length fields identify the break point).  If
  1351.      all the bytes fit in the single buffer, skip to step 4.
  1352.  
  1353.  
  1354. 2    The server responds  with  a  single  interim  response
  1355.      meaning  "ok,  send  the remainder of the bytes" or (if
  1356.      error response) terminate the transaction.
  1357.  
  1358.  
  1359. 3    The consumer then sends another buffer full of bytes to
  1360.      the  server. This step is repeated until all bytes have
  1361.      been delivered to the server.
  1362.  
  1363.  
  1364. 4    The Server sets up and performs the TRANSACT2 with  the
  1365.      information provided.
  1366.  
  1367.  
  1368. 5    Upon completion of the TRANSACT2, the server sends back
  1369.      up  to  the  the  number  of  parameter  and data bytes
  1370.      requested (or as many as will  fit  in  the  negotiated
  1371.      buffer  size).   This  step is repeated until all bytes
  1372.      requested have been returned.   On  each  iteration  of
  1373.      this response, smb_rprcnt and smb_rdrcnt are reduced by
  1374.      the number of matching bytes returned in  the  previous
  1375.      response.  The parameter count (smb_rprcnt) is expected
  1376.      to go to zero first because  the  parameters  are  sent
  1377.      before  the data.  The data count (smb_rdrcnt) may then
  1378.      continue to be counted down.  Fewer than the  requested
  1379.      number of bytes may be returned.
  1380.  
  1381.  
  1382.  
  1383.  
  1384. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390. SMB Protocol Extensions    - 22 -          November 29, 1989
  1391.  
  1392.  
  1393. The flow for the TRANSACT2 protocol when the request parame-
  1394. ters and data does NOT all fit in a single buffer is:
  1395.  
  1396.      consumer ---> TRANSACT2 request (data) >----> server
  1397.      consumer -<--< OK send remaining data -<----  server
  1398.      consumer-> TRANSACT2 secondary request 1 (data) >-> server
  1399.      consumer-> TRANSACT2 secondary request 2 (data) >-> server
  1400.      .                       .                        .
  1401.      consumer-> TRANSACT2 secondary request n (data) >-> server
  1402.      .                       .                        .
  1403.      .  (server sets up and performs the TRANSACT2)   .
  1404.      .                       .                        .
  1405.      consumer -<< TRANSACT2 response 1 (data) -<-- server
  1406.      consumer -<< TRANSACT2 response 2 (data) -<-- server
  1407.      .                       .                        .
  1408.      consumer -<< TRANSACT2 response n (data) -<-- server
  1409.  
  1410. The flow for  the  Transaction  protocol  when  the  request
  1411. parameters and data does all fit in a single buffer is:
  1412.  
  1413.      consumer ---> TRANSACT2 request (data) >----> server
  1414.      .                       .                        .
  1415.      .  (server sets up and performs the TRANSACT2)   .
  1416.      .                       .                        .
  1417.      consumer -<< TRANSACT2 response 1 (data) -<-- server
  1418.      .      (only one if all data fit in buffer)      .
  1419.      consumer -<< TRANSACT2 response 2 (data) -<-- server
  1420.      .                       .                        .
  1421.      consumer -<< TRANSACT2 response n (data) -<-- server
  1422.  
  1423.  
  1424.  
  1425. Note that the primary request  through  the  final  response
  1426. make  up  the  complete protocol, thus the TID, PID, UID and
  1427. MID are expected to remain constant and can be used by  both
  1428. the  server and consumer to route the individual messages of
  1429. the protocol to the correct process.
  1430.  
  1431.  
  1432. Transaction may generate the following errors:
  1433.  
  1434.         Error Class ERRDOS:
  1435.  
  1436.           ERRnoaccess
  1437.           ERRbadaccess
  1438.  
  1439.  
  1440.         Error Class ERRSRV:
  1441.  
  1442.           ERRerror
  1443.           ERRinvnid
  1444.           ERRaccess
  1445.           ERRmoredata
  1446.           <implementation specific>
  1447.  
  1448.  
  1449.  
  1450. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456. SMB Protocol Extensions    - 23 -          November 29, 1989
  1457.  
  1458.  
  1459.  
  1460.         Error Class ERRHRD:
  1461.  
  1462.           <implementation specific>
  1463.  
  1464.  
  1465.  
  1466. _6._0._1._1.  _D_e_f_i_n_e_d _T_r_a_n_s_a_c_t_i_o_n_2 _P_r_o_t_o_c_o_l_s
  1467.  
  1468. This section specifies some of the  defined  usages  of  the
  1469. Transaction2  protocol.  Each of the usages here utilize the
  1470. basic (and flexible) transaction protocol format.   This  is
  1471. NOT meant to be an exhaustive list.
  1472.  
  1473. The following function codes are transferred in smb_setup[0]
  1474. and are used by the server to identify the specific function
  1475. required.
  1476.  
  1477.  
  1478.         TRANSACT2_OPEN                                                                   0
  1479.         TRANSACT2_FINDFIRST                                                              1
  1480.         TRANSACT2_FINDNEXT                                                               2
  1481.         TRANSACT2_QFSINFO                                                                3
  1482.         TRANSACT2_SETFSINFO                                                              4
  1483.         TRANSACT2_QPATHINFO                                                              5
  1484.         TRANSACT2_SETPATHINFO                                                            6
  1485.         TRANSACT2_QFILEINFO                                                              7
  1486.         TRANSACT2_SETFILEINFO                                                            8
  1487.         TRANSACT2_FSCTL                                                                  9
  1488.         TRANSACT2_IOCTL                                                                  10
  1489.         TRANSACT2_FINDNOTIFYFIRST                                                        11
  1490.         TRANSACT2_FINDNOTIFYNEXT                                                         12
  1491.         TRANSACT2_MKDIR                                                                  13
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522. SMB Protocol Extensions    - 24 -          November 29, 1989
  1523.  
  1524.  
  1525. _6._0._1._1._1.  _T_R_A_N_S_A_C_T_2__O_P_E_N
  1526.  
  1527. The function code TRANSACT2_OPEN in smb_setup[0] in the pri-
  1528. mary  TRANSACT2  requests  identifies  a request to create a
  1529. file with extended attributes.
  1530.  
  1531. Primary Request Format:
  1532.  
  1533.  
  1534.   BYTE   smb_wct;        /* value = 15 */
  1535.   WORD   smb_tpscnt;     /* value = total number of param bytes being sent */
  1536.   WORD   smb_tdscnt;     /* total size of extended attribute list */
  1537.   WORD   smb_mprcnt;     /* value = maximum return parameter length */
  1538.   WORD   smb_mdrcnt;     /* value = 0. No data returned */
  1539.   BYTE   smb_msrcnt;     /* value = 0. No setup words to return */
  1540.   BYTE   smb_rsvd;       /* reserved (pad above to word) */
  1541.   WORD   smb_flags;      /* additional information:
  1542.                             bit 0 - 0
  1543.                             bit 1 - 0 */
  1544.  DWORD   smb_timeout;    /* max milliseconds to wait for resource to open */
  1545.   WORD   smb_rsvd1;      /* reserved */
  1546.   WORD   smb_pscnt;      /* value = tpscnt, parms must be in primary request */
  1547.   WORD   smb_psoff;      /* offset (from start of SMB hdr to parameter bytes */
  1548.   WORD   smb_dscnt;      /* number of data bytes being sent this buffer */
  1549.   WORD   smb_dsoff;      /* offset (from start of SMB hdr) to data bytes */
  1550.   BYTE   smb_suwcnt;     /* value = 1 */
  1551.   BYTE   smb_rsvd2;      /* reserved (pad above to word) */
  1552.   WORD   smb_setup1;     /* value = 0 :- TRANSACT2_OPEN */
  1553.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  1554.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  1555.   BYTE   smb_param[*];   /* The parmater block for the the TRANSACT2_OPEN
  1556.                           * function is the open specific information in the
  1557.                           * following format. */
  1558.          WORD            open_flags2;
  1559.                              bit 0 - if set, return additional information
  1560.                              bit 1 - if set, set single user total file lock
  1561.  
  1562.                              bit 2 - if set, the server should notify the consumer
  1563.                                      on any action which can modify the file (delete,
  1564.                                      setattrib, rename, etc.). if not set, the server
  1565.                                      need only notify the consumer on another open
  1566.                                      request. */
  1567.                              bit 3 - if set, return total length of EAs for the file
  1568.           WORD           open_mode;       /* file open mode */
  1569.           WORD           open_sattr;      /* search attributes  */
  1570.           WORD           open_attr;       /* file attributes (for create) */
  1571.          DWORD           open_time;       /* create time */
  1572.           WORD           open_ofun;       /* open function */
  1573.          DWORD           open_size;       /* bytes to reserve on "create"
  1574.                                            * or "truncate" */
  1575.           WORD           open_rsvd[5];    /* reserved (must be zero) */
  1576.           BYTE           open_pathname[]; /* file pathname */
  1577.  
  1578.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  1579.  
  1580.  
  1581.  
  1582. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588. SMB Protocol Extensions    - 25 -          November 29, 1989
  1589.  
  1590.  
  1591.   BYTE   smb_data[*];    /* FEAList structure for the file to be openned */
  1592.  
  1593.  
  1594. Secondary Request Format (more data - may be zero or more of
  1595. these):
  1596.  
  1597.   BYTE   smb_wct;       /* value = 9 */
  1598.   WORD   smb_tpscnt;    /* total number of parameter bytes being sent */
  1599.   WORD   smb_tdscnt;    /* total number of data bytes being sent */
  1600.   WORD   smb_pscnt;     /* value = 0. All params in primary request */
  1601.   WORD   smb_psoff;     /* value = 0. No parameters in secondary request. */
  1602.   WORD   smb_psdisp;    /* value = 0. No parameters in secondary request. */
  1603.   WORD   smb_dscnt;     /* number of data bytes being sent this buffer */
  1604.   WORD   smb_dsoff;     /* offset (from start of SMB hdr) to data bytes */
  1605.   WORD   smb_dsdisp;    /* byte displacement for these data bytes */
  1606.   WORD   smb_fid;       /* value = 0xffff, no handle on request */
  1607.   WORD   smb_bcc;       /* total bytes (including pad bytes) following */
  1608.   BYTE   smb_pad[];     /* (optional) to pad to word or dword boundary */
  1609.   BYTE   smb_data[*];   /* data bytes (* = value of smb_dscnt) */
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654. SMB Protocol Extensions    - 26 -          November 29, 1989
  1655.  
  1656.  
  1657. Response Format (one only):
  1658.  
  1659.   BYTE   smb_wct;        /* value = 10 */
  1660.   WORD   smb_tprcnt;     /* total parameter length retuned */
  1661.   WORD   smb_tdrcnt;     /* value = 0 no data bytes  */
  1662.   WORD   smb_rsvd;       /* reserved */
  1663.   WORD   smb_prcnt;      /* parameter bytes being returned */
  1664.   WORD   smb_proff;      /* offset (from start of SMB hdr) to parameter bytes */
  1665.   WORD   smb_prdisp;     /* value = 0 byte displacement for these param bytes */
  1666.   WORD   smb_drcnt;      /* value = 0 no data bytes */
  1667.   WORD   smb_droff;      /* value = 0 no data bytes */
  1668.   WORD   smb_drdisp;     /* value = 0 no data bytes */
  1669.   BYTE   smb_suwcnt;     /* value = 0 no set up return words */
  1670.   BYTE   smb_rsvd1;      /* reserved (pad above to word) */
  1671.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  1672.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  1673.   BYTE   smb_param[*];   /* The parmater block for the the TRANSACT2_OPEN
  1674.                           * function response is the open specific return
  1675.                           * information in the following format. */
  1676.            WORD          open_fid;         /* file handle */
  1677.           +WORD          open_attribute;   /* attributes of file or device */
  1678.          +DWORD          open_time;        /* last modification time */
  1679.          +DWORD          open_size;        /* current file size */
  1680.           +WORD          open_access;      /* access permissions actually
  1681.                                             * allowed */
  1682.           +WORD          open_type;        /* file type */
  1683.           +WORD          open_state;       /* state of IPC device (e.g. pipe) */
  1684.            WORD          open_action;      /* action taken */
  1685.           DWORD          open_fileid;      /* server unique file id */
  1686.            WORD          open_offerror;    /* offset into FEAList data of first
  1687.                                             * error which occured while setting
  1688.                                             * the extended attributes. */
  1689.          ++DWORD         open_EAlength;    /* Total EA length for opened file */
  1690.  
  1691.  
  1692.  +returned only if bit 0 of open_flags2 is  set  in  primary
  1693. request
  1694.  ++returned only if bit 3 of open_flags2 is set  in  primary
  1695. request
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720. SMB Protocol Extensions    - 27 -          November 29, 1989
  1721.  
  1722.  
  1723. _6._0._1._1._2.  _T_R_A_N_S_A_C_T_2__F_I_N_D_F_I_R_S_T
  1724.  
  1725. The function code TRANSACT2_FINDFIRST in smb_setup[0] in the
  1726. primary  TRANSACT2  request identifies a request to find the
  1727. first file that matches the specified file specification.
  1728.  
  1729. Primary Request Format:
  1730.  
  1731.  
  1732.   BYTE   smb_wct;        /* value = 15 */
  1733.   WORD   smb_tpscnt;     /* value = total number of param bytes being sent */
  1734.   WORD   smb_tdscnt;     /* total size of extended attribute list */
  1735.   WORD   smb_mprcnt;     /* value = maximum return parameter length */
  1736.   WORD   smb_mdrcnt;     /* value = maximum return data length */
  1737.   BYTE   smb_msrcnt;     /* value = 0. No setup words to return */
  1738.   BYTE   smb_rsvd;       /* reserved (pad above to word) */
  1739.   WORD   smb_flags;      /* additional information:
  1740.                              bit 0 - 0
  1741.                              bit 1 - 0
  1742.  DWORD   smb_timeout;    /* value = 0. Not used for find first */
  1743.   WORD   smb_rsvd1;      /* reserved */
  1744.   WORD   smb_pscnt;      /* value = tpscnt, parms must be in primary request */
  1745.   WORD   smb_psoff;      /* offset (from start of SMB hdr to parameter bytes */
  1746.   WORD   smb_dscnt;      /* number of data bytes being sent this buffer */
  1747.   WORD   smb_dsoff;      /* offset (from start of SMB hdr) to data bytes */
  1748.   BYTE   smb_suwcnt;     /* value = 1 */
  1749.   BYTE   smb_rsvd2;      /* reserved (pad above to word) */
  1750.   WORD   smb_setup1;     /* value = 1  :- TRANSACT2_FINDFIRST */
  1751.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  1752.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  1753.   BYTE   smb_param[*];   /* The parmater block for the
  1754.                             TRANSACT2_FINDFIRST function is the find
  1755.                             first specific information in the
  1756.                             following format. */
  1757.          WORD            findfirst_Attribute;      /* Search attribute */
  1758.          WORD            findfirst_SearchCount;
  1759.          WORD            findfirst_flags;          /* find flags */
  1760.                                                    /* Bit 0: set - close search after
  1761.                                                     *              this request.
  1762.                                                     * Bit 1: set - close search if end
  1763.                                                     *              of search reached.
  1764.                                                     * Bit 2: set - Requester requires
  1765.                                                     *              resume key for each
  1766.                                                     *              entry found.
  1767.                                                     */
  1768.          WORD            findfirst_FileInfoLevel;  /* Search level */
  1769.          DWORD           findfirst_rsvd;
  1770.          BYTE            findfirst_FileName[];
  1771.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  1772.   BYTE   smb_data[*];    /* Additional FileInfoLevel dependent match
  1773.                           * information. For a search requiring extended
  1774.                           * attribute matching the data buffer contains
  1775.                           * the FEAList data for the seach. */
  1776.  
  1777.  
  1778.  
  1779.  
  1780. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786. SMB Protocol Extensions    - 28 -          November 29, 1989
  1787.  
  1788.  
  1789. Secondary Request Format (more data - may be zero or more of
  1790. these):
  1791.  
  1792.   BYTE   smb_wct;       /* value = 9 */
  1793.   WORD   smb_tpscnt;    /* totalnumber of parameter bytes being sent */
  1794.   WORD   smb_tdscnt;    /* total number of data bytes being sent */
  1795.   WORD   smb_pscnt;     /* value = 0. All params in primary request */
  1796.   WORD   smb_psoff;     /* value = 0. No parameters in secondary request. */
  1797.   WORD   smb_psdisp;    /* value = 0. No parameters in secondary request. */
  1798.   WORD   smb_dscnt;     /* number of data bytes being sent this buffer */
  1799.   WORD   smb_dsoff;     /* offset (from start of SMB hdr) to data bytes */
  1800.   WORD   smb_dsdisp;    /* byte displacement for these data bytes */
  1801.   WORD   smb_fid;       /* value = 0xffff, no handle on request */
  1802.   WORD   smb_bcc;       /* total bytes (including pad bytes) following */
  1803.   WORD   smb_fid;       /* value = 0xffff, no handle on request */
  1804.   BYTE   smb_pad[];     /* (optional) to pad to word or dword boundary */
  1805.   BYTE   smb_data[*];   /* data bytes (* = value of smb_dscnt) */
  1806.  
  1807.  
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852. SMB Protocol Extensions    - 29 -          November 29, 1989
  1853.  
  1854.  
  1855. First Response Format :
  1856.  
  1857.   BYTE   smb_wct;        /* value = 10 */
  1858.   WORD   smb_tprcnt;     /* value = 10 */
  1859.   WORD   smb_tdrcnt;     /* value = total length of return data buffer  */
  1860.   WORD   smb_rsvd;       /* reserved */
  1861.   WORD   smb_prcnt;      /* parameter bytes returned in this buffer */
  1862.   WORD   smb_proff;      /* offset (from start of SMB hdr) to param bytes */
  1863.   WORD   smb_prdisp;     /* value = 0 byte displacement for param bytes */
  1864.   WORD   smb_drcnt;      /* data bytes returned in this buffer */
  1865.   WORD   smb_droff;      /* offset (from start of SMB hdr) to data bytes */
  1866.   WORD   smb_drdisp;     /* byte displacement for these data bytes */
  1867.   BYTE   smb_suwcnt;     /* value = 0 no set up return words */
  1868.   BYTE   smb_rsvd1;      /* reserved (pad above to word) */
  1869.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  1870.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  1871.   BYTE   smb_param[*];   /* The parmater block for the
  1872.                           * TRANSACT2_FINDFIRST function response is
  1873.                           * the find first specific return
  1874.                           * information in the following format. */
  1875.           WORD           findfirst_dir_handle;    /* Directory search handle */
  1876.           WORD           findfirst_searchcount;   /* Number of matching
  1877.                                                    * entries found */
  1878.           WORD           findfirst_eos;           /* end of search indicator. */
  1879.           WORD           findfirst_offerror;      /* error offset if EA error */
  1880.           WORD           findfirst_lastname;      /* 0 - server does not require
  1881.                                                    *     findnext_FileName[] in order
  1882.                                                    *     to continue search.
  1883.                                                    * else
  1884.                                                    *     offset from start of returned
  1885.                                                    *     data to filename of last
  1886.                                                    *     found entry returned.
  1887.                                                    */
  1888.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  1889.   BYTE   smb_data[*];    /* return data bytes (* = value of smb_dscnt) */
  1890.                          /* The data block contains the level dependent
  1891.                           * information about the matches found in the search.
  1892.                           *
  1893.                           * If bit 2 in the findfirst_flags is set, each
  1894.                           * returned file descriptor block will be preceeded
  1895.                           * by a four byte resume key.
  1896.                           */
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918. SMB Protocol Extensions    - 30 -          November 29, 1989
  1919.  
  1920.  
  1921. Subsequent Response Format :
  1922.  
  1923.   BYTE   smb_wct;       /* value = 10 */
  1924.   WORD   smb_tprcnt;    /* value = 8 */
  1925.   WORD   smb_tdrcnt;    /* value = total length of return data buffer  */
  1926.   WORD   smb_rsvd;      /* reserved */
  1927.   WORD   smb_prcnt;     /* value = 0 */
  1928.   WORD   smb_proff;     /* value = 0 */
  1929.   WORD   smb_prdisp;    /* value = 0 */
  1930.   WORD   smb_drcnt;     /* data bytes returned in this buffer */
  1931.   WORD   smb_droff;     /* offset (from start of SMB hdr) to data bytes */
  1932.   WORD   smb_drdisp;    /* byte displacement for these data bytes */
  1933.   BYTE   smb_suwcnt;    /* value = 0 no set up return words */
  1934.   BYTE   smb_rsvd1;     /* reserved (pad above to word) */
  1935.   WORD   smb_bcc;       /* total bytes (including pad bytes) following */
  1936.   BYTE   smb_pad1[];    /* (optional) to pad to word or dword boundary */
  1937.   BYTE   smb_data[*];   /* return data bytes (* = value of smb_dscnt) */
  1938.                         /* The data block contains the level dependent
  1939.                          * information about the matches found in the search.
  1940.                          *
  1941.                          * If bit 2 in the findfirst_flags is set, each
  1942.                          * returned file descriptor block will be preceeded
  1943.                          * by a four byte resume key.
  1944.                          */
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984. SMB Protocol Extensions    - 31 -          November 29, 1989
  1985.  
  1986.  
  1987. _6._0._1._1._3.  _T_R_A_N_S_A_C_T_2__F_I_N_D_N_E_X_T
  1988.  
  1989. The function code TRANSACT2_FINDNEXT in smb_setup[0] in  the
  1990. primary TRANSACT2 request identifies a request to continue a
  1991. file search started by a TRANSACT_FINDFIRST search.
  1992.  
  1993. Primary Request Format:
  1994.  
  1995.  
  1996.   BYTE   smb_wct;               /* value = 15 */
  1997.   WORD   smb_tpscnt;            /* total param bytes being sent */
  1998.   WORD   smb_tdscnt;            /* total number of data bytes being sent */
  1999.   WORD   smb_mprcnt;            /* value = maximum return parameter length */
  2000.   WORD   smb_mdrcnt;            /* value = maximum return data length */
  2001.   BYTE   smb_msrcnt;            /* value = 0. No setup words to return */
  2002.   BYTE   smb_rsvd;              /* reserved (pad above to word) */
  2003.   WORD   smb_flags;             /* additional information:
  2004.                                     bit 0 - 0
  2005.                                     bit 1 - 0 */
  2006.  DWORD   smb_timeout;           /* value = 0. Not used for find next */
  2007.   WORD   smb_rsvd1;             /* reserved */
  2008.   WORD   smb_pscnt;             /* value = tpscnt, parms must be in primary request */
  2009.   WORD   smb_psoff;             /* offset (from start of SMB hdr to parameter bytes */
  2010.   WORD   smb_dscnt;             /* number of data bytes being sent this buffer */
  2011.   WORD   smb_dsoff;             /* offset (from start of SMB hdr) to data bytes */
  2012.   BYTE   smb_suwcnt;            /* value = 1 */
  2013.   BYTE   smb_rsvd2;             /* reserved (pad above to word) */
  2014.   WORD   smb_setup1;            /* value = 2  :- TRANSACT2_FINDNEXT */
  2015.   WORD   smb_bcc;               /* total bytes (including pad bytes) following */
  2016.   BYTE   smb_pad[];             /* (optional) to pad to word or dword boundary */
  2017.   BYTE   smb_param[*];          /* The parmater block for the TRANSACT2_FINDNEXT
  2018.                                  * function is the find next specific information
  2019.                                  * in the following format. */
  2020.           WORD                  findnext_DirHandle;      /* Directory search handle */
  2021.           WORD                  findnext_SearchCount;    /* Number of entries to find */
  2022.           WORD                  findnext_FileInfoLevel; /* Search level */
  2023.          DWORD                  findnext_ResumeKey;     /* Server reserved resume key */
  2024.           WORD                  findnext_flags;         /* find flags */
  2025.                                                         /* Bit 0: set - close search after
  2026.                                                          *              this request.
  2027.                                                          * Bit 1: set - close search if end
  2028.                                                          *              of search reached.
  2029.                                                          * Bit 2: set - Requester requires
  2030.                                                          *              resume key for each
  2031.                                                          *              entry found.
  2032.                                                          * Bit 3: set - Continue search from
  2033.                                                          *              last entry returned.
  2034.                                                          *        clr - Rewind search. */
  2035.   BYTE   findnext_FileName[];   /* Name of file to resume search from */
  2036.   BYTE   smb_pad1[];            /* (optional) to pad to word or dword boundary */
  2037.   BYTE   smb_data[*];           /* Additional FileInfoLevel dependent match
  2038.                                  * information. For a search requiring extended
  2039.                                  * attribute matching the data buffer contains
  2040.                                  * the FEAList data for the seach.
  2041.  
  2042.  
  2043.  
  2044. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050. SMB Protocol Extensions    - 32 -          November 29, 1989
  2051.  
  2052.  
  2053.                                  */
  2054.  
  2055.  
  2056. Secondary Request Format (more data - may be zero or more of
  2057. these):
  2058.  
  2059.   BYTE   smb_wct;       /* value = 9 */
  2060.   WORD   smb_tpscnt;    /* total parmeter bytes sent */
  2061.   WORD   smb_tdscnt;    /* total number of data bytes being sent */
  2062.   WORD   smb_pscnt;     /* value = 0. All params in primary request */
  2063.   WORD   smb_psoff;     /* value = 0. No parameters in secondary request. */
  2064.   WORD   smb_psdisp;    /* value = 0. No parameters in secondary request. */
  2065.   WORD   smb_dscnt;     /* number of data bytes being sent this buffer */
  2066.   WORD   smb_dsoff;     /* offset (from start of SMB hdr) to data bytes */
  2067.   WORD   smb_dsdisp;    /* byte displacement for these data bytes */
  2068.   WORD   smb_fid;       /* search handle returned from find first */
  2069.   WORD   smb_bcc;       /* total bytes (including pad bytes) following */
  2070.   BYTE   smb_pad[];     /* (optional) to pad to word or dword boundary */
  2071.   BYTE   smb_data[*];   /* data bytes (* = value of smb_dscnt) */
  2072.  
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116. SMB Protocol Extensions    - 33 -          November 29, 1989
  2117.  
  2118.  
  2119. First Response Format :
  2120.  
  2121.   BYTE   smb_wct;        /* value = 10 */
  2122.   WORD   smb_tprcnt;     /* value = 6 */
  2123.   WORD   smb_tdrcnt;     /* value = total length of return data buffer  */
  2124.   WORD   smb_rsvd;       /* reserved */
  2125.   WORD   smb_prcnt;      /* parameter bytes returned in this buffer */
  2126.   WORD   smb_proff;      /* offset (from start of SMB hdr) to param bytes */
  2127.   WORD   smb_prdisp;     /* value = 0 byte displacement for param bytes */
  2128.   WORD   smb_drcnt;      /* data bytes returned in this buffer */
  2129.   WORD   smb_droff;      /* offset (from start of SMB hdr) to data bytes */
  2130.   WORD   smb_drdisp;     /* byte displacement for these data bytes */
  2131.   BYTE   smb_suwcnt;     /* value = 0 no set up return words */
  2132.   BYTE   smb_rsvd1;      /* reserved (pad above to word) */
  2133.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  2134.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  2135.   BYTE   smb_param[*];   /* The parmater block for the TRANSACT2_FINDNEXT
  2136.                           * function response is the find next specific return
  2137.                           * information in the following format. */
  2138.          WORD            findnext_searchcount;   /* Number of matching
  2139.                                                   * entries found */
  2140.          WORD            findnext_eos;           /* end of search indicator. */
  2141.          WORD            findnext_offerror;      /* error offset if EA error */
  2142.          WORD            findfirst_lastname;     /* 0 - server does not require
  2143.                                                   *     findnext_FileName[] in order
  2144.                                                   *     to continue search.
  2145.                                                   * else
  2146.                                                   *     offset from start of returned
  2147.                                                   *     data to filename of last
  2148.                                                   *     found entry returned.
  2149.                                                   */
  2150.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  2151.   BYTE   smb_data[*];    /* return data bytes (* = value of smb_dscnt) */
  2152.                          /* The data block contains the level dependent
  2153.                           * information about the matches found in the search.
  2154.                           *
  2155.                           * If bit 2 in the findfirst_flags is set, each
  2156.                           * returned file descriptor block will be preceeded
  2157.                           * by a four byte resume key.
  2158.                           */
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182. SMB Protocol Extensions    - 34 -          November 29, 1989
  2183.  
  2184.  
  2185. Subsequent Response Format :
  2186.  
  2187.  
  2188.   BYTE   smb_wct;       /* value = 10 */
  2189.   WORD   smb_tprcnt;    /* value = 6 */
  2190.   WORD   smb_tdrcnt;    /* value = total length of return data buffer  */
  2191.   WORD   smb_rsvd;      /* reserved */
  2192.   WORD   smb_prcnt;     /* value = 0 */
  2193.   WORD   smb_proff;     /* value = 0 */
  2194.   WORD   smb_prdisp;    /* value = 0 */
  2195.   WORD   smb_drcnt;     /* data bytes returned in this buffer */
  2196.   WORD   smb_droff;     /* offset (from start of SMB hdr) to data bytes */
  2197.   WORD   smb_drdisp;    /* byte displacement for these data bytes */
  2198.   BYTE   smb_suwcnt;    /* value = 0 no set up return words */
  2199.   BYTE   smb_rsvd1;     /* reserved (pad above to word) */
  2200.   WORD   smb_bcc;       /* total bytes (including pad bytes) following */
  2201.   BYTE   smb_pad1[];    /* (optional) to pad to word or dword boundary */
  2202.   BYTE   smb_data[*];   /* return data bytes (* = value of smb_dscnt) */
  2203.                         /* The data block contains the level dependent
  2204.                          * information about the matches found in the search.
  2205.                          *
  2206.                          * If bit 2 in the findfirst_flags is set, each
  2207.                          * returned file descriptor block will be preceeded
  2208.                          * by a four byte resume key.
  2209.                          */
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248. SMB Protocol Extensions    - 35 -          November 29, 1989
  2249.  
  2250.  
  2251. _6._0._1._1._4.  _T_R_A_N_S_A_C_T_2__Q_F_S_I_N_F_O
  2252.  
  2253. The function code TRANSACT2_QFSINFO in smb_setup[0]  in  the
  2254. primary  TRANSACT2  requests  identifies  a request to query
  2255. information about a file system.
  2256.  
  2257. Primary Request Format:
  2258.  
  2259.  
  2260.   BYTE   smb_wct;        /* value = 15 */
  2261.   WORD   smb_tpscnt;     /* value = 2, total parameter bytes being sent */
  2262.   WORD   smb_tdscnt;     /* total number of data bytes being sent */
  2263.   WORD   smb_mprcnt;     /* value = maximum return parameter length */
  2264.   WORD   smb_mdrcnt;     /* maximum data length to return */
  2265.   BYTE   smb_msrcnt;     /* value = 0. No setup words to return */
  2266.   BYTE   smb_rsvd;       /* reserved (pad above to word) */
  2267.   WORD   smb_flags;      /* additional information:
  2268.                              bit 0 - 0
  2269.                              bit 1 - 0   */
  2270.  DWORD   smb_timeout;    /* value = 0. Not used for qfsinfo */
  2271.   WORD   smb_rsvd1;      /* reserved */
  2272.   WORD   smb_pscnt;      /* value = 2, params are in primary request */
  2273.   WORD   smb_psoff;      /* offset (from start of SMB Hdr to parameter bytes */
  2274.   WORD   smb_dscnt;      /* value = 0, no data sent with qfsinfo */
  2275.   WORD   smb_dsoff;      /* value = 0, no data sent with qfsinfo */
  2276.   BYTE   smb_suwcnt;     /* value = 1 */
  2277.   BYTE   smb_rsvd2;      /* reserved (pad above to word) */
  2278.   WORD   smb_setup1;     /* value = 3  :- TRANSACT2_QFSINFO */
  2279.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  2280.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  2281.   BYTE   smb_param[*];   /* The parmater block for the
  2282.                           * TRANSACT2_QFSINFO function is
  2283.                           * the qfsinfo specific information
  2284.                           * in the following format. */
  2285.          WORD            qfsinfo_FSInfoLevel;  /* Level of information required */
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314. SMB Protocol Extensions    - 36 -          November 29, 1989
  2315.  
  2316.  
  2317. Response Format (One or more of these) :
  2318.  
  2319.   BYTE   smb_wct;       /* value = 10 */
  2320.   WORD   smb_tprcnt;    /* value = 0 */
  2321.   WORD   smb_tdrcnt;    /* value = total length of return data buffer  */
  2322.   WORD   smb_rsvd;      /* reserved */
  2323.   WORD   smb_prcnt;     /* value = 0, no return param bytes for QFSINFO */
  2324.   WORD   smb_proff;     /* offset (from start of SMB hdr) to param bytes */
  2325.   WORD   smb_prdisp;    /* value = 0 byte displacement for param bytes */
  2326.   WORD   smb_drcnt;     /* data bytes returned in this buffer */
  2327.   WORD   smb_droff;     /* offset (from start of SMB hdr) to data bytes */
  2328.   WORD   smb_drdisp;    /* byte displacement for these data bytes */
  2329.   BYTE   smb_suwcnt;    /* value = 0 no set up return words */
  2330.   BYTE   smb_rsvd1;     /* reserved (pad above to word) */
  2331.   WORD   smb_bcc;       /* total bytes (including pad bytes) following */
  2332.   BYTE   smb_pad1[];    /* (optional) to pad to word or dword boundary */
  2333.   BYTE   smb_data[*];   /* return data bytes (* = value of smb_dscnt) */
  2334.                         /* The data block contains the level dependent
  2335.                          * information about the file system.
  2336.                          */
  2337.  
  2338.  
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380. SMB Protocol Extensions    - 37 -          November 29, 1989
  2381.  
  2382.  
  2383. _6._0._1._1._5.  _T_R_A_N_S_A_C_T_2__S_E_T_F_S_I_N_F_O
  2384.  
  2385. The function code TRANSACT2_SETFSINFO in smb_setup[0] in the
  2386. primary  TRANSACT2  requests  identifies  a  request  to set
  2387. information for a file system device.
  2388.  
  2389. Primary Request Format:
  2390.  
  2391.  
  2392.   BYTE   smb_wct;        /* value = 15 */
  2393.   WORD   smb_tpscnt;     /* value = 2,total number of param bytes being sent */
  2394.   WORD   smb_tdscnt;     /* total number of data bytes being sent */
  2395.   WORD   smb_mprcnt;     /* value = maximum return parameter length */
  2396.   WORD   smb_mdrcnt;     /* value = 0. No data returned */
  2397.   BYTE   smb_msrcnt;     /* value = 0. No setup words to return */
  2398.   BYTE   smb_rsvd;       /* reserved (pad above to word) */
  2399.   WORD   smb_flags;      /* additional information:
  2400.                              bit 0 - 0
  2401.                              bit 1 - 0 */
  2402.  DWORD   smb_timeout;    /* value = 0. Not used for setfsinfo */
  2403.   WORD   smb_rsvd1;      /* reserved */
  2404.   WORD   smb_pscnt;      /* value = 4, all params are in primary request */
  2405.   WORD   smb_psoff;      /* offset (from start of SMB Hdr to parameter bytes */
  2406.   WORD   smb_dscnt;      /* number of data bytes being sent this buffer */
  2407.   WORD   smb_dsoff;      /* offset (from start of SMB hdr) to data bytes */
  2408.   BYTE   smb_suwcnt;     /* value = 1 */
  2409.   BYTE   smb_rsvd2;      /* reserved (pad above to word) */
  2410.   WORD   smb_setup1;     /* value = 4  :- TRANSACT2_SETFSINFO */
  2411.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  2412.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  2413.   BYTE   smb_param[*];   /* The parmater block for the
  2414.                           * TRANSACT2_SETFSINFO function is
  2415.                           * the setfsinfo specific information
  2416.                           * in the following format. */
  2417.          WORD            setfsinfo_FSInfoLevel;  /* Level of information
  2418.                                                   * provided */
  2419.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  2420.   BYTE   smb_data[*];    /* Level dependent file system information */
  2421.  
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446. SMB Protocol Extensions    - 38 -          November 29, 1989
  2447.  
  2448.  
  2449. Secondary Request Format (more data - may be zero or more of
  2450. these):
  2451.  
  2452.   BYTE   smb_wct;       /* value = 9 */
  2453.   WORD   smb_tpscnt;    /* totalnumber of parameter bytes being sent */
  2454.   WORD   smb_tdscnt;    /* total number of data bytes being sent */
  2455.   WORD   smb_pscnt;     /* value = 0. All params in primary request */
  2456.   WORD   smb_psoff;     /* value = 0. No parameters in secondary request. */
  2457.   WORD   smb_psdisp;    /* value = 0. No parameters in secondary request. */
  2458.   WORD   smb_dscnt;     /* number of data bytes being sent this buffer */
  2459.   WORD   smb_dsoff;     /* offset (from start of SMB hdr) to data bytes */
  2460.   WORD   smb_dsdisp;    /* byte displacement for these data bytes */
  2461.   WORD   smb_fid;       /* value = 0xffff, no handle on request */
  2462.   WORD   smb_bcc;       /* total bytes (including pad bytes) following */
  2463.   BYTE   smb_pad[];     /* (optional) to pad to word or dword boundary */
  2464.   BYTE   smb_data[*];   /* data bytes (* = value of smb_dscnt) */
  2465.  
  2466.  
  2467. Response Format (one only):
  2468.  
  2469.   BYTE   smb_wct;      /* value = 10 */
  2470.   WORD   smb_tprcnt;   /* value = 0 */
  2471.   WORD   smb_tdrcnt;   /* value = 0 no data bytes  */
  2472.   WORD   smb_rsvd;     /* reserved */
  2473.   WORD   smb_prcnt;    /* value = 0 no return parameters for setfsinfo */
  2474.   WORD   smb_proff;    /* offset (from start of SMB hdr) to param bytes */
  2475.   WORD   smb_prdisp;   /* value = 0 byte displacement for param bytes */
  2476.   WORD   smb_drcnt;    /* value = 0 no data bytes */
  2477.   WORD   smb_droff;    /* value = 0 no data bytes */
  2478.   WORD   smb_drdisp;   /* value = 0 no data bytes */
  2479.   BYTE   smb_suwcnt;   /* value = 0 no set up return words */
  2480.   BYTE   smb_rsvd1;    /* reserved (pad above to word) */
  2481.   WORD   smb_bcc;      /* value = 0 */
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512. SMB Protocol Extensions    - 39 -          November 29, 1989
  2513.  
  2514.  
  2515. _6._0._1._1._6.  _T_R_A_N_S_A_C_T_2__Q_P_A_T_H_I_N_F_O
  2516.  
  2517. The function code TRANSACT2_QPATHINFO in smb_setup[0] in the
  2518. primary  TRANSACT2  requests  identifies  a request to query
  2519. information about specific file or subdirectory.
  2520.  
  2521. Primary Request Format:
  2522.  
  2523.   BYTE   smb_wct;        /* value = 15 */
  2524.   WORD   smb_tpscnt;     /* value = total number of param bytes being sent */
  2525.   WORD   smb_tdscnt;     /* total number of data bytes being sent */
  2526.   WORD   smb_mprcnt;     /* value = maximum return parameter length */
  2527.   WORD   smb_mdrcnt;     /* maximum data length to return */
  2528.   BYTE   smb_msrcnt;     /* value = 0. No setup words to return */
  2529.   BYTE   smb_rsvd;       /* reserved (pad above to word) */
  2530.   WORD   smb_flags;      /* additional information:
  2531.                              bit 0 - 0
  2532.                              bit 1 - 0 */
  2533.  DWORD   smb_timeout;    /* value = 0. Not used for qpathinfo */
  2534.   WORD   smb_rsvd1;      /* reserved */
  2535.   WORD   smb_pscnt;      /* value = tpscnt, all params are in primary request */
  2536.   WORD   smb_psoff;      /* offset (from start of SMB hdr) to parameter bytes */
  2537.   WORD   smb_dscnt;      /* number of data bytes being sent this buffer */
  2538.   WORD   smb_dsoff;      /* offset (from start of SMB hdr) to data bytes */
  2539.   BYTE   smb_suwcnt;     /* value = 1 */
  2540.   BYTE   smb_rsvd2;      /* reserved (pad above to word) */
  2541.   WORD   smb_setup1;     /* value = 5  :- TRANSACT2_QPATHINFO */
  2542.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  2543.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  2544.   BYTE   smb_param[*];   /* The parmater block for the
  2545.                           * TRANSACT2_QPATHINFO function is the
  2546.                           * qpathinfo specific information
  2547.                           * in the following format. */
  2548.           WORD           qpathinfo_PathInfoLevel; /* Info level required. */
  2549.          DWORD           qpathinfo_rsvd;          /* Reserved.
  2550.                                                    * Must be zero. */
  2551.          BYTE            qpathinfo_PathName[];    /* File/directory name. */
  2552.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  2553.   BYTE   smb_data[*];    /* Additional FileInfoLevel dependent information */
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578. SMB Protocol Extensions    - 40 -          November 29, 1989
  2579.  
  2580.  
  2581. Secondary Request Format (more data - may be zero or more of
  2582. these):
  2583.  
  2584.   BYTE   smb_wct;       /* value = 9 */
  2585.   WORD   smb_tpscnt;    /* totalnumber of parameter bytes being sent */
  2586.   WORD   smb_tdscnt;    /* total number of data bytes being sent */
  2587.   WORD   smb_pscnt;     /* value = 0. All params in primary request */
  2588.   WORD   smb_psoff;     /* value = 0. No parameters in secondary request. */
  2589.   WORD   smb_psdisp;    /* value = 0. No parameters in secondary request. */
  2590.   WORD   smb_dscnt;     /* number of data bytes being sent this buffer */
  2591.   WORD   smb_dsoff;     /* offset (from start of SMB hdr) to data bytes */
  2592.   WORD   smb_dsdisp;    /* byte displacement for these data bytes */
  2593.   WORD   smb_fid;       /* value = 0xffff, no handle on request */
  2594.   WORD   smb_bcc;       /* total bytes (including pad bytes) following */
  2595.   BYTE   smb_pad[];     /* (optional) to pad to word or dword boundary */
  2596.   BYTE   smb_data[*];   /* data bytes (* = value of smb_dscnt) */
  2597.  
  2598.  
  2599. First Response Format :
  2600.  
  2601.   BYTE   smb_wct;        /* value = 10 */
  2602.   WORD   smb_tprcnt;     /* value = 2 */
  2603.   WORD   smb_tdrcnt;     /* value = total length of return data buffer  */
  2604.   WORD   smb_rsvd;       /* reserved */
  2605.   WORD   smb_prcnt;      /* value = 2 param bytes returned for QFSINFO */
  2606.   WORD   smb_proff;      /* offset (from start of SMB hdr) to param bytes */
  2607.   WORD   smb_prdisp;     /* value = 0 byte displacement for param bytes */
  2608.   WORD   smb_drcnt;      /* data bytes returned in this buffer */
  2609.   WORD   smb_droff;      /* offset (from start of SMB hdr) to data bytes */
  2610.   WORD   smb_drdisp;     /* byte displacement for these data bytes */
  2611.   BYTE   smb_suwcnt;     /* value = 0 no set up return words */
  2612.   BYTE   smb_rsvd1;      /* reserved (pad above to word) */
  2613.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  2614.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  2615.   BYTE   smb_param[*];   /* The parmater block for the
  2616.                           * TRANSACT2_QPATHINFO response is
  2617.                           * the qpathinfo specific return
  2618.                           * information in the following format. */
  2619.           WORD           qpathinfo_offerror;      /* error offset if EA error */
  2620.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  2621.   BYTE   smb_data[*];    /* return data bytes (* = value of smb_dscnt) */
  2622.                          /* The data block contains the requested level
  2623.                           * dependent information about the path.
  2624.                           */
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644. SMB Protocol Extensions    - 41 -          November 29, 1989
  2645.  
  2646.  
  2647. Subsequent Response Format :
  2648.  
  2649.   BYTE   smb_wct;       /* value = 10 */
  2650.   WORD   smb_tprcnt;    /* value = 2 */
  2651.   WORD   smb_tdrcnt;    /* value = total length of return data buffer  */
  2652.   WORD   smb_rsvd;      /* reserved */
  2653.   WORD   smb_prcnt;     /* value = 0 */
  2654.   WORD   smb_proff;     /* value = 0 */
  2655.   WORD   smb_prdisp;    /* value = 0 */
  2656.   WORD   smb_drcnt;     /* data bytes returned in this buffer */
  2657.   WORD   smb_droff;     /* offset (from start of SMB hdr) to data bytes */
  2658.   WORD   smb_drdisp;    /* byte displacement for these data bytes */
  2659.   BYTE   smb_suwcnt;    /* value = 0 no set up return words */
  2660.   BYTE   smb_rsvd1;     /* reserved (pad above to word) */
  2661.   WORD   smb_bcc;       /* total bytes (including pad bytes) following */
  2662.   BYTE   smb_pad1[];    /* (optional) to pad to word or dword boundary */
  2663.   BYTE   smb_data[*];   /* return data bytes (* = value of smb_dscnt) */
  2664.                         /* The data block contains the requested level
  2665.                          * dependent information about the path.
  2666.                          */
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710. SMB Protocol Extensions    - 42 -          November 29, 1989
  2711.  
  2712.  
  2713. _6._0._1._1._7.  _T_R_A_N_S_A_C_T_2__S_E_T_P_A_T_H_I_N_F_O
  2714.  
  2715. The function code TRANSACT2_SETPATHINFO in  smb_setup[0]  in
  2716. the  primary  TRANSACT2 requests identifies a request to set
  2717. information for a file or directory.
  2718.  
  2719. Primary Request Format:
  2720.  
  2721.  
  2722.   BYTE   smb_wct;        /* value = 15 */
  2723.   WORD   smb_tpscnt;     /* value = total number of param bytes being sent */
  2724.   WORD   smb_tdscnt;     /* total number of data bytes being sent */
  2725.   WORD   smb_mprcnt;     /* value = maximum return parameter length */
  2726.   WORD   smb_mdrcnt;     /* value = 0. No data returned */
  2727.   BYTE   smb_msrcnt;     /* value = 0. No setup words to return */
  2728.   BYTE   smb_rsvd;       /* reserved (pad above to word) */
  2729.   WORD   smb_flags;      /* additional information:
  2730.                              bit 0 - 0
  2731.                              bit 1 - 0  */
  2732.  DWORD   smb_timeout;    /* value = 0. Not used for setpathinfo */
  2733.   WORD   smb_rsvd1;      /* reserved */
  2734.   WORD   smb_pscnt;      /* value = tpscnt, params are in primary request */
  2735.   WORD   smb_psoff;      /* offset (from start of SMB Hdr to param bytes */
  2736.   WORD   smb_dscnt;      /* number of data bytes being sent this buffer */
  2737.   WORD   smb_dsoff;      /* offset (from start of SMB hdr) to data bytes */
  2738.   BYTE   smb_suwcnt;     /* value = 1 */
  2739.   BYTE   smb_rsvd2;      /* reserved (pad above to word) */
  2740.   WORD   smb_setup1;     /* value = 6  :- TRANSACT2_SETPATHINFO */
  2741.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  2742.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  2743.   BYTE   smb_param[*];   /* The parmater block for the
  2744.                           * TRANSACT2_SETPATHINFO function is
  2745.                           * the setpathinfo specific information
  2746.                           * in the following format. */
  2747.           WORD           setpathinfo_PathInfoLevel;  /* Info level supplied. */
  2748.          DWORD           setpathinfo_rsvd;           /* Reserved.
  2749.                                                       * Must be zero. */
  2750.           BYTE           setpathinfo_pathname[];     /* path name to set
  2751.                                                       * information on */
  2752.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  2753.   BYTE   smb_data[*];    /* Additional FileInfoLevel dependent information. */
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776. SMB Protocol Extensions    - 43 -          November 29, 1989
  2777.  
  2778.  
  2779. Secondary Request Format (more data - may be zero or more of
  2780. these):
  2781.  
  2782.   BYTE   smb_wct;       /* value = 9 */
  2783.   WORD   smb_tpscnt;    /* totalnumber of parameter bytes being sent */
  2784.   WORD   smb_tdscnt;    /* total number of data bytes being sent */
  2785.   WORD   smb_pscnt;     /* value = 0. All params in primary request */
  2786.   WORD   smb_psoff;     /* value = 0. No parameters in secondary request. */
  2787.   WORD   smb_psdisp;    /* value = 0. No parameters in secondary request. */
  2788.   WORD   smb_dscnt;     /* number of data bytes being sent this buffer */
  2789.   WORD   smb_dsoff;     /* offset (from start of SMB hdr) to data bytes */
  2790.   WORD   smb_dsdisp;    /* byte displacement for these data bytes */
  2791.   WORD   smb_fid;       /* value = 0xffff, no handle on request */
  2792.   WORD   smb_bcc;       /* total bytes (including pad bytes) following */
  2793.   BYTE   smb_pad[];     /* (optional) to pad to word or dword boundary */
  2794.   BYTE   smb_data[*];   /* data bytes (* = value of smb_dscnt) */
  2795.  
  2796.  
  2797. Response Format (one only):
  2798.  
  2799.   BYTE   smb_wct;        /* value = 10 */
  2800.   WORD   smb_tprcnt;     /* value = 2 */
  2801.   WORD   smb_tdrcnt;     /* value = 0 no data bytes  */
  2802.   WORD   smb_rsvd;       /* reserved */
  2803.   WORD   smb_prcnt;      /* value = 2 parameter bytes being returned */
  2804.   WORD   smb_proff;      /* offset (from start of SMB hdr) to param bytes */
  2805.   WORD   smb_prdisp;     /* value = 0 byte displacement for param bytes */
  2806.   WORD   smb_drcnt;      /* value = 0 no data bytes */
  2807.   WORD   smb_droff;      /* value = 0 no data bytes */
  2808.   WORD   smb_drdisp;     /* value = 0 no data bytes */
  2809.   BYTE   smb_suwcnt;     /* value = 0 no set up return words */
  2810.   BYTE   smb_rsvd1;      /* reserved (pad above to word) */
  2811.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  2812.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  2813.   BYTE   smb_param[*];   /* The parmater block for the
  2814.                           * TRANSACT2_SETPATHINFO function
  2815.                           * response is the setpathinfo
  2816.                           * specific return information in
  2817.                           * the following format. */
  2818.          WORD            setpathinfo_offerror;  /* offset into FEAList data
  2819.                                                  * of first error which
  2820.                                                  * occured while setting
  2821.                                                  * the extended attributes. */
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842. SMB Protocol Extensions    - 44 -          November 29, 1989
  2843.  
  2844.  
  2845. _6._0._1._1._8.  _T_R_A_N_S_A_C_T_2__Q_F_I_L_E_I_N_F_O
  2846.  
  2847. The function code TRANSACT2_QFILEINFO in smb_setup[0] in the
  2848. primary  TRANSACT2  requests  identifies  a request to query
  2849. information about specific file.
  2850.  
  2851. Primary Request Format:
  2852.  
  2853.  
  2854.   BYTE   smb_wct;        /* value = 15 */
  2855.   WORD   smb_tpscnt;     /* value = 4,total number of param bytes being sent */
  2856.   WORD   smb_tdscnt;     /* total number of data bytes being sent */
  2857.   WORD   smb_mprcnt;     /* value = maximum return parameter length */
  2858.   WORD   smb_mdrcnt;     /* maximum data length to return */
  2859.   BYTE   smb_msrcnt;     /* value = 0. No setup words to return */
  2860.   BYTE   smb_rsvd;       /* reserved (pad above to word) */
  2861.   WORD   smb_flags;      /* additional information:
  2862.                              bit 0 - 0
  2863.                              bit 1 - 0  */
  2864.  DWORD   smb_timeout;    /* value = 0. Not used for qfileinfo */
  2865.   WORD   smb_rsvd1;      /* reserved */
  2866.   WORD   smb_pscnt;      /* value = 4, all params are in primary request */
  2867.   WORD   smb_psoff;      /* offset (from start of SMB hdr) to param bytes */
  2868.   WORD   smb_dscnt;      /* number of data bytes being sent this buffer */
  2869.   WORD   smb_dsoff;      /* offset (from start of SMB hdr) to data bytes */
  2870.   BYTE   smb_suwcnt;     /* value = 1 */
  2871.   BYTE   smb_rsvd2;      /* reserved (pad above to word) */
  2872.   WORD   smb_setup1;     /* value = 7  :- TRANSACT2_QFILEINFO */
  2873.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  2874.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  2875.   BYTE   smb_param[*];   /* The parmater block for the
  2876.                          * TRANSACT2_QFILEINFO function
  2877.                          * is the qfileinfo specific information
  2878.                          * in the following format. */
  2879.          WORD            qfileinfo_FileHandle;    /* File handle. */
  2880.          WORD            qfileinfo_FileInfoLevel; /* Info level required. */
  2881.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  2882.   BYTE   smb_data[*];    /* Additional FileInfoLevel dependent information. */
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908. SMB Protocol Extensions    - 45 -          November 29, 1989
  2909.  
  2910.  
  2911. Secondary Request Format (more data - may be zero or more of
  2912. these):
  2913.  
  2914.   BYTE   smb_wct;       /* value = 9 */
  2915.   WORD   smb_tpscnt;    /* totalnumber of parameter bytes being sent */
  2916.   WORD   smb_tdscnt;    /* total number of data bytes being sent */
  2917.   WORD   smb_pscnt;     /* value = 0. All params in primary request */
  2918.   WORD   smb_psoff;     /* value = 0. No parameters in secondary request. */
  2919.   WORD   smb_psdisp;    /* value = 0. No parameters in secondary request. */
  2920.   WORD   smb_dscnt;     /* number of data bytes being sent this buffer */
  2921.   WORD   smb_dsoff;     /* offset (from start of SMB hdr) to data bytes */
  2922.   WORD   smb_dsdisp;    /* byte displacement for these data bytes */
  2923.   WORD   smb_fid;       /* file handle */
  2924.   WORD   smb_bcc;       /* total bytes (including pad bytes) following */
  2925.   BYTE   smb_pad[];     /* (optional) to pad to word or dword boundary */
  2926.   BYTE   smb_data[*];   /* data bytes (* = value of smb_dscnt) */
  2927.  
  2928.  
  2929. First Response Format :
  2930.  
  2931.   BYTE   smb_wct;        /* value = 10 */
  2932.   WORD   smb_tprcnt;     /* value = 2 */
  2933.   WORD   smb_tdrcnt;     /* value = total length of return data buffer  */
  2934.   WORD   smb_rsvd;       /* reserved */
  2935.   WORD   smb_prcnt;      /* value = 2 no param bytes returned for qfileinfo */
  2936.   WORD   smb_proff;      /* offset (from start of SMB hdr) to param bytes */
  2937.   WORD   smb_prdisp;     /* value = 0 byte displacement for param bytes */
  2938.   WORD   smb_drcnt;      /* data bytes returned in this buffer */
  2939.   WORD   smb_droff;      /* offset (from start of SMB hdr) to data bytes */
  2940.   WORD   smb_drdisp;     /* byte displacement for these data bytes */
  2941.   BYTE   smb_suwcnt;     /* value = 0 no set up return words */
  2942.   BYTE   smb_rsvd1;      /* reserved (pad above to word) */
  2943.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  2944.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  2945.   BYTE   smb_param[*];   /* The parmater block for the
  2946.                           * TRANSACT2_QFILEINFO response is
  2947.                           * the qfileinfo specific return
  2948.                           * information in the following format. */
  2949.           WORD              qfileinfo_offerror;      /* error offset if EA error */
  2950.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  2951.   BYTE   smb_data[*];    /* return data bytes (* = value of smb_dscnt) */
  2952.                          /* The data block contains the requested level
  2953.                           * dependent information about the file. */
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974. SMB Protocol Extensions    - 46 -          November 29, 1989
  2975.  
  2976.  
  2977. Subsequent Response Format :
  2978.  
  2979.   BYTE   smb_wct;       /* value = 10 */
  2980.   WORD   smb_tprcnt;    /* value = 2 */
  2981.   WORD   smb_tdrcnt;    /* value = total length of return data buffer  */
  2982.   WORD   smb_rsvd;      /* reserved */
  2983.   WORD   smb_prcnt;     /* value = 0 */
  2984.   WORD   smb_proff;     /* value = 0 */
  2985.   WORD   smb_prdisp;    /* value = 0 */
  2986.   WORD   smb_drcnt;     /* data bytes returned in this buffer */
  2987.   WORD   smb_droff;     /* offset (from start of SMB hdr) to data bytes */
  2988.   WORD   smb_drdisp;    /* byte displacement for these data bytes */
  2989.   BYTE   smb_suwcnt;    /* value = 0 no set up return words */
  2990.   BYTE   smb_rsvd1;     /* reserved (pad above to word) */
  2991.   WORD   smb_bcc;       /* total bytes (including pad bytes) following */
  2992.   BYTE   smb_pad1[];    /* (optional) to pad to word or dword boundary */
  2993.   BYTE   smb_data[*];   /* return data bytes (* = value of smb_dscnt) */
  2994.                         /* The data block contains the requested level
  2995.                          * dependent information about the file. */
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040. SMB Protocol Extensions    - 47 -          November 29, 1989
  3041.  
  3042.  
  3043. _6._0._1._1._9.  _T_R_A_N_S_A_C_T_2__S_E_T_F_I_L_E_I_N_F_O
  3044.  
  3045. The function code TRANSACT2_SETFILEINFO in  smb_setup[0]  in
  3046. the  primary  TRANSACT2 requests identifies a request to set
  3047. information for a specific file.
  3048.  
  3049. Primary Request Format:
  3050.  
  3051.  
  3052.   BYTE   smb_wct;        /* value = 15 */
  3053.   WORD   smb_tpscnt;     /* value = 6, total param bytes being sent */
  3054.   WORD   smb_tdscnt;     /* total number of data bytes being sent */
  3055.   WORD   smb_mprcnt;     /* value = maximum return parameter length */
  3056.   WORD   smb_mdrcnt;     /* value = 0. No data returned */
  3057.   BYTE   smb_msrcnt;     /* value = 0. No setup words to return */
  3058.   BYTE   smb_rsvd;       /* reserved (pad above to word) */
  3059.   WORD   smb_flags;      /* additional information:
  3060.                              bit 0 - 0
  3061.                              bit 1 - 0  */
  3062.  DWORD   smb_timeout;    /* value = 0. Not used for setfileinfo */
  3063.   WORD   smb_rsvd1;      /* reserved */
  3064.   WORD   smb_pscnt;      /* value = 6, parms must be in primary request */
  3065.   WORD   smb_psoff;      /* offset (from start of SMB Hdr to parameter bytes */
  3066.   WORD   smb_dscnt;      /* number of data bytes being sent this buffer */
  3067.   WORD   smb_dsoff;      /* offset (from start of SMB hdr) to data bytes */
  3068.   BYTE   smb_suwcnt;     /* value = 1 */
  3069.   BYTE   smb_rsvd2;      /* reserved (pad above to word) */
  3070.   WORD   smb_setup1;     /* value = 8  :- TRANSACT2_SETFILEINFO */
  3071.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  3072.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  3073.   BYTE   smb_param[*];   /* The parmater block for the
  3074.                           * TRANSACT2_SETFILEINFO function is
  3075.                           * the setfileinfo specific information
  3076.                           * in the following format. */
  3077.          WORD            setfileinfo_FileHandle;    /* File handle. */
  3078.          WORD            setfileinfo_FileInfoLevel; /* Info level supplied. */
  3079.          WORD            setfileinfo_IOFlag;        /* Flag
  3080.                                                      * 0x0010 - Write through
  3081.                                                      * 0x0020 - No cache */
  3082.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  3083.   BYTE   smb_data[*];    /* Additional FileInfoLevel dependent information.
  3084.                          /* For level = 2, smb_data[] contains the FEAList
  3085.                           * structure to set for this file. */
  3086.  
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099.  
  3100. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106. SMB Protocol Extensions    - 48 -          November 29, 1989
  3107.  
  3108.  
  3109. Secondary Request Format (more data - may be zero or more of
  3110. these):
  3111.  
  3112.   BYTE   smb_wct;       /* value = 9 */
  3113.   WORD   smb_tpscnt;    /* value = 4 */
  3114.   WORD   smb_tdscnt;    /* total number of data bytes being sent */
  3115.   WORD   smb_pscnt;     /* value = 0. All params in primary request */
  3116.   WORD   smb_psoff;     /* value = 0. No parameters in secondary request. */
  3117.   WORD   smb_psdisp;    /* value = 0. No parameters in secondary request. */
  3118.   WORD   smb_dscnt;     /* number of data bytes being sent this buffer */
  3119.   WORD   smb_dsoff;     /* offset (from start of SMB hdr) to data bytes */
  3120.   WORD   smb_dsdisp;    /* byte displacement for these data bytes */
  3121.   WORD   smb_fid;       /* file handle */
  3122.   WORD   smb_bcc;       /* total bytes (including pad bytes) following */
  3123.   BYTE   smb_pad[];     /* (optional) to pad to word or dword boundary */
  3124.   BYTE   smb_data[*];   /* data bytes (* = value of smb_dscnt) */
  3125.  
  3126.  
  3127. Response Format (one only):
  3128.  
  3129.   BYTE   smb_wct;        /* value = 10 */
  3130.   WORD   smb_tprcnt;     /* value = 2 */
  3131.   WORD   smb_tdrcnt;     /* value = 0 no data bytes  */
  3132.   WORD   smb_rsvd;       /* reserved */
  3133.   WORD   smb_prcnt;      /* value = 2 parameter bytes being returned */
  3134.   WORD   smb_proff;      /* offset (from start of SMB hdr) to param bytes */
  3135.   WORD   smb_prdisp;     /* value = 0, byte displacement for these params */
  3136.   WORD   smb_drcnt;      /* value = 0 no data bytes */
  3137.   WORD   smb_droff;      /* value = 0 no data bytes */
  3138.   WORD   smb_drdisp;     /* value = 0 no data bytes */
  3139.   BYTE   smb_suwcnt;     /* value = 0 no set up return words */
  3140.   BYTE   smb_rsvd1;      /* reserved (pad above to word) */
  3141.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  3142.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  3143.   BYTE   smb_param[*];   /* The parmater block for the
  3144.                           * TRANSACT2_SETFILEINFO function
  3145.                           * response is the setfileinfo specific
  3146.                           * return information in the
  3147.                           * following format. */
  3148.          WORD            setfileinfo_offerror;  /* offset into FEAList
  3149.                                                  * data of first error
  3150.                                                  * which occured while
  3151.                                                  * setting the extended
  3152.                                                  * attributes. */
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172. SMB Protocol Extensions    - 49 -          November 29, 1989
  3173.  
  3174.  
  3175. _6._0._1._1._1_0.  _T_R_A_N_S_A_C_T_2__F_S_C_T_L
  3176.  
  3177. The function code TRANSACT2_FSCTL  in  smb_setup[0]  in  the
  3178. primary  TRANSACT2 requests identifies a file system control
  3179. request.
  3180.  
  3181. Primary Request Format:
  3182.  
  3183.  
  3184.   BYTE   smb_wct;        /* value = 14 + value of smb_suwcnt */
  3185.   WORD   smb_tpscnt;     /* value = total number of param bytes being sent */
  3186.   WORD   smb_tdscnt;     /* total number of data bytes being sent */
  3187.   WORD   smb_mprcnt;     /* value = maximum return parameter length */
  3188.   WORD   smb_mdrcnt;     /* maximum data length to return */
  3189.   BYTE   smb_msrcnt;     /* value = 1. Function return code */
  3190.   BYTE   smb_rsvd;       /* reserved (pad above to word) */
  3191.   WORD   smb_flags;      /* additional information:
  3192.                              bit 0 - 0
  3193.                              bit 1 - 0 */
  3194.  DWORD   smb_timeout;    /* value = 0. Not used for fsctl */
  3195.   WORD   smb_rsvd1;      /* reserved */
  3196.   WORD   smb_pscnt;      /* number of param bytes being sent in this buffer */
  3197.   WORD   smb_psoff;      /* offset (from start of SMB hdr) to parameter bytes */
  3198.   WORD   smb_dscnt;      /* number of data bytes being sent this buffer */
  3199.   WORD   smb_dsoff;      /* offset (from start of SMB hdr) to data bytes */
  3200.   BYTE   smb_suwcnt;     /* value = number of setup words in this buffer */
  3201.   BYTE   smb_rsvd2;      /* reserved (pad above to word) */
  3202.   WORD   smb_setup[];    /* The setup word array for the
  3203.                           * TRANSACT2_FSINFO function is the
  3204.                           * fsctl specific information
  3205.                           * in the following format. */
  3206.          WORD            9 :- TRANSACT2_FSCTL;   /* TRANS2 command code. */
  3207.          WORD            fsctl_FileHandle;       /* File handle. */
  3208.          WORD            fsctl_Function code;    /* FsCtl function code */
  3209.          WORD            fsctl_RouteMethod;      /* Method for routing. */
  3210.          BYTE            fsctl_RouteName[];      /* The route name byte
  3211.                                                   * array is zero padded
  3212.                                                   * to an even length. */
  3213.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  3214.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  3215.   BYTE   smb_param[*];   /* File system specific parameter block. */
  3216.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  3217.   BYTE   smb_data[*];    /* File system specific data block. */
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238. SMB Protocol Extensions    - 50 -          November 29, 1989
  3239.  
  3240.  
  3241. Secondary Request Format (more data - may be zero or more of
  3242. these):
  3243.  
  3244.   BYTE   smb_wct;        /* value = 9 */
  3245.   WORD   smb_tpscnt;     /* totalnumber of parameter bytes being sent */
  3246.   WORD   smb_tdscnt;     /* total number of data bytes being sent */
  3247.   WORD   smb_pscnt;      /* number of parameter bytes being sent this buffer */
  3248.   WORD   smb_psoff;      /* offset (from start of SMB hdr) to parameter bytes */
  3249.   WORD   smb_psdisp;     /* byte displacement for these parameter bytes */
  3250.   WORD   smb_dscnt;      /* number of data bytes being sent this buffer */
  3251.   WORD   smb_dsoff;      /* offset (from start of SMB hdr) to data bytes */
  3252.   WORD   smb_dsdisp;     /* byte displacement for these data bytes */
  3253.   WORD   smb_fid;        /* file handle */
  3254.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  3255.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  3256.   BYTE   smb_param[*];   /* File system specific parameter block. */
  3257.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  3258.   BYTE   smb_data[*];    /* data bytes (* = value of smb_dscnt) */
  3259.  
  3260.  
  3261. Response Format :
  3262.  
  3263.   BYTE   smb_wct;        /* value = 10 */
  3264.   WORD   smb_tprcnt;     /* value = total length of return parameter buffer  */
  3265.   WORD   smb_tdrcnt;     /* value = total length of return data buffer  */
  3266.   WORD   smb_rsvd;       /* reserved */
  3267.   WORD   smb_prcnt;      /* parameter bytes returned in this buffer */
  3268.   WORD   smb_proff;      /* offset (from start of SMB hdr) to parameter bytes */
  3269.   WORD   smb_prdisp;     /* value = 0 byte displacement for these param bytes */
  3270.   WORD   smb_drcnt;      /* data bytes returned in this buffer */
  3271.   WORD   smb_droff;      /* offset (from start of SMB hdr) to data bytes */
  3272.   WORD   smb_drdisp;     /* byte displacement for these data bytes */
  3273.   BYTE   smb_suwcnt;     /* value = 0, no set up return words */
  3274.   BYTE   smb_rsvd1;      /* reserved (pad above to word) */
  3275.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  3276.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  3277.   BYTE   smb_param[*];   /* File system specific return parameter block */
  3278.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  3279.   BYTE   smb_data[*];    /* File system specific return data block. */
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304. SMB Protocol Extensions    - 51 -          November 29, 1989
  3305.  
  3306.  
  3307. _6._0._1._1._1_1.  _T_R_A_N_S_A_C_T_2__I_O_C_T_L
  3308.  
  3309. The function code TRANSACT2_IOCTL  in  smb_setup[0]  in  the
  3310. primary  TRANSACT2  requests  identifies  a  device  control
  3311. request.
  3312.  
  3313. Primary Request Format:
  3314.  
  3315.  
  3316.   BYTE   smb_wct;        /* value = 18 */
  3317.   WORD   smb_tpscnt;     /* value = total number of param bytes being sent */
  3318.   WORD   smb_tdscnt;     /* total number of data bytes being sent */
  3319.   WORD   smb_mprcnt;     /* value = maximum return parameter length */
  3320.   WORD   smb_mdrcnt;     /* maximum data length to return */
  3321.   BYTE   smb_msrcnt;     /* value = 1. Function return code */
  3322.   BYTE   smb_rsvd;       /* reserved (pad above to word) */
  3323.   WORD   smb_flags;      /* additional information:
  3324.                              bit 0 - 0
  3325.                              bit 1 - 0 */
  3326.  DWORD   smb_timeout;    /* value = 0. Not used for fsctl */
  3327.   WORD   smb_rsvd1;      /* reserved */
  3328.   WORD   smb_pscnt;      /* number of param bytes being sent in this buffer */
  3329.   WORD   smb_psoff;      /* offset (from start of SMB hdr) to parameter bytes */
  3330.   WORD   smb_dscnt;      /* number of data bytes being sent this buffer */
  3331.   WORD   smb_dsoff;      /* offset (from start of SMB hdr) to data bytes */
  3332.   BYTE   smb_suwcnt;     /* value = number of setup words in this buffer */
  3333.   BYTE   smb_rsvd2;      /* reserved (pad above to word) */
  3334.   WORD   smb_setup[];    /* The setup word array for the
  3335.                           * TRANSACT2_IOCTL function is the ioctl
  3336.                           * functiom specific information
  3337.                           * in the following format. */
  3338.          WORD            10 :- TRANSACT2_IOCTL;  /* Function code. */
  3339.          WORD            ioctl_DevHandle;        /* Device handle. */
  3340.          WORD            ioctl_Category;         /* Device catgory. */
  3341.          WORD            ioctl_Function;         /* Device function. */
  3342.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  3343.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  3344.   BYTE   smb_param[*];   /* Device/function specific parameter block. */
  3345.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  3346.   BYTE   smb_data[*];    /* Device/function specific data block. */
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370. SMB Protocol Extensions    - 52 -          November 29, 1989
  3371.  
  3372.  
  3373. Secondary Request Format (more data - may be zero or more of
  3374. these):
  3375.  
  3376.   BYTE   smb_wct;        /* value = 9 */
  3377.   WORD   smb_tpscnt;     /* totalnumber of parameter bytes being sent */
  3378.   WORD   smb_tdscnt;     /* total number of data bytes being sent */
  3379.   WORD   smb_pscnt;      /* number of parameter bytes being sent this buffer */
  3380.   WORD   smb_psoff;      /* offset (from start of SMB hdr) to parameter bytes */
  3381.   WORD   smb_psdisp;     /* byte displacement for these parameter bytes */
  3382.   WORD   smb_dscnt;      /* number of data bytes being sent this buffer */
  3383.   WORD   smb_dsoff;      /* offset (from start of SMB hdr) to data bytes */
  3384.   WORD   smb_dsdisp;     /* byte displacement for these data bytes */
  3385.   WORD   smb_fid;        /* file handle */
  3386.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  3387.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  3388.   BYTE   smb_param[*];   /* Device/function specific parameter block. */
  3389.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  3390.   BYTE   smb_data[*];    /* data bytes (* = value of smb_dscnt) */
  3391.  
  3392.  
  3393. Response Format :
  3394.  
  3395.   BYTE   smb_wct;        /* value = 10 */
  3396.   WORD   smb_tprcnt;     /* value = total length of return parameter buffer  */
  3397.   WORD   smb_tdrcnt;     /* value = total length of return data buffer  */
  3398.   WORD   smb_rsvd;       /* reserved */
  3399.   WORD   smb_prcnt;      /* parameter bytes returned in this buffer */
  3400.   WORD   smb_proff;      /* offset (from start of SMB hdr) to parameter bytes */
  3401.   WORD   smb_prdisp;     /* value = 0 byte displacement for these param bytes */
  3402.   WORD   smb_drcnt;      /* data bytes returned in this buffer */
  3403.   WORD   smb_droff;      /* offset (from start of SMB hdr) to data bytes */
  3404.   WORD   smb_drdisp;     /* byte displacement for these data bytes */
  3405.   BYTE   smb_suwcnt;     /* value = 0, no set up return words */
  3406.   BYTE   smb_rsvd1;      /* reserved (pad above to word) */
  3407.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  3408.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  3409.   BYTE   smb_param[*];   /* Device/function specific return parameter block */
  3410.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  3411.   BYTE   smb_data[*];    /* Device/function specific return data block. */
  3412.  
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.  
  3429.  
  3430. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436. SMB Protocol Extensions    - 53 -          November 29, 1989
  3437.  
  3438.  
  3439. _6._0._1._1._1_2.  _T_R_A_N_S_A_C_T_2__F_I_N_D_N_O_T_I_F_Y_F_I_R_S_T
  3440.  
  3441. The function code TRANSACT2_FINDNOTIFYFIRST in  smb_setup[0]
  3442. in  the  primary  TRANSACT2  request identifies a request to
  3443. commence monitoring changes to a specific file or directory.
  3444.  
  3445. Primary Request Format:
  3446.  
  3447.  
  3448.   BYTE   smb_wct;        /* value = 15 */
  3449.   WORD   smb_tpscnt;     /* value = total number of param bytes being sent */
  3450.   WORD   smb_tdscnt;     /* total size of extended attribute list */
  3451.   WORD   smb_mprcnt;     /* value = maximum return parameter length */
  3452.   WORD   smb_mdrcnt;     /* value = maximum return data length */
  3453.   BYTE   smb_msrcnt;     /* value = 0. No setup words to return */
  3454.   BYTE   smb_rsvd;       /* reserved (pad above to word) */
  3455.   WORD   smb_flags;      /* additional information:
  3456.                              bit 0 - 0
  3457.                              bit 1 - 0
  3458.  DWORD   smb_timeout;    /* Specifies duration to wait for changes */
  3459.   WORD   smb_rsvd1;      /* reserved */
  3460.   WORD   smb_pscnt;      /* value = tpscnt, parms must be in primary request */
  3461.   WORD   smb_psoff;      /* offset (from start of SMB hdr to parameter bytes */
  3462.   WORD   smb_dscnt;      /* number of data bytes being sent this buffer */
  3463.   WORD   smb_dsoff;      /* offset (from start of SMB hdr) to data bytes */
  3464.   BYTE   smb_suwcnt;     /* value = 1 */
  3465.   BYTE   smb_rsvd2;      /* reserved (pad above to word) */
  3466.   WORD   smb_setup1;     /* value = 11  :- TRANSACT2_FINDNOTIFYFIRST */
  3467.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  3468.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  3469.   BYTE   smb_param[*];   /* The parmater block for the
  3470.                             TRANSACT2_FINDNOTIFYFIRST function is the find
  3471.                             first specific information in the
  3472.                             following format. */
  3473.           WORD           findnfirst_Attribute;     /* Search attribute */
  3474.           WORD           findnfirst_ChangeCount;   /* Number of changes
  3475.                                                     * to wait for */
  3476.           WORD           findnfirst_Level;         /* Info level required */
  3477.          DWORD           findfirst_rsvd;           /* Reserved (must be zero) */
  3478.           BYTE           findnfirst_PathSpec[];
  3479.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  3480.   BYTE   smb_data[*];    /* Additional level dependent match data */
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.  
  3495.  
  3496. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502. SMB Protocol Extensions    - 54 -          November 29, 1989
  3503.  
  3504.  
  3505. Secondary Request Format (more data - may be zero or more of
  3506. these):
  3507.  
  3508.   BYTE   smb_wct;       /* value = 9 */
  3509.   WORD   smb_tpscnt;    /* totalnumber of parameter bytes being sent */
  3510.   WORD   smb_tdscnt;    /* total number of data bytes being sent */
  3511.   WORD   smb_pscnt;     /* value = 0. All params in primary request */
  3512.   WORD   smb_psoff;     /* value = 0. No parameters in secondary request. */
  3513.   WORD   smb_psdisp;    /* value = 0. No parameters in secondary request. */
  3514.   WORD   smb_dscnt;     /* number of data bytes being sent this buffer */
  3515.   WORD   smb_dsoff;     /* offset (from start of SMB hdr) to data bytes */
  3516.   WORD   smb_dsdisp;    /* byte displacement for these data bytes */
  3517.   WORD   smb_fid;       /* value = 0xffff no handle on request */
  3518.   WORD   smb_bcc;       /* total bytes (including pad bytes) following */
  3519.   BYTE   smb_pad[];     /* (optional) to pad to word or dword boundary */
  3520.   BYTE   smb_data[*];   /* data bytes (* = value of smb_dscnt) */
  3521.  
  3522.  
  3523. First Response Format :
  3524.  
  3525.   BYTE   smb_wct;        /* value = 10 */
  3526.   WORD   smb_tprcnt;     /* value = 6 */
  3527.   WORD   smb_tdrcnt;     /* value = total length of return data buffer  */
  3528.   WORD   smb_rsvd;       /* reserved */
  3529.   WORD   smb_prcnt;      /* parameter bytes returned in this buffer */
  3530.   WORD   smb_proff;      /* offset (from start of SMB hdr) to param bytes */
  3531.   WORD   smb_prdisp;     /* value = 0 byte displacement for param bytes */
  3532.   WORD   smb_drcnt;      /* data bytes returned in this buffer */
  3533.   WORD   smb_droff;      /* offset (from start of SMB hdr) to data bytes */
  3534.   WORD   smb_drdisp;     /* byte displacement for these data bytes */
  3535.   BYTE   smb_suwcnt;     /* value = 0 no set up return words */
  3536.   BYTE   smb_rsvd1;      /* reserved (pad above to word) */
  3537.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  3538.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  3539.   BYTE   smb_param[*];   /* The parmater block for the
  3540.                           * TRANSACT2_FINDNOTIFYFIRST function response is
  3541.                           * the find first specific return
  3542.                           * information in the following format. */
  3543.           WORD           findnfirst_handle;       /* Mointor handle */
  3544.           WORD           findnfirst_changecount;  /* Number of changes which
  3545.                                                    * occured within timeout */
  3546.           WORD           findnfirst_offerror;      /* error offset if EA error */
  3547.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  3548.   BYTE   smb_data[*];    /* return data bytes (* = value of smb_dscnt) */
  3549.                          /* The data block contains the level dependent
  3550.                           * information about the changes which occurred
  3551.                           */
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568. SMB Protocol Extensions    - 55 -          November 29, 1989
  3569.  
  3570.  
  3571. Subsequent Response Format :
  3572.  
  3573.   BYTE   smb_wct;       /* value = 10 */
  3574.   WORD   smb_tprcnt;    /* value = 6 */
  3575.   WORD   smb_tdrcnt;    /* value = total length of return data buffer  */
  3576.   WORD   smb_rsvd;      /* reserved */
  3577.   WORD   smb_prcnt;     /* value = 0 */
  3578.   WORD   smb_proff;     /* value = 0 */
  3579.   WORD   smb_prdisp;    /* value = 0 */
  3580.   WORD   smb_drcnt;     /* data bytes returned in this buffer */
  3581.   WORD   smb_droff;     /* offset (from start of SMB hdr) to data bytes */
  3582.   WORD   smb_drdisp;    /* byte displacement for these data bytes */
  3583.   BYTE   smb_suwcnt;    /* value = 0 no set up return words */
  3584.   BYTE   smb_rsvd1;     /* reserved (pad above to word) */
  3585.   WORD   smb_bcc;       /* total bytes (including pad bytes) following */
  3586.   BYTE   smb_pad1[];    /* (optional) to pad to word or dword boundary */
  3587.   BYTE   smb_data[*];   /* return data bytes (* = value of smb_dscnt) */
  3588.                         /* The data block contains the level dependent
  3589.                          * information about the changes which occurred
  3590.                          */
  3591.  
  3592.  
  3593.  
  3594.  
  3595.  
  3596.  
  3597.  
  3598.  
  3599.  
  3600.  
  3601.  
  3602.  
  3603.  
  3604.  
  3605.  
  3606.  
  3607.  
  3608.  
  3609.  
  3610.  
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634. SMB Protocol Extensions    - 56 -          November 29, 1989
  3635.  
  3636.  
  3637. _6._0._1._1._1_3.  _T_R_A_N_S_A_C_T_2__F_I_N_D_N_O_T_I_F_Y_N_E_X_T
  3638.  
  3639.  
  3640.  
  3641. The function code TRANSACT2_FINDNOTIFYNEXT  in  smb_setup[0]
  3642. in  the  primary  TRANSACT2  request identifies a request to
  3643. continue monitoring changes to a file or directory specified
  3644. by a TRANSACT_FINDNOTIFYFIRST request.
  3645.  
  3646.  
  3647. Primary Request Format:
  3648.  
  3649.  
  3650.   BYTE   smb_wct;        /* value = 15 */
  3651.   WORD   smb_tpscnt;     /* value = 4, total param bytes being sent */
  3652.   WORD   smb_tdscnt;     /* total number of data bytes being sent */
  3653.   WORD   smb_mprcnt;     /* value = maximum return parameter length */
  3654.   WORD   smb_mdrcnt;     /* value = maximum return data length */
  3655.   BYTE   smb_msrcnt;     /* value = 0. No setup words to return */
  3656.   BYTE   smb_rsvd;       /* reserved (pad above to word) */
  3657.   WORD   smb_flags;      /* additional information:
  3658.                              bit 0 - 0
  3659.                              bit 1 - 0 */
  3660.  DWORD   smb_timeout;    /* Duration of monitor period */
  3661.   WORD   smb_rsvd1;      /* reserved */
  3662.   WORD   smb_pscnt;      /* value = tpscnt, parms must be in primary request */
  3663.   WORD   smb_psoff;      /* offset (from start of SMB hdr to parameter bytes */
  3664.   WORD   smb_dscnt;      /* number of data bytes being sent this buffer */
  3665.   WORD   smb_dsoff;      /* offset (from start of SMB hdr) to data bytes */
  3666.   BYTE   smb_suwcnt;     /* value = 1 */
  3667.   BYTE   smb_rsvd2;      /* reserved (pad above to word) */
  3668.   WORD   smb_setup1;     /* value = 12  :- TRANSACT2_FINDNOTIFYNEXT */
  3669.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  3670.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  3671.   BYTE   smb_param[*];   /* The parmater block for the
  3672.                           * TRANSACT2_FINDNOTIFYNEXT function
  3673.                           * is the find next specific information
  3674.                           * in the following format. */
  3675.           WORD           findnnext_DirHandle;      /* Directory monitor handle */
  3676.           WORD           findnnext_ChangeCount;    /* Number of changes to wait for */
  3677.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  3678.   BYTE   smb_data[*];    /* Additional level dependent monitor
  3679.                           * information.
  3680.                           */
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.  
  3694. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700. SMB Protocol Extensions    - 57 -          November 29, 1989
  3701.  
  3702.  
  3703. Secondary Request Format (more data - may be zero or more of
  3704. these):
  3705.  
  3706.   BYTE   smb_wct;       /* value = 9 */
  3707.   WORD   smb_tpscnt;    /* value = 4 total parmeter bytes sent */
  3708.   WORD   smb_tdscnt;    /* total number of data bytes being sent */
  3709.   WORD   smb_pscnt;     /* value = 0. All params in primary request */
  3710.   WORD   smb_psoff;     /* value = 0. No parameters in secondary request. */
  3711.   WORD   smb_psdisp;    /* value = 0. No parameters in secondary request. */
  3712.   WORD   smb_dscnt;     /* number of data bytes being sent this buffer */
  3713.   WORD   smb_dsoff;     /* offset (from start of SMB hdr) to data bytes */
  3714.   WORD   smb_dsdisp;    /* byte displacement for these data bytes */
  3715.   WORD   smb_fid;       /* search handle */
  3716.   WORD   smb_bcc;       /* total bytes (including pad bytes) following */
  3717.   BYTE   smb_pad[];     /* (optional) to pad to word or dword boundary */
  3718.   BYTE   smb_data[*];   /* data bytes (* = value of smb_dscnt) */
  3719.  
  3720.  
  3721. First Response Format :
  3722.  
  3723.   BYTE   smb_wct;        /* value = 10 */
  3724.   WORD   smb_tprcnt;     /* value = 4 */
  3725.   WORD   smb_tdrcnt;     /* value = total length of return data buffer  */
  3726.   WORD   smb_rsvd;       /* reserved */
  3727.   WORD   smb_prcnt;      /* parameter bytes returned in this buffer */
  3728.   WORD   smb_proff;      /* offset (from start of SMB hdr) to param bytes */
  3729.   WORD   smb_prdisp;     /* value = 0 byte displacement for param bytes */
  3730.   WORD   smb_drcnt;      /* data bytes returned in this buffer */
  3731.   WORD   smb_droff;      /* offset (from start of SMB hdr) to data bytes */
  3732.   WORD   smb_drdisp;     /* byte displacement for these data bytes */
  3733.   BYTE   smb_suwcnt;     /* value = 0 no set up return words */
  3734.   BYTE   smb_rsvd1;      /* reserved (pad above to word) */
  3735.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  3736.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  3737.   BYTE   smb_param[*];   /* The parmater block for the
  3738.                           * TRANSACT2_FINDNOTIFYNEXT function
  3739.                           * response is the find notify next specific return
  3740.                           * information in the following format. */
  3741.          WORD            findnnext_changecount;  /* Number of changes which
  3742.                                                   * during the monitor period. */
  3743.          WORD            findnnext_offerror;
  3744.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  3745.   BYTE   smb_data[*];    /* return data bytes (* = value of smb_dscnt) */
  3746.                          /* The data block contains the level dependent
  3747.                           * information about the changes which occurred.
  3748.                           */
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.  
  3759.  
  3760. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766. SMB Protocol Extensions    - 58 -          November 29, 1989
  3767.  
  3768.  
  3769. Subsequent Response Format :
  3770.  
  3771.   BYTE   smb_wct;       /* value = 10 */
  3772.   WORD   smb_tprcnt;    /* value = 4 */
  3773.   WORD   smb_tdrcnt;    /* value = total length of return data buffer  */
  3774.   WORD   smb_rsvd;      /* reserved */
  3775.   WORD   smb_prcnt;     /* value = 0 */
  3776.   WORD   smb_proff;     /* value = 0 */
  3777.   WORD   smb_prdisp;    /* value = 0 */
  3778.   WORD   smb_drcnt;     /* data bytes returned in this buffer */
  3779.   WORD   smb_droff;     /* offset (from start of SMB hdr) to data bytes */
  3780.   WORD   smb_drdisp;    /* byte displacement for these data bytes */
  3781.   BYTE   smb_suwcnt;    /* value = 0 no set up return words */
  3782.   BYTE   smb_rsvd1;     /* reserved (pad above to word) */
  3783.   WORD   smb_bcc;       /* total bytes (including pad bytes) following */
  3784.   BYTE   smb_pad1[];    /* (optional) to pad to word or dword boundary */
  3785.   BYTE   smb_data[*];   /* return data bytes (* = value of smb_dscnt) */
  3786.                         /* The data block contains the level dependent
  3787.                          * information about the changes which occurred.
  3788.                          */
  3789.  
  3790.  
  3791.  
  3792.  
  3793.  
  3794.  
  3795.  
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832. SMB Protocol Extensions    - 59 -          November 29, 1989
  3833.  
  3834.  
  3835. _6._0._1._1._1_4.  _T_R_A_N_S_A_C_T_2__M_K_D_I_R
  3836.  
  3837. The function code TRANSACT2_MKDIR  in  smb_setup[0]  in  the
  3838. primary  TRANSACT2 requests identifies a request to create a
  3839. directory with extended attributes.
  3840.  
  3841. Primary Request Format:
  3842.  
  3843.  
  3844.   BYTE   smb_wct;        /* value = 15 */
  3845.   WORD   smb_tpscnt;     /* value = total number of param bytes being sent */
  3846.   WORD   smb_tdscnt;     /* total number of data bytes being sent */
  3847.   WORD   smb_mprcnt;     /* value = maximum return parameter length */
  3848.   WORD   smb_mdrcnt;     /* value = 0. No data returned */
  3849.   BYTE   smb_msrcnt;     /* value = 0. No setup words to return */
  3850.   BYTE   smb_rsvd;       /* reserved (pad above to word) */
  3851.   WORD   smb_flags;      /* additional information:
  3852.                           *    bit 0 - 0
  3853.                           *    bit 1 - 0 */
  3854.  DWORD   smb_timeout;    /* value = 0. Not used for mkdir */
  3855.   WORD   smb_rsvd1;      /* reserved */
  3856.   WORD   smb_pscnt;      /* value = tpscnt, parms must be in primary request */
  3857.   WORD   smb_psoff;      /* offset (from start of SMB Hdr to parameter bytes */
  3858.   WORD   smb_dscnt;      /* number of data bytes being sent this buffer */
  3859.   WORD   smb_dsoff;      /* offset (from start of SMB hdr) to data bytes */
  3860.   BYTE   smb_suwcnt;     /* value = 1 */
  3861.   BYTE   smb_rsvd2;      /* reserved (pad above to word) */
  3862.   WORD   smb_setup1;     /* value = 13  :- TRANSACT2_MKDIR */
  3863.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  3864.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  3865.   BYTE   smb_param[*];   /* The parmater block for the
  3866.                           * TRANSACT2_MKDIR function is
  3867.                           * the mkdir specific information
  3868.                           * in the following format. */
  3869.          DWORD             mkdir_rsvd;       /* Reserved. Must be zero. */
  3870.          BYTE              mkdir_dirname[];  /* Directory name */
  3871.   BYTE   smb_pad1[];     /* (optional) to pad to word or dword boundary */
  3872.   BYTE   smb_data[*];    /* FEAList structure for the directory
  3873.                           * to be created */
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898. SMB Protocol Extensions    - 60 -          November 29, 1989
  3899.  
  3900.  
  3901. Secondary Request Format (more data - may be zero or more of
  3902. these):
  3903.  
  3904.   BYTE   smb_wct;       /* value = 9 */
  3905.   WORD   smb_tpscnt;    /* totalnumber of parameter bytes being sent */
  3906.   WORD   smb_tdscnt;    /* total number of data bytes being sent */
  3907.   WORD   smb_pscnt;     /* value = 0. All params in primary request */
  3908.   WORD   smb_psoff;     /* value = 0. No parameters in secondary request. */
  3909.   WORD   smb_psdisp;    /* value = 0. No parameters in secondary request. */
  3910.   WORD   smb_dscnt;     /* number of data bytes being sent this buffer */
  3911.   WORD   smb_dsoff;     /* offset (from start of SMB hdr) to data bytes */
  3912.   WORD   smb_dsdisp;    /* byte displacement for these data bytes */
  3913.   WORD   smb_fid;       /* value = 0xffff, no handle on request */
  3914.   WORD   smb_bcc;       /* total bytes (including pad bytes) following */
  3915.   BYTE   smb_pad[];     /* (optional) to pad to word or dword boundary */
  3916.   BYTE   smb_data[*];   /* data bytes (* = value of smb_dscnt) */
  3917.  
  3918.  
  3919. Response Format (one only):
  3920.  
  3921.   BYTE   smb_wct;        /* value = 10 */
  3922.   WORD   smb_tprcnt;     /* value = 2 */
  3923.   WORD   smb_tdrcnt;     /* value = 0 no data bytes  */
  3924.   WORD   smb_rsvd;       /* reserved */
  3925.   WORD   smb_prcnt;      /* value = 2, parameter bytes being returned */
  3926.   WORD   smb_proff;      /* offset (from start of SMB hdr) to param bytes */
  3927.   WORD   smb_prdisp;     /* value = 0 byte displacement for param bytes */
  3928.   WORD   smb_drcnt;      /* value = 0 no data bytes */
  3929.   WORD   smb_droff;      /* value = 0 no data bytes */
  3930.   WORD   smb_drdisp;     /* value = 0 no data bytes */
  3931.   BYTE   smb_suwcnt;     /* value = 0 no set up return words */
  3932.   BYTE   smb_rsvd1;      /* reserved (pad above to word) */
  3933.   WORD   smb_bcc;        /* total bytes (including pad bytes) following */
  3934.   BYTE   smb_pad[];      /* (optional) to pad to word or dword boundary */
  3935.   BYTE   smb_param[*];   /* The parmater block for the
  3936.                           * TRANSACT2_MKDIR function response
  3937.                           * is the mkdir specific return
  3938.                           * information in the following format. */
  3939.          WORD              mkdir_offerror;     /* offset into FEAList data of first
  3940.                                                 * error which occured while setting
  3941.                                                 * the extended attributes. */
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964. SMB Protocol Extensions    - 61 -          November 29, 1989
  3965.  
  3966.  
  3967. _6._0._2.  _F_I_N_D _N_O_T_I_F_Y _C_L_O_S_E
  3968.  
  3969. Request Format:
  3970.  
  3971.   BYTE   smb_wct;      /* value = 1 */
  3972.   WORD   smb_handle;   /* Find notify handle */
  3973.   WORD   smb_bcc;      /* value = 0 */
  3974.  
  3975.  
  3976.  
  3977.  
  3978. Response Format:
  3979.  
  3980.   BYTE   smb_wct;   /* value = 0 */
  3981.   WORD   smb_bcc;   /* value = 0 */
  3982.  
  3983.  
  3984.  
  3985.  
  3986. Service:
  3987.  
  3988. The  Find  Notify  Close  protocol  closes  the  association
  3989. between  a  directory  handle  returned following a resourse
  3990. monitor  established   using   a   TRANSACT2_FINDNOTIFYFIRST
  3991. request  to  the  server  and the resulting system directory
  3992. monitor.  This  request  allows  the  server  to  free   any
  3993. resources held in support of the open handle.
  3994.  
  3995. The Find Close protocol is used to match the  DosFindNotify-
  3996. Close OS/2 system call.
  3997.  
  3998.  
  3999.  
  4000. Find Notify Close may generate the following errors.
  4001.  
  4002.         Error Class ERRDOS
  4003.  
  4004.           ERRbadfid
  4005.           <implementation specific>
  4006.  
  4007.  
  4008.         Error Class ERRSRV
  4009.  
  4010.           ERRerror
  4011.           ERRinvnid
  4012.           <implementation specific>
  4013.  
  4014.  
  4015.         Error Class ERRHRD
  4016.  
  4017.           <implementation specific>
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.  
  4024. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030. SMB Protocol Extensions    - 62 -          November 29, 1989
  4031.  
  4032.  
  4033. _6._0._3.  _F_I_N_D _C_L_O_S_E
  4034.  
  4035. Request Format:
  4036.  
  4037.   BYTE   smb_wct;                        /* value = 1 */
  4038.   WORD   smb_handle; /* Find handle */
  4039.   WORD   smb_bcc;                        /* value = 0 */
  4040.  
  4041.  
  4042.  
  4043.  
  4044. Response Format:
  4045.  
  4046.   BYTE   smb_wct;   /* value = 0 */
  4047.   WORD   smb_bcc;   /* value = 0 */
  4048.  
  4049.  
  4050.  
  4051.  
  4052. Service:
  4053.  
  4054. The Find Close protocol closes  the  association  between  a
  4055. search  handle  returned  following  a successful FIND FIRST
  4056. request sent to the server using the TRANSACT2 protocol  and
  4057. the  resulting  system  file search. This request allows the
  4058. server to free any resources held in  support  of  the  open
  4059. handle.
  4060.  
  4061. The Find Close protocol is used to match  the  DosFindFirst2
  4062. OS/2 system call.
  4063.  
  4064.  
  4065.  
  4066. Find Close may generate the following errors.
  4067.  
  4068.         Error Class ERRDOS
  4069.  
  4070.           ERRbadfid
  4071.           <implementation specific>
  4072.  
  4073.  
  4074.         Error Class ERRSRV
  4075.  
  4076.           ERRerror
  4077.           ERRinvnid
  4078.           <implementation specific>
  4079.  
  4080.  
  4081.         Error Class ERRHRD
  4082.  
  4083.           <implementation specific>
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096. SMB Protocol Extensions    - 63 -          November 29, 1989
  4097.  
  4098.  
  4099. _6._0._4.  _U_S_E_R _L_O_G_O_F_F _a_n_d _X
  4100.  
  4101. Request Format:
  4102.  
  4103.   BYTE   smb_wct;     /* value = 2 */
  4104.   BYTE   smb_com2;    /* secondary (X) command, 0xFF = none */
  4105.   BYTE   smb_reh2;    /* reserved (must be zero) */
  4106.   WORD   smb_off2;    /* offset (from SMB hdr start) to next cmd (@smb_wct) */
  4107.   WORD   smb_bcc;     /* value = 0 */
  4108.  
  4109.  
  4110.  
  4111. Response Format:
  4112.  
  4113.   BYTE   smb_wct;     /* value = 2 */
  4114.   BYTE   smb_com2;    /* secondary (X) command, 0xFF = none */
  4115.   BYTE   smb_res2;    /* reserved (pad to word) */
  4116.   WORD   smb_off2;    /* offset (from SMB hdr start) to next cmd (@smb_wct) */
  4117.   WORD   smb_bcc;     /* value = 0 */
  4118.  
  4119.  
  4120.  
  4121. Service definition:
  4122.  
  4123. This protocol is used to "Log Off" the  user (identified  by
  4124. the  UID  value  in  smb_uid) previously "Logged On" via the
  4125. Session Set Up protocol.
  4126.  
  4127. The server will remove this UID from its list of valid  UIDs
  4128. for  this  session.  Any subsequent protocol containing this
  4129. UID (in smb_uid) received (on this session) will be returned
  4130. with an access error.
  4131.  
  4132. Another Session Set Up ("User Logon") must be sent in  order
  4133. to reenstate the user on the session.
  4134.  
  4135. Session Termination also causes the UIDs registered  on  the
  4136. session  to  be  invalidated.  When  the  session is reesta-
  4137. blished, Session Setup request(s)  must  again  be  used  to
  4138. validate each user.
  4139.  
  4140. The following are the only valid protocol  request  commands
  4141. for smb_com2 (X) for User Logoff and X:
  4142.  
  4143.  
  4144.           SESSION SET UP and X
  4145.  
  4146.  
  4147. User Logoff may generate the following errors.
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.  
  4155.  
  4156. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162. SMB Protocol Extensions    - 64 -          November 29, 1989
  4163.  
  4164.  
  4165.  
  4166.           Error Class ERRDOS
  4167.  
  4168.           <implementation specific>
  4169.  
  4170.           Error Class ERRSRV
  4171.  
  4172.           <implementation specific>
  4173.  
  4174.           Error Class ERRHRD
  4175.  
  4176.           <implementation specific>
  4177.  
  4178.  
  4179.  
  4180.  
  4181.  
  4182.  
  4183.  
  4184.  
  4185.  
  4186.  
  4187.  
  4188.  
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.  
  4195.  
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228. SMB Protocol Extensions    - 65 -          November 29, 1989
  4229.  
  4230.  
  4231. _7.  _D_A_T_A _D_E_F_I_N_I_T_I_O_N_S
  4232.  
  4233. _7._1.  _C_O_M_M_A_N_D _C_O_D_E_S
  4234.  
  4235. The command codes are unchanged for commands that are common
  4236. with the Core File Sharing Protocol.
  4237.  
  4238. The following values have been assigned for the "core"  pro-
  4239. tocol commands.
  4240.  
  4241. #define SMBmkdir      0x00   /* create directory */
  4242. #define SMBrmdir      0x01   /* delete directory */
  4243. #define SMBopen       0x02   /* open file */
  4244. #define SMBcreate     0x03   /* create file */
  4245. #define SMBclose      0x04   /* close file */
  4246. #define SMBflush      0x05   /* flush file */
  4247. #define SMBunlink     0x06   /* delete file */
  4248. #define SMBmv         0x07   /* rename file */
  4249. #define SMBgetatr     0x08   /* get file attributes */
  4250. #define SMBsetatr     0x09   /* set file attributes */
  4251. #define SMBread       0x0A   /* read from file */
  4252. #define SMBwrite      0x0B   /* write to file */
  4253. #define SMBlock       0x0C   /* lock byte range */
  4254. #define SMBunlock     0x0D   /* unlock byte range */
  4255. #define SMBctemp      0x0E   /* create temporary file */
  4256. #define SMBmknew      0x0F   /* make new file */
  4257. #define SMBchkpth     0x10   /* check directory path */
  4258. #define SMBexit       0x11   /* process exit */
  4259. #define SMBlseek      0x12   /* seek */
  4260. #define SMBtcon       0x70   /* tree connect */
  4261. #define SMBtdis       0x71   /* tree disconnect */
  4262. #define SMBnegprot    0x72   /* negotiate protocol */
  4263. #define SMBdskattr    0x80   /* get disk attributes */
  4264. #define SMBsearch     0x81   /* search directory */
  4265. #define SMBsplopen    0xC0   /* open print spool file */
  4266. #define SMBsplwr      0xC1   /* write to print spool file */
  4267. #define SMBsplclose   0xC2   /* close print spool file */
  4268. #define SMBsplretq    0xC3   /* return print queue */
  4269. #define SMBsends      0xD0   /* send single block message */
  4270. #define SMBsendb      0xD1   /* send broadcast message */
  4271. #define SMBfwdname    0xD2   /* forward user name */
  4272. #define SMBcancelf    0xD3   /* cancel forward */
  4273. #define SMBgetmac     0xD4   /* get machine name */
  4274. #define SMBsendstrt   0xD5   /* send start of multi-block message */
  4275. #define SMBsendend    0xD6   /* send end of multi-block message */
  4276. #define SMBsendtxt    0xD7   /* send text of multi-block message */
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294. SMB Protocol Extensions    - 66 -          November 29, 1989
  4295.  
  4296.  
  4297. The commands added by the LANMAN 1.0 Extended  File  Sharing
  4298. Protocol have the following command codes:
  4299.  
  4300. #define SMBlockread      0x13   /* lock then read data */
  4301. #define SMBwriteunlock   0x14   /* write then unlock data */
  4302. #define SMBreadBraw      0x1A   /* read block raw */
  4303. #define SMBreadBmpx      0x1B   /* read block multiplexed */
  4304. #define SMBreadBs        0x1C   /* read block (secondary response) */
  4305. #define SMBwriteBraw     0x1D   /* write block raw */
  4306. #define SMBwriteBmpx     0x1E   /* write block multiplexed */
  4307. #define SMBwriteBs       0x1F   /* write block (secondary request) */
  4308. #define SMBwriteC        0x20   /* write complete response */
  4309. #define SMBsetattrE      0x22   /* set file attributes expanded */
  4310. #define SMBgetattrE      0x23   /* get file attributes expanded */
  4311. #define SMBlockingX      0x24   /* lock/unlock byte ranges and X */
  4312. #define SMBtrans         0x25   /* transaction - name, bytes in/out */
  4313. #define SMBtranss        0x26   /* transaction (secondary request/response) */
  4314. #define SMBioctl         0x27   /* IOCTL */
  4315. #define SMBioctls        0x28   /* IOCTL  (secondary request/response) */
  4316. #define SMBcopy          0x29   /* copy */
  4317. #define SMBmove          0x2A   /* move */
  4318. #define SMBecho          0x2B   /* echo */
  4319. #define SMBwriteclose    0x2C   /* Write and Close */
  4320. #define SMBopenX         0x2D   /* open and X */
  4321. #define SMBreadX         0x2E   /* read and X */
  4322. #define SMBwriteX        0x2F   /* write and X */
  4323. #define SMBsesssetup     0x73   /* Session Set Up & X (including User Logon) */
  4324. #define SMBtconX         0x75   /* tree connect and X */
  4325. #define SMBffirst        0x82   /* find first */
  4326. #define SMBfunique       0x83   /* find unique */
  4327. #define SMBfclose        0x84   /* find close */
  4328. #define SMBinvalid       0xFE   /* invalid command */
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360. SMB Protocol Extensions    - 67 -          November 29, 1989
  4361.  
  4362.  
  4363. The commands added by the LANMAN 1.2 Extended  File  Sharing
  4364. Protocol have the following command codes:
  4365.  
  4366. #define SMBtrans2       0x32   /* transaction2 - function, byte in/out */
  4367. #define SMBtranss2      0x33   /* transaction2 (secondary request/response*/
  4368. #define SMBfindclose    0x34   /* find close */
  4369. #define SMBfindnclose   0x35   /* find notify close */
  4370. #define SMBuloggoffX    0x74   /* User logoff and X */
  4371.  
  4372.  
  4373.  
  4374.  
  4375.  
  4376.  
  4377.  
  4378.  
  4379.  
  4380.  
  4381.  
  4382.  
  4383.  
  4384.  
  4385.  
  4386.  
  4387.  
  4388.  
  4389.  
  4390.  
  4391.  
  4392.  
  4393.  
  4394.  
  4395.  
  4396.  
  4397.  
  4398.  
  4399.  
  4400.  
  4401.  
  4402.  
  4403.  
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.  
  4414.  
  4415.  
  4416.  
  4417.  
  4418.  
  4419.  
  4420. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426. SMB Protocol Extensions    - 68 -          November 29, 1989
  4427.  
  4428.  
  4429. _7._2.  _E_R_R_O_R _C_L_A_S_S_E_S _A_N_D _C_O_D_E_S
  4430.  
  4431. The error class and code lists in the  section  include  all
  4432. classes  and codes generated by the Core File Sharing Proto-
  4433. col. Errors listed here are  intended  to  provide  a  finer
  4434. granularity  of  error conditions.  These lists are not com-
  4435. plete.
  4436.  
  4437. The following error classes may be returned by the  protocol
  4438. elements defined in this document.
  4439.  
  4440. SUCCESS      0   The request was successful.
  4441. ERRDOS    0x01   Error is from the core DOS operating system set.
  4442. ERRSRV    0x02   Error is generated by the server network file manager.
  4443. ERRHRD    0x03   Error is an hardware error.
  4444. ERRXOS    0x04   Reserved for XENIX.
  4445. ERRRMX1   0xE1   Reserved for iRMX
  4446. ERRRMX2   0xE2   Reserved for iRMX
  4447. ERRRMX3   0xE3   Reserved for iRMX
  4448. ERRCMD    0xFF   Command was not in the "SMB" format.
  4449.  
  4450.  
  4451. The following error codes may be generated with the  SUCCESS
  4452. error class.
  4453.  
  4454. SUCCESS   0   The request was successful.
  4455.  
  4456.  
  4457. The following error codes may be generated with  the  ERRDOS
  4458. error  class.   The XENIX errors equivalent to each of these
  4459. errors are noted at the end of the error description.   NOTE
  4460. -  When  the  extended  protocol (LANMAN 1.0) has been nego-
  4461. tiated, all of the error codes below may be  generated  plus
  4462. any  of  the  new  error  codes  defined  for OS/2 (see OS/2
  4463. operating system documentation for  complete  list  of  OS/2
  4464. error  codes).   When  only  "core"  protocol has been nego-
  4465. tiated, the server must map additional OS/2 (or  OS/2  like)
  4466. errors to the errors listed below.
  4467.  
  4468.  
  4469.  
  4470.  
  4471.  
  4472.  
  4473.  
  4474.  
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.  
  4481.  
  4482.  
  4483.  
  4484.  
  4485.  
  4486. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492. SMB Protocol Extensions    - 69 -          November 29, 1989
  4493.  
  4494.  
  4495. The following error codes may be generated with  the  ERRDOS
  4496. error class.
  4497.  
  4498. ERRbadfunc          1
  4499.                         Invalid function.  The server OS did not recognize or could not  perform
  4500.                         a system call generated by the server, e.g., set the DIRECTORY attribute
  4501.                         on a data file, invalid seek mode. [EINVAL]
  4502. ERRbadfile          2
  4503.                         File not found.  The last component of a file's pathname  could  not  be
  4504.                         found.
  4505. ERRbadpath          3
  4506.                         Directory invalid.  A directory component in a  pathname  could  not  be
  4507.                         found.  [ENOENT]
  4508. ERRnofids           4
  4509.                         Too many open files.  The server has no file handles  (FIDs)  available.
  4510.                         [EMFILE]
  4511. ERRnoaccess         5
  4512.                         Access denied, the requester's context does  not  permit  the  requested
  4513.                         function.  This includes the following conditions.  [EPERM]
  4514.                             invalid rename command
  4515.                             write to fid open for read only
  4516.                             read on fid open for write only
  4517.                             Attempt to delete a non-empty directory
  4518. ERRbadfid           6
  4519.                         Invalid file handle.  The file handle specified was  not  recognized  by
  4520.                         the server.  [EBADF]
  4521. ERRbadmcb           7   Memory control blocks destroyed.  [EREMOTEIO]
  4522. ERRnomem            8   Insufficient server memory to perform the requested function.  [ENOMEM]
  4523. ERRbadmem           9   Invalid memory block address.  [EFAULT]
  4524. ERRbadenv          10   Invalid environment.  [EREMOTEIO]
  4525. ERRbadformat       11   Invalid format.  [EREMOTEIO]
  4526. ERRbadaccess       12   Invalid open mode.
  4527. ERRbaddata         13   Invalid data (generated only by IOCTL calls within the server).  [E2BIG]
  4528. ERR                14   reserved
  4529. ERRbaddrive        15   Invalid drive specified.  [ENXIO]
  4530. ERRremcd           16
  4531.                         A Delete Directory request attempted  to  remove  the  server's  current
  4532.                         directory.  [EREMOTEIO]
  4533. ERRdiffdevice      17   Not same device (e.g., a cross volume rename was attempted)  [EXDEV]
  4534. ERRnofiles         18
  4535.                         A File Search command can find no more files matching the specified cri-
  4536.                         teria.
  4537. ERRbadshare        32
  4538.                         The sharing mode specified for an Open conflicts with existing  FIDs  on
  4539.                         the file.  [ETXTBSY]
  4540. ERRlock            33
  4541.                         A Lock request conflicted with an existing lock or specified an  invalid
  4542.                         mode,  or an Unlock requested attempted to remove a lock held by another
  4543.                         process.  [EDEADLOCK]
  4544. ERRfilexists       80
  4545.                         The file named in a Create Directory, Make  New  File  or  Link  request
  4546.                         already exists. The error may also be generated in the Create and Rename
  4547.                         transaction.  [EEXIST]
  4548.  
  4549. ERRbadpipe        230   Pipe invalid.
  4550. ERRpipebusy       231   All instances of the requested pipe are busy.
  4551. ERRpipeclosing    232   Pipe close in progress.
  4552. ERRnotconnected   233   No process on other end of pipe.
  4553. ERRmoredata       234   There is more data to be returned.
  4554.  
  4555.  
  4556.  
  4557.  
  4558.  
  4559.  
  4560.  
  4561.  
  4562. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  4563.  
  4564.  
  4565.  
  4566.  
  4567.  
  4568. SMB Protocol Extensions    - 70 -          November 29, 1989
  4569.  
  4570.  
  4571. The following error codes may be generated with  the  ERRSRV
  4572. error class.
  4573.  
  4574. ERRerror              1   Non-specific error code.  It is returned under the following conditions:
  4575.                               resource other than disk space exhausted (e.g. TIDs)
  4576.                               first command on VC was not negotiate
  4577.                               multiple negotiates attempted
  4578.                               internal server error [ENFILE]
  4579. ERRbadpw              2
  4580.                           Bad password - name/password pair in a Tree Connect or Session Setup are
  4581.                           invalid.
  4582. ERRbadtype            3   reserved
  4583. ERRaccess             4
  4584.                           The requester does not have  the  necessary  access  rights  within  the
  4585.                           specified  context for the requested function. The context is defined by
  4586.                           the TID or the UID.  [EACCES]
  4587. ERRinvnid             5   The tree ID (TID) specified in a command was invalid.
  4588. ERRinvnetname         6   Invalid network name in tree connect.
  4589. ERRinvdevice          7
  4590.                           Invalid device - printer request made to non-printer connection or  non-
  4591.                           printer request made to printer connection.
  4592. ERRqfull             49   Print queue full (files) -- returned by open print file.
  4593. ERRqtoobig           50   Print queue full -- no space.
  4594. ERRqeof              51   EOF on print queue dump.
  4595. ERRinvpfid           52   Invalid print file FID.
  4596. ERRsmbcmd            64   The server did not recognize the command received.
  4597. ERRsrverror          65
  4598.                           The server encountered an internal error, e.g., system file unavailable.
  4599. ERRfilespecs         67
  4600.                           The file handle (FID) and pathname parameters contained an invalid  com-
  4601.                           bination of values.
  4602. ERRreserved          68   reserved.
  4603. ERRbadpermits        69
  4604.                           The access permissions specified for a file or directory are not a valid
  4605.                           combination.  The server cannot set the requested attribute.
  4606. ERRreserved          70   reserved.
  4607. ERRsetattrmode       71   The attribute mode in the Set File Attribute request is invalid.
  4608. ERRpaused            81   Server is paused. (reserved for messaging)
  4609. ERRmsgoff            82   Not receiving messages. (reserved for messaging).
  4610. ERRnoroom            83   No room to buffer message. (reserved for messaging).
  4611. ERRrmuns             87   Too many remote user names. (reserved for messaging).
  4612. ERRtimeout           88   Operation timed out.
  4613. ERRnoresource        89   No resources currently available for request.
  4614. ERRtoomanyuids       90   Too many UIDs active on this session.
  4615. ERRbaduid            91   The UID is not known as a valid ID on this session.
  4616.  
  4617. ERRusempx           250   Temp unable to support Raw, use MPX mode.
  4618. ERRusestd           251   Temp unable to support Raw, use standard read/write.
  4619. ERRcontmpx          252   (reserved) continue in MPX mode.
  4620. ERRreserved         253   reserved.
  4621. ERRreserved         254   reserved.
  4622.  
  4623. ERRnosupport     0xFFFF   Function not supported.
  4624.  
  4625.  
  4626.  
  4627.  
  4628.  
  4629.  
  4630.  
  4631.  
  4632.  
  4633. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  4634.  
  4635.  
  4636.  
  4637.  
  4638.  
  4639. SMB Protocol Extensions    - 71 -          November 29, 1989
  4640.  
  4641.  
  4642. The following error codes may be generated with  the  ERRHRD
  4643. error  class.   The XENIX errors equivalent to each of these
  4644. errors are noted at the end of the error description.
  4645.  
  4646. ERRnowrite       19   Attempt to write on write-protected diskette.  [EROFS]
  4647. ERRbadunit       20   Unknown unit.  [ENODEV]
  4648. ERRnotready      21   Drive not ready.  [EUCLEAN]
  4649. ERRbadcmd        22   Unknown command.
  4650. ERRdata          23   Data error (CRC).  [EIO]
  4651. ERRbadreq        24   Bad request structure length.  [ERANGE]
  4652. ERRseek          25   Seek error.
  4653. ERRbadmedia      26   Unknown media type.
  4654. ERRbadsector     27   Sector not found.
  4655. ERRnopaper       28   Printer out of paper.
  4656. ERRwrite         29   Write fault.
  4657. ERRread          30   Read fault.
  4658. ERRgeneral       31   General failure.
  4659. ERRbadshare      32   A open conflicts with an existing open. [ETXTBSY]
  4660. ERRlock          33
  4661.                       A Lock request conflicted with  an  existing  lock  or
  4662.                       specified  an  invalid  mode,  or  an Unlock requested
  4663.                       attempted to remove a lock held  by  another  process.
  4664.                       [EDEADLOCK]
  4665. ERRwrongdisk     34
  4666.                       The wrong disk was found in a drive.
  4667. ERRFCBUnavail    35
  4668.                       No FCBs are available to process request.
  4669. ERRsharebufexc   36
  4670.                       A sharing buffer has been exceeded.
  4671.  
  4672.  
  4673.  
  4674.  
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.  
  4694.  
  4695.  
  4696.  
  4697.  
  4698.  
  4699.  
  4700.  
  4701.  
  4702.  
  4703. Copyright Microsoft Corporation, 1987, 1988, 1989Microsoft Networks
  4704.  
  4705.  
  4706.