summaryrefslogtreecommitdiff
path: root/source3/libsmb/clifile.c
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 /source3/libsmb/clifile.c
parent7a19b18b8238421e682ca7059486c41d5aa4279d (diff)
downloadsamba-9091aec724545b0a301f863e4f19f756fb7f7f49.tar.gz
samba-9091aec724545b0a301f863e4f19f756fb7f7f49.tar.bz2
samba-9091aec724545b0a301f863e4f19f756fb7f7f49.zip
s3: Add sync cli_notify
Diffstat (limited to 'source3/libsmb/clifile.c')
-rw-r--r--source3/libsmb/clifile.c35
1 files changed, 35 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;