s3-rpc_server: run minimal_includes.pl.
[samba.git] / source3 / libsmb / clioplock.c
index e3fb66aba09c415bc8856424271aca26fcb9fecc..aed489f6f382b6c686551e1ebb1bca30d8353bbf 100644 (file)
@@ -18,6 +18,8 @@
 */
 
 #include "includes.h"
+#include "../lib/util/tevent_ntstatus.h"
+#include "async_smb.h"
 
 /****************************************************************************
 send an ack for an oplock break request
@@ -37,7 +39,7 @@ struct tevent_req *cli_oplock_ack_send(TALLOC_CTX *mem_ctx,
        struct tevent_req *req, *subreq;
        struct cli_oplock_ack_state *state;
 
-       req = tevent_req_create(mem_ctx, &state, struct cli_oplock_ack_state);;
+       req = tevent_req_create(mem_ctx, &state, struct cli_oplock_ack_state);
        if (req == NULL) {
                return NULL;
        }
@@ -66,7 +68,7 @@ static void cli_oplock_ack_done(struct tevent_req *subreq)
                subreq, struct tevent_req);
        NTSTATUS status;
 
-       status = cli_smb_recv(subreq, 0, NULL, NULL, NULL, NULL);
+       status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL);
        TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
                tevent_req_nterror(req, status);
@@ -80,7 +82,7 @@ NTSTATUS cli_oplock_ack_recv(struct tevent_req *req)
        return tevent_req_simple_recv_ntstatus(req);
 }
 
-bool cli_oplock_ack(struct cli_state *cli, int fnum, unsigned char level)
+NTSTATUS cli_oplock_ack(struct cli_state *cli, uint16_t fnum, unsigned char level)
 {
        TALLOC_CTX *frame = talloc_stackframe();
        struct event_context *ev;
@@ -118,14 +120,15 @@ bool cli_oplock_ack(struct cli_state *cli, int fnum, unsigned char level)
        if (!NT_STATUS_IS_OK(status)) {
                cli_set_error(cli, status);
        }
-       return NT_STATUS_IS_OK(status);
+       return status;
 }
 
 /****************************************************************************
 set the oplock handler for a connection
 ****************************************************************************/
+
 void cli_oplock_handler(struct cli_state *cli, 
-                       bool (*handler)(struct cli_state *, int, unsigned char))
+                       NTSTATUS (*handler)(struct cli_state *, uint16_t, unsigned char))
 {
        cli->oplock_handler = handler;
 }