}
status = cli_echo_recv(req);
TALLOC_FREE(req);
- PyErr_NTSTATUS_NOT_OK_RAISE(status);
+ if (!NT_STATUS_IS_OK(status)) {
+ PyErr_SetNTSTATUS(status);
+ return NULL;
+ }
Py_RETURN_NONE;
}
&free_file_nodes,
&fs_identifier);
TALLOC_FREE(req);
- PyErr_NTSTATUS_NOT_OK_RAISE(status);
+ if (!NT_STATUS_IS_OK(status)) {
+ PyErr_SetNTSTATUS(status);
+ return NULL;
+ }
return Py_BuildValue("{s:I,s:I,s:I,s:I,s:I,s:I,s:I,s:I}",
"optimal_transfer_size", optimal_transfer_size,
}
status = cli_ntcreate_recv(req, &fnum, NULL);
TALLOC_FREE(req);
- PyErr_NTSTATUS_NOT_OK_RAISE(status);
+ if (!NT_STATUS_IS_OK(status)) {
+ PyErr_SetNTSTATUS(status);
+ return NULL;
+ }
/* write the new file contents */
state.data = data;
}
status = cli_push_recv(req);
TALLOC_FREE(req);
- PyErr_NTSTATUS_NOT_OK_RAISE(status);
+ if (!NT_STATUS_IS_OK(status)) {
+ PyErr_SetNTSTATUS(status);
+ return NULL;
+ }
/* close the file handle */
req = cli_close_send(NULL, self->ev, self->cli, fnum, 0);
return NULL;
}
status = cli_close_recv(req);
- PyErr_NTSTATUS_NOT_OK_RAISE(status);
+ if (!NT_STATUS_IS_OK(status)) {
+ PyErr_SetNTSTATUS(status);
+ return NULL;
+ }
Py_RETURN_NONE;
}
}
status = cli_ntcreate_recv(req, &fnum, NULL);
TALLOC_FREE(req);
- PyErr_NTSTATUS_NOT_OK_RAISE(status);
+ if (!NT_STATUS_IS_OK(status)) {
+ PyErr_SetNTSTATUS(status);
+ return NULL;
+ }
/* get a buffer to hold the file contents */
status = py_smb_filesize(self, fnum, &size);
- PyErr_NTSTATUS_NOT_OK_RAISE(status);
+ if (!NT_STATUS_IS_OK(status)) {
+ PyErr_SetNTSTATUS(status);
+ return NULL;
+ }
result = PyBytes_FromStringAndSize(NULL, size);
if (result == NULL) {
}
status = cli_unlink_recv(req);
TALLOC_FREE(req);
- PyErr_NTSTATUS_NOT_OK_RAISE(status);
+ if (!NT_STATUS_IS_OK(status)) {
+ PyErr_SetNTSTATUS(status);
+ return NULL;
+ }
Py_RETURN_NONE;
}
}
status = cli_rmdir_recv(req);
TALLOC_FREE(req);
- PyErr_NTSTATUS_NOT_OK_RAISE(status);
+ if (!NT_STATUS_IS_OK(status)) {
+ PyErr_SetNTSTATUS(status);
+ return NULL;
+ }
Py_RETURN_NONE;
}
}
status = cli_mkdir_recv(req);
TALLOC_FREE(req);
- PyErr_NTSTATUS_NOT_OK_RAISE(status);
+ if (!NT_STATUS_IS_OK(status)) {
+ PyErr_SetNTSTATUS(status);
+ return NULL;
+ }
Py_RETURN_NONE;
}
return NULL;
}
status = cli_query_security_descriptor_recv(req, NULL, &sd);
- PyErr_NTSTATUS_NOT_OK_RAISE(status);
+ if (!NT_STATUS_IS_OK(status)) {
+ PyErr_SetNTSTATUS(status);
+ return NULL;
+ }
return py_return_ndr_struct(
"samba.dcerpc.security", "descriptor", sd, sd);
}
status = cli_set_security_descriptor_recv(req);
- PyErr_NTSTATUS_NOT_OK_RAISE(status);
+ if (!NT_STATUS_IS_OK(status)) {
+ PyErr_SetNTSTATUS(status);
+ return NULL;
+ }
Py_RETURN_NONE;
}