struct notify_change_request {
struct notify_change_request *prev, *next;
struct files_struct *fsp; /* backpointer for cancel by mid */
- char request_buf[smb_size];
+ uint8 request_buf[smb_size];
uint32 filter;
uint32 max_param;
struct notify_mid_map *mid_map;
Setup the common parts of the return packet and send it.
*****************************************************************************/
-static void change_notify_reply_packet(const char *request_buf,
+static void change_notify_reply_packet(const uint8 *request_buf,
NTSTATUS error_code)
{
- const char *inbuf = request_buf;
+ const char *inbuf = (char *)request_buf;
char outbuf[smb_size+38];
memset(outbuf, '\0', sizeof(outbuf));
- construct_reply_common(request_buf, outbuf);
+ construct_reply_common(inbuf, outbuf);
ERROR_NT(error_code);
"failed.");
}
-void change_notify_reply(const char *request_buf, uint32 max_param,
+void change_notify_reply(const uint8 *request_buf, uint32 max_param,
struct notify_change_buf *notify_buf)
{
char *outbuf = NULL;
goto done;
}
- construct_reply_common(request_buf, outbuf);
+ construct_reply_common((char *)request_buf, outbuf);
- if (send_nt_replies(request_buf, outbuf, buflen, NT_STATUS_OK, prs_data_p(&ps),
+ if (send_nt_replies((char *)request_buf, outbuf, buflen, NT_STATUS_OK, prs_data_p(&ps),
prs_offset(&ps), NULL, 0) == -1) {
exit_server("change_notify_reply_packet: send_smb failed.");
}
return status;
}
-NTSTATUS change_notify_add_request(const char *inbuf, uint32 max_param,
+NTSTATUS change_notify_add_request(const uint8 *inbuf, uint32 max_param,
uint32 filter, BOOL recursive,
struct files_struct *fsp)
{
don't allow a directory to be opened.
****************************************************************************/
-static int call_nt_transact_notify_change(connection_struct *conn, char *inbuf,
- char *outbuf, int length,
- int bufsize,
- uint16 **ppsetup, uint32 setup_count,
- char **ppparams,
- uint32 parameter_count,
- char **ppdata, uint32 data_count,
- uint32 max_data_count,
- uint32 max_param_count)
+static void call_nt_transact_notify_change(connection_struct *conn,
+ struct smb_request *req,
+ uint16 **ppsetup,
+ uint32 setup_count,
+ char **ppparams,
+ uint32 parameter_count,
+ char **ppdata, uint32 data_count,
+ uint32 max_data_count,
+ uint32 max_param_count)
{
uint16 *setup = *ppsetup;
files_struct *fsp;
BOOL recursive;
if(setup_count < 6) {
- return ERROR_DOS(ERRDOS,ERRbadfunc);
+ reply_doserror(req, ERRDOS, ERRbadfunc);
+ return;
}
fsp = file_fsp(SVAL(setup,4));
DEBUG(3,("call_nt_transact_notify_change\n"));
if(!fsp) {
- return ERROR_DOS(ERRDOS,ERRbadfid);
+ reply_doserror(req, ERRDOS, ERRbadfid);
+ return;
}
{
char *filter_string;
if (!(filter_string = notify_filter_string(NULL, filter))) {
- return ERROR_NT(NT_STATUS_NO_MEMORY);
+ reply_nterror(req,NT_STATUS_NO_MEMORY);
+ return;
}
DEBUG(3,("call_nt_transact_notify_change: notify change "
}
if((!fsp->is_directory) || (conn != fsp->conn)) {
- return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+ reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+ return;
}
if (fsp->notify == NULL) {
if (!NT_STATUS_IS_OK(status)) {
DEBUG(10, ("change_notify_create returned %s\n",
nt_errstr(status)));
- return ERROR_NT(status);
+ reply_nterror(req, status);
+ return;
}
}
* here.
*/
- change_notify_reply(inbuf, max_param_count, fsp->notify);
+ change_notify_reply(req->inbuf, max_param_count, fsp->notify);
/*
* change_notify_reply() above has independently sent its
* results
*/
- return -1;
+ return;
}
/*
* No changes pending, queue the request
*/
- status = change_notify_add_request(inbuf, max_param_count, filter,
+ status = change_notify_add_request(req->inbuf, max_param_count, filter,
recursive, fsp);
if (!NT_STATUS_IS_OK(status)) {
- return ERROR_NT(status);
+ reply_nterror(req, status);
}
-
- return -1;
+ return;
}
/****************************************************************************
case NT_TRANSACT_NOTIFY_CHANGE:
{
- char *inbuf, *outbuf;
- int size, bufsize;
-
START_PROFILE(NT_transact_notify_change);
-
- if (!reply_prep_legacy(req, &inbuf, &outbuf, &size,
- &bufsize)) {
- reply_nterror(req, NT_STATUS_NO_MEMORY);
- END_PROFILE(SMBnttrans);
- return;
- }
-
- reply_post_legacy(
- req,
- call_nt_transact_notify_change(
- conn, inbuf, outbuf, size, bufsize,
- &state->setup, state->setup_count,
- &state->param, state->total_param,
- &state->data, state->total_data,
- state->max_data_return,
- state->max_param_return));
-
+ call_nt_transact_notify_change(
+ conn, req,
+ &state->setup, state->setup_count,
+ &state->param, state->total_param,
+ &state->data, state->total_data,
+ state->max_data_return,
+ state->max_param_return);
END_PROFILE(NT_transact_notify_change);
break;
}