Print this page
Build provider 3rd arg from smb_request_t
hacking...


 195                 if (NameLength == 0) {
 196                         op->fqi.fq_path.pn_path = "\\";
 197                 } else if (NameLength >= SMB_MAXPATHLEN) {
 198                         smbsr_error(sr, NT_STATUS_OBJECT_NAME_INVALID,
 199                             ERRDOS, ERROR_PATH_NOT_FOUND);
 200                         rc = -1;
 201                 } else {
 202                         rc = smbsr_decode_data(sr, "%#u", sr, NameLength,
 203                             &op->fqi.fq_path.pn_path);
 204                 }
 205         }
 206 
 207         op->op_oplock_level = SMB_OPLOCK_NONE;
 208         if (op->nt_flags & NT_CREATE_FLAG_REQUEST_OPLOCK) {
 209                 if (op->nt_flags & NT_CREATE_FLAG_REQUEST_OPBATCH)
 210                         op->op_oplock_level = SMB_OPLOCK_BATCH;
 211                 else
 212                         op->op_oplock_level = SMB_OPLOCK_EXCLUSIVE;
 213         }
 214 
 215         DTRACE_SMB_2(op__NtCreateX__start, smb_request_t *, sr,
 216             struct open_param *, op);
 217 
 218         return ((rc == 0) ? SDRC_SUCCESS : SDRC_ERROR);
 219 }
 220 
 221 void
 222 smb_post_nt_create_andx(smb_request_t *sr)
 223 {
 224         DTRACE_SMB_1(op__NtCreateX__done, smb_request_t *, sr);
 225 
 226         if (sr->arg.open.dir != NULL) {
 227                 smb_ofile_release(sr->arg.open.dir);
 228                 sr->arg.open.dir = NULL;
 229         }
 230 }
 231 
 232 /*
 233  * A lot like smb_nt_transact_create
 234  */
 235 smb_sdrc_t
 236 smb_com_nt_create_andx(struct smb_request *sr)




 195                 if (NameLength == 0) {
 196                         op->fqi.fq_path.pn_path = "\\";
 197                 } else if (NameLength >= SMB_MAXPATHLEN) {
 198                         smbsr_error(sr, NT_STATUS_OBJECT_NAME_INVALID,
 199                             ERRDOS, ERROR_PATH_NOT_FOUND);
 200                         rc = -1;
 201                 } else {
 202                         rc = smbsr_decode_data(sr, "%#u", sr, NameLength,
 203                             &op->fqi.fq_path.pn_path);
 204                 }
 205         }
 206 
 207         op->op_oplock_level = SMB_OPLOCK_NONE;
 208         if (op->nt_flags & NT_CREATE_FLAG_REQUEST_OPLOCK) {
 209                 if (op->nt_flags & NT_CREATE_FLAG_REQUEST_OPBATCH)
 210                         op->op_oplock_level = SMB_OPLOCK_BATCH;
 211                 else
 212                         op->op_oplock_level = SMB_OPLOCK_EXCLUSIVE;
 213         }
 214 
 215         DTRACE_SMB_1(op__NtCreateX__start, smb_request_t *, sr); /* arg.open */

 216 
 217         return ((rc == 0) ? SDRC_SUCCESS : SDRC_ERROR);
 218 }
 219 
 220 void
 221 smb_post_nt_create_andx(smb_request_t *sr)
 222 {
 223         DTRACE_SMB_1(op__NtCreateX__done, smb_request_t *, sr);
 224 
 225         if (sr->arg.open.dir != NULL) {
 226                 smb_ofile_release(sr->arg.open.dir);
 227                 sr->arg.open.dir = NULL;
 228         }
 229 }
 230 
 231 /*
 232  * A lot like smb_nt_transact_create
 233  */
 234 smb_sdrc_t
 235 smb_com_nt_create_andx(struct smb_request *sr)