s3: Convert cli_raw_ioctl to use cli_smb()
authorVolker Lendecke <vl@samba.org>
Sun, 7 Feb 2010 12:36:49 +0000 (13:36 +0100)
committerVolker Lendecke <vl@samba.org>
Sat, 20 Feb 2010 17:59:29 +0000 (18:59 +0100)
source3/libsmb/clifile.c

index fb4857a1a516af8cd219b383a8a11e7f2ec7f737..6c4ae1ad49e7aa871056795be64a609c9e2ee5ef 100644 (file)
@@ -4153,28 +4153,20 @@ NTSTATUS cli_ctemp(struct cli_state *cli,
 */
 NTSTATUS cli_raw_ioctl(struct cli_state *cli, uint16_t fnum, uint32_t code, DATA_BLOB *blob)
 {
-       memset(cli->outbuf,'\0',smb_size);
-       memset(cli->inbuf,'\0',smb_size);
-
-       cli_set_message(cli->outbuf, 3, 0, True);
-       SCVAL(cli->outbuf,smb_com,SMBioctl);
-       cli_setup_packet(cli);
-
-       SSVAL(cli->outbuf, smb_vwv0, fnum);
-       SSVAL(cli->outbuf, smb_vwv1, code>>16);
-       SSVAL(cli->outbuf, smb_vwv2, (code&0xFFFF));
+       uint16_t vwv[3];
+       NTSTATUS status;
+       struct tevent_req *result_parent;
 
-       cli_send_smb(cli);
-       if (!cli_receive_smb(cli)) {
-               return NT_STATUS_UNEXPECTED_NETWORK_ERROR;
-       }
+       SSVAL(vwv+0, 0, fnum);
+       SSVAL(vwv+1, 0, code>>16);
+       SSVAL(vwv+2, 0, (code&0xFFFF));
 
-       if (cli_is_error(cli)) {
-               return cli_nt_error(cli);
+       status = cli_smb(talloc_tos(), cli, SMBioctl, 0, 3, vwv, 0, NULL,
+                        &result_parent, 0, NULL, NULL, NULL, NULL);
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
        }
-
        *blob = data_blob_null;
-
        return NT_STATUS_OK;
 }