1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-07 12:23:51 +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:
Tim Potter
2004-09-22 03:42:58 +00:00
committed by Gerald (Jerry) Carter
parent a0e571a9dd
commit 4ddcae90a2
2 changed files with 7 additions and 3 deletions

View File

@@ -337,10 +337,10 @@ sub ParseFunction($)
# 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 .= "\tresultobj = $fn->{NAME}_ptr_to_python(mem_ctx, \$1";
$result .= "\ttemp = $fn->{NAME}_ptr_to_python(mem_ctx, \$1";
foreach my $e (@{$fn->{DATA}}) {
if ((my $switch_is = util::has_property($e, "switch_is"))) {
@@ -349,6 +349,10 @@ sub ParseFunction($)
}
$result .= ");\n\n";
$result .= "\tPyDict_SetItemString(temp, \"result\", resultobj);\n";
$result .= "\tresultobj = temp;\n";
$result .= "\ttalloc_free(mem_ctx);\n";
$result .= "}\n\n";

View File

@@ -289,7 +289,7 @@ NTSTATUS dcerpc_pipe_connect(struct dcerpc_pipe **OUT,
%exception {
$action
if (!NT_STATUS_IS_OK(result)) {
if (NT_STATUS_IS_ERR(result)) {
set_ntstatus_exception(NT_STATUS_V(result));
return NULL;
}