summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-03-22 12:17:14 +0100
committerVolker Lendecke <vl@samba.org>2012-03-22 12:18:35 +0100
commit9091aec724545b0a301f863e4f19f756fb7f7f49 (patch)
tree090140781cea6f4eefd9b6673c708d7b2b01f073
parent7a19b18b8238421e682ca7059486c41d5aa4279d (diff)
downloadsamba-9091aec724545b0a301f863e4f19f756fb7f7f49.tar.gz
samba-9091aec724545b0a301f863e4f19f756fb7f7f49.tar.bz2
samba-9091aec724545b0a301f863e4f19f756fb7f7f49.zip
s3: Add sync cli_notify
-rw-r--r--source3/libsmb/clifile.c35
-rw-r--r--source3/libsmb/proto.h4
2 files changed, 39 insertions, 0 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index a25eb4636e..48a0636fec 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -5069,6 +5069,41 @@ NTSTATUS cli_notify_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
return NT_STATUS_OK;
}
+NTSTATUS cli_notify(struct cli_state *cli, uint16_t fnum, uint32_t buffer_size,
+ uint32_t completion_filter, bool recursive,
+ TALLOC_CTX *mem_ctx, uint32_t *pnum_changes,
+ struct notify_change **pchanges)
+{
+ TALLOC_CTX *frame = talloc_stackframe();
+ struct tevent_context *ev;
+ struct tevent_req *req;
+ NTSTATUS status = NT_STATUS_NO_MEMORY;
+
+ if (cli_has_async_calls(cli)) {
+ /*
+ * Can't use sync call while an async call is in flight
+ */
+ status = NT_STATUS_INVALID_PARAMETER;
+ goto fail;
+ }
+ ev = tevent_context_init(frame);
+ if (ev == NULL) {
+ goto fail;
+ }
+ req = cli_notify_send(ev, ev, cli, fnum, buffer_size,
+ completion_filter, recursive);
+ if (req == NULL) {
+ goto fail;
+ }
+ if (!tevent_req_poll_ntstatus(req, ev, &status)) {
+ goto fail;
+ }
+ status = cli_notify_recv(req, mem_ctx, pnum_changes, pchanges);
+ fail:
+ TALLOC_FREE(frame);
+ return status;
+}
+
struct cli_qpathinfo_state {
uint8_t *param;
uint8_t *data;
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index 9e03ec4798..336c95f07c 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -593,6 +593,10 @@ struct tevent_req *cli_notify_send(TALLOC_CTX *mem_ctx,
NTSTATUS cli_notify_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
uint32_t *pnum_changes,
struct notify_change **pchanges);
+NTSTATUS cli_notify(struct cli_state *cli, uint16_t fnum, uint32_t buffer_size,
+ uint32_t completion_filter, bool recursive,
+ TALLOC_CTX *mem_ctx, uint32_t *pnum_changes,
+ struct notify_change **pchanges);
struct tevent_req *cli_nttrans_create_send(TALLOC_CTX *mem_ctx,
struct event_context *ev,