From 95d2a58e5b2cfc30304ca390de7073c214850984 Mon Sep 17 00:00:00 2001
From: Tim Potter <tpot@samba.org>
Date: Wed, 26 Jan 2005 20:43:55 +0000
Subject: [PATCH] r5018: Initialise required subsystems (by hand, generated by
 substituting BINARY for LIBRARY in config.mk).

Cut things down to just the samr pipe for the moment.
---
 source/scripting/swig/dcerpc.i | 48 ++++++++++++++++++++++++++++------
 1 file changed, 40 insertions(+), 8 deletions(-)

diff --git a/source/scripting/swig/dcerpc.i b/source/scripting/swig/dcerpc.i
index 89599367ede..041235efef8 100644
--- a/source/scripting/swig/dcerpc.i
+++ b/source/scripting/swig/dcerpc.i
@@ -341,6 +341,46 @@ PyObject *DATA_BLOB_to_python(DATA_BLOB obj)
 	werror_exception = PyErr_NewException("_dcerpc.WERROR", NULL, NULL);
 	PyDict_SetItemString(d, "NTSTATUS", ntstatus_exception);
 	PyDict_SetItemString(d, "WERROR", werror_exception);
+
+/* BINARY swig_dcerpc INIT */
+
+		extern NTSTATUS dcerpc_misc_init(void);
+		extern NTSTATUS dcerpc_krb5pac_init(void);
+		extern NTSTATUS dcerpc_samr_init(void);
+		extern NTSTATUS dcerpc_dcerpc_init(void);
+		extern NTSTATUS auth_sam_init(void);
+		extern NTSTATUS dcerpc_lsa_init(void);
+		extern NTSTATUS dcerpc_netlogon_init(void);
+		extern NTSTATUS gensec_init(void);
+		extern NTSTATUS auth_developer_init(void);
+		extern NTSTATUS gensec_spnego_init(void);
+		extern NTSTATUS auth_winbind_init(void);
+		extern NTSTATUS gensec_gssapi_init(void);
+		extern NTSTATUS gensec_ntlmssp_init(void);
+		extern NTSTATUS dcerpc_nbt_init(void);
+		extern NTSTATUS auth_anonymous_init(void);
+		extern NTSTATUS gensec_krb5_init(void);
+		extern NTSTATUS dcerpc_schannel_init(void);
+		extern NTSTATUS dcerpc_epmapper_init(void);
+		if (NT_STATUS_IS_ERR(dcerpc_misc_init())) exit(1);
+		if (NT_STATUS_IS_ERR(dcerpc_krb5pac_init())) exit(1);
+		if (NT_STATUS_IS_ERR(dcerpc_samr_init())) exit(1);
+		if (NT_STATUS_IS_ERR(dcerpc_dcerpc_init())) exit(1);
+		if (NT_STATUS_IS_ERR(auth_sam_init())) exit(1);
+		if (NT_STATUS_IS_ERR(dcerpc_lsa_init())) exit(1);
+		if (NT_STATUS_IS_ERR(dcerpc_netlogon_init())) exit(1);
+		if (NT_STATUS_IS_ERR(gensec_init())) exit(1);
+		if (NT_STATUS_IS_ERR(auth_developer_init())) exit(1);
+		if (NT_STATUS_IS_ERR(gensec_spnego_init())) exit(1);
+		if (NT_STATUS_IS_ERR(auth_winbind_init())) exit(1);
+		if (NT_STATUS_IS_ERR(gensec_gssapi_init())) exit(1);
+		if (NT_STATUS_IS_ERR(gensec_ntlmssp_init())) exit(1);
+		if (NT_STATUS_IS_ERR(dcerpc_nbt_init())) exit(1);
+		if (NT_STATUS_IS_ERR(auth_anonymous_init())) exit(1);
+		if (NT_STATUS_IS_ERR(gensec_krb5_init())) exit(1);
+		if (NT_STATUS_IS_ERR(dcerpc_schannel_init())) exit(1);
+		if (NT_STATUS_IS_ERR(dcerpc_epmapper_init())) exit(1);
+
 %}
 
 %typemap(in, numinputs=0) struct dcerpc_pipe **OUT (struct dcerpc_pipe *temp_dcerpc_pipe) {
@@ -402,12 +442,4 @@ const char *dcerpc_server_name(struct dcerpc_pipe *p);
 #include "librpc/gen_ndr/ndr_spoolss.h"
 %}
 
-%include "librpc/gen_ndr/misc.i"
-%include "librpc/gen_ndr/lsa.i"
 %include "librpc/gen_ndr/samr.i"
-%include "librpc/gen_ndr/spoolss.i"
-
-/* The status codes must be included last otherwise the automatically
-   generated .i files get confused.  This is kind of yucky. */
-
-%include "status_codes.i"