spoolss: fill in spoolss_Create/DeletePrinterIC + rerun make samba3-idl.
authorGünther Deschner <gd@samba.org>
Fri, 17 Jul 2009 13:38:40 +0000 (15:38 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 17 Jul 2009 13:40:06 +0000 (15:40 +0200)
Guenther

librpc/gen_ndr/cli_spoolss.c
librpc/gen_ndr/cli_spoolss.h
librpc/gen_ndr/ndr_spoolss.c
librpc/gen_ndr/spoolss.h
librpc/gen_ndr/srv_spoolss.c
librpc/idl/spoolss.idl

index 66083e6856740292a3a929666ed99b1e61f8ade5..38031b615de118b0435d11cb2d30551e986578ba 100644 (file)
@@ -2006,12 +2006,17 @@ NTSTATUS rpccli_spoolss_DeletePort(struct rpc_pipe_client *cli,
 
 NTSTATUS rpccli_spoolss_CreatePrinterIC(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
+                                       struct policy_handle *handle /* [in] [ref] */,
+                                       struct policy_handle *gdi_handle /* [out] [ref] */,
+                                       struct spoolss_DevmodeContainer *devmode_ctr /* [in] [ref] */,
                                        WERROR *werror)
 {
        struct spoolss_CreatePrinterIC r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.handle = handle;
+       r.in.devmode_ctr = devmode_ctr;
 
        if (DEBUGLEVEL >= 10) {
                NDR_PRINT_IN_DEBUG(spoolss_CreatePrinterIC, &r);
@@ -2036,6 +2041,7 @@ NTSTATUS rpccli_spoolss_CreatePrinterIC(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *gdi_handle = *r.out.gdi_handle;
 
        /* Return result */
        if (werror) {
@@ -2088,12 +2094,14 @@ NTSTATUS rpccli_spoolss_PlayGDIScriptOnPrinterIC(struct rpc_pipe_client *cli,
 
 NTSTATUS rpccli_spoolss_DeletePrinterIC(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
+                                       struct policy_handle *gdi_handle /* [in,out] [ref] */,
                                        WERROR *werror)
 {
        struct spoolss_DeletePrinterIC r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.gdi_handle = gdi_handle;
 
        if (DEBUGLEVEL >= 10) {
                NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterIC, &r);
@@ -2118,6 +2126,7 @@ NTSTATUS rpccli_spoolss_DeletePrinterIC(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *gdi_handle = *r.out.gdi_handle;
 
        /* Return result */
        if (werror) {
index baf5d61e2a8dc9015e36bc56a14794cdb1f9e27a..b171c69fbd8aa1c4745b5ef8615d3ac2a2059015 100644 (file)
@@ -294,12 +294,16 @@ NTSTATUS rpccli_spoolss_DeletePort(struct rpc_pipe_client *cli,
                                   WERROR *werror);
 NTSTATUS rpccli_spoolss_CreatePrinterIC(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
+                                       struct policy_handle *handle /* [in] [ref] */,
+                                       struct policy_handle *gdi_handle /* [out] [ref] */,
+                                       struct spoolss_DevmodeContainer *devmode_ctr /* [in] [ref] */,
                                        WERROR *werror);
 NTSTATUS rpccli_spoolss_PlayGDIScriptOnPrinterIC(struct rpc_pipe_client *cli,
                                                 TALLOC_CTX *mem_ctx,
                                                 WERROR *werror);
 NTSTATUS rpccli_spoolss_DeletePrinterIC(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
+                                       struct policy_handle *gdi_handle /* [in,out] [ref] */,
                                        WERROR *werror);
 NTSTATUS rpccli_spoolss_AddPrinterConnection(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
index a1be2fd92c594d2ace4e98a292c696601f2d4267..b5d9f1739c9ea36f2ed25b08ce91648a65378940 100644 (file)
@@ -23702,8 +23702,20 @@ _PUBLIC_ void ndr_print_spoolss_DeletePort(struct ndr_print *ndr, const char *na
 static enum ndr_err_code ndr_push_spoolss_CreatePrinterIC(struct ndr_push *ndr, int flags, const struct spoolss_CreatePrinterIC *r)
 {
        if (flags & NDR_IN) {
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
+               if (r->in.devmode_ctr == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_spoolss_DevmodeContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.devmode_ctr));
        }
        if (flags & NDR_OUT) {
+               if (r->out.gdi_handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.gdi_handle));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -23711,9 +23723,37 @@ static enum ndr_err_code ndr_push_spoolss_CreatePrinterIC(struct ndr_push *ndr,
 
 static enum ndr_err_code ndr_pull_spoolss_CreatePrinterIC(struct ndr_pull *ndr, int flags, struct spoolss_CreatePrinterIC *r)
 {
+       TALLOC_CTX *_mem_save_handle_0;
+       TALLOC_CTX *_mem_save_gdi_handle_0;
+       TALLOC_CTX *_mem_save_devmode_ctr_0;
        if (flags & NDR_IN) {
+               ZERO_STRUCT(r->out);
+
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.handle);
+               }
+               _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.devmode_ctr);
+               }
+               _mem_save_devmode_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.devmode_ctr, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_spoolss_DevmodeContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.devmode_ctr));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_ctr_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_PULL_ALLOC(ndr, r->out.gdi_handle);
+               ZERO_STRUCTP(r->out.gdi_handle);
        }
        if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.gdi_handle);
+               }
+               _mem_save_gdi_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.gdi_handle, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.gdi_handle));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gdi_handle_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -23729,11 +23769,23 @@ _PUBLIC_ void ndr_print_spoolss_CreatePrinterIC(struct ndr_print *ndr, const cha
        if (flags & NDR_IN) {
                ndr_print_struct(ndr, "in", "spoolss_CreatePrinterIC");
                ndr->depth++;
+               ndr_print_ptr(ndr, "handle", r->in.handle);
+               ndr->depth++;
+               ndr_print_policy_handle(ndr, "handle", r->in.handle);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "devmode_ctr", r->in.devmode_ctr);
+               ndr->depth++;
+               ndr_print_spoolss_DevmodeContainer(ndr, "devmode_ctr", r->in.devmode_ctr);
+               ndr->depth--;
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "spoolss_CreatePrinterIC");
                ndr->depth++;
+               ndr_print_ptr(ndr, "gdi_handle", r->out.gdi_handle);
+               ndr->depth++;
+               ndr_print_policy_handle(ndr, "gdi_handle", r->out.gdi_handle);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
@@ -23784,8 +23836,16 @@ _PUBLIC_ void ndr_print_spoolss_PlayGDIScriptOnPrinterIC(struct ndr_print *ndr,
 static enum ndr_err_code ndr_push_spoolss_DeletePrinterIC(struct ndr_push *ndr, int flags, const struct spoolss_DeletePrinterIC *r)
 {
        if (flags & NDR_IN) {
+               if (r->in.gdi_handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.gdi_handle));
        }
        if (flags & NDR_OUT) {
+               if (r->out.gdi_handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.gdi_handle));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -23793,9 +23853,28 @@ static enum ndr_err_code ndr_push_spoolss_DeletePrinterIC(struct ndr_push *ndr,
 
 static enum ndr_err_code ndr_pull_spoolss_DeletePrinterIC(struct ndr_pull *ndr, int flags, struct spoolss_DeletePrinterIC *r)
 {
+       TALLOC_CTX *_mem_save_gdi_handle_0;
        if (flags & NDR_IN) {
+               ZERO_STRUCT(r->out);
+
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.gdi_handle);
+               }
+               _mem_save_gdi_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.gdi_handle, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.gdi_handle));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gdi_handle_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_PULL_ALLOC(ndr, r->out.gdi_handle);
+               *r->out.gdi_handle = *r->in.gdi_handle;
        }
        if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.gdi_handle);
+               }
+               _mem_save_gdi_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.gdi_handle, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.gdi_handle));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gdi_handle_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -23811,11 +23890,19 @@ _PUBLIC_ void ndr_print_spoolss_DeletePrinterIC(struct ndr_print *ndr, const cha
        if (flags & NDR_IN) {
                ndr_print_struct(ndr, "in", "spoolss_DeletePrinterIC");
                ndr->depth++;
+               ndr_print_ptr(ndr, "gdi_handle", r->in.gdi_handle);
+               ndr->depth++;
+               ndr_print_policy_handle(ndr, "gdi_handle", r->in.gdi_handle);
+               ndr->depth--;
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "spoolss_DeletePrinterIC");
                ndr->depth++;
+               ndr_print_ptr(ndr, "gdi_handle", r->out.gdi_handle);
+               ndr->depth++;
+               ndr_print_policy_handle(ndr, "gdi_handle", r->out.gdi_handle);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
index 9446193863ada05caa378aa63029335c49c1eaa0..2575c4d082e110bdc093d618d82f7512fbebed61 100644 (file)
@@ -2516,6 +2516,12 @@ struct spoolss_DeletePort {
 
 struct spoolss_CreatePrinterIC {
        struct {
+               struct policy_handle *handle;/* [ref] */
+               struct spoolss_DevmodeContainer *devmode_ctr;/* [ref] */
+       } in;
+
+       struct {
+               struct policy_handle *gdi_handle;/* [ref] */
                WERROR result;
        } out;
 
@@ -2532,6 +2538,11 @@ struct spoolss_PlayGDIScriptOnPrinterIC {
 
 struct spoolss_DeletePrinterIC {
        struct {
+               struct policy_handle *gdi_handle;/* [ref] */
+       } in;
+
+       struct {
+               struct policy_handle *gdi_handle;/* [ref] */
                WERROR result;
        } out;
 
index 41a79b4a79d137f05ee89dfcccbe3f2ff47bb0a1..ae99f098a617349a80e05d6606076d724eb174cf 100644 (file)
@@ -3245,6 +3245,13 @@ static bool api_spoolss_CreatePrinterIC(pipes_struct *p)
                NDR_PRINT_IN_DEBUG(spoolss_CreatePrinterIC, r);
        }
 
+       ZERO_STRUCT(r->out);
+       r->out.gdi_handle = talloc_zero(r, struct policy_handle);
+       if (r->out.gdi_handle == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
        r->out.result = _spoolss_CreatePrinterIC(p, r);
 
        if (p->rng_fault_state) {
@@ -3391,6 +3398,8 @@ static bool api_spoolss_DeletePrinterIC(pipes_struct *p)
                NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterIC, r);
        }
 
+       ZERO_STRUCT(r->out);
+       r->out.gdi_handle = r->in.gdi_handle;
        r->out.result = _spoolss_DeletePrinterIC(p, r);
 
        if (p->rng_fault_state) {
@@ -8068,6 +8077,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 
                case NDR_SPOOLSS_CREATEPRINTERIC: {
                        struct spoolss_CreatePrinterIC *r = (struct spoolss_CreatePrinterIC *)_r;
+                       ZERO_STRUCT(r->out);
+                       r->out.gdi_handle = talloc_zero(mem_ctx, struct policy_handle);
+                       if (r->out.gdi_handle == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
                        r->out.result = _spoolss_CreatePrinterIC(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
@@ -8080,6 +8095,8 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 
                case NDR_SPOOLSS_DELETEPRINTERIC: {
                        struct spoolss_DeletePrinterIC *r = (struct spoolss_DeletePrinterIC *)_r;
+                       ZERO_STRUCT(r->out);
+                       r->out.gdi_handle = r->in.gdi_handle;
                        r->out.result = _spoolss_DeletePrinterIC(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
index f37424634d08c90e9bb3ccf04916b07befdd9fa9..acfb54f923738e08eeacf62b1be799320f227cf5 100644 (file)
@@ -1683,7 +1683,10 @@ import "misc.idl", "security.idl", "winreg.idl";
 
        /******************/
        /* Function: 0x28 */
-       [todo] WERROR spoolss_CreatePrinterIC(
+       WERROR spoolss_CreatePrinterIC(
+               [in,ref] policy_handle *handle,
+               [out,ref] policy_handle *gdi_handle,
+               [in,ref] spoolss_DevmodeContainer *devmode_ctr
        );
 
        /******************/
@@ -1693,7 +1696,8 @@ import "misc.idl", "security.idl", "winreg.idl";
 
        /******************/
        /* Function: 0x2a */
-       [todo] WERROR spoolss_DeletePrinterIC(
+       WERROR spoolss_DeletePrinterIC(
+               [in,out,ref] policy_handle *gdi_handle
        );
 
        /******************/