mirror of
https://github.com/samba-team/samba.git
synced 2025-11-06 08:23:50 +03:00
r2490: Some changes to take into account non-error NTSTATUS codes being returned:
- Only throw an exception if NT_STATUS_IS_ERR() instead of
!NT_STATUS_IS_OK().
- Add the NTSTATUS value to the returned dictionary under a key of
'result' so calling functions can access it.
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
a0e571a9dd
commit
4ddcae90a2
@@ -337,10 +337,10 @@ sub ParseFunction($)
|
|||||||
|
|
||||||
# Output typemap
|
# Output typemap
|
||||||
|
|
||||||
$result .= "%typemap(argout) struct $fn->{NAME} * {\n";
|
$result .= "%typemap(argout) struct $fn->{NAME} * (PyObject *temp) {\n";
|
||||||
$result .= "\tTALLOC_CTX *mem_ctx = talloc_init(\"typemap(argout) $fn->{NAME}\");\n\n";
|
$result .= "\tTALLOC_CTX *mem_ctx = talloc_init(\"typemap(argout) $fn->{NAME}\");\n\n";
|
||||||
|
|
||||||
$result .= "\tresultobj = $fn->{NAME}_ptr_to_python(mem_ctx, \$1";
|
$result .= "\ttemp = $fn->{NAME}_ptr_to_python(mem_ctx, \$1";
|
||||||
|
|
||||||
foreach my $e (@{$fn->{DATA}}) {
|
foreach my $e (@{$fn->{DATA}}) {
|
||||||
if ((my $switch_is = util::has_property($e, "switch_is"))) {
|
if ((my $switch_is = util::has_property($e, "switch_is"))) {
|
||||||
@@ -349,6 +349,10 @@ sub ParseFunction($)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$result .= ");\n\n";
|
$result .= ");\n\n";
|
||||||
|
|
||||||
|
$result .= "\tPyDict_SetItemString(temp, \"result\", resultobj);\n";
|
||||||
|
$result .= "\tresultobj = temp;\n";
|
||||||
|
|
||||||
$result .= "\ttalloc_free(mem_ctx);\n";
|
$result .= "\ttalloc_free(mem_ctx);\n";
|
||||||
$result .= "}\n\n";
|
$result .= "}\n\n";
|
||||||
|
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ NTSTATUS dcerpc_pipe_connect(struct dcerpc_pipe **OUT,
|
|||||||
|
|
||||||
%exception {
|
%exception {
|
||||||
$action
|
$action
|
||||||
if (!NT_STATUS_IS_OK(result)) {
|
if (NT_STATUS_IS_ERR(result)) {
|
||||||
set_ntstatus_exception(NT_STATUS_V(result));
|
set_ntstatus_exception(NT_STATUS_V(result));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user