r5498: fix OpenPrinter() idl and torture test
authorStefan Metzmacher <metze@samba.org>
Tue, 22 Feb 2005 08:04:52 +0000 (08:04 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:10:51 +0000 (13:10 -0500)
metze
(This used to be commit fd7950abe62e91108157619ace8e96e99110b668)

source4/librpc/idl/spoolss.idl
source4/torture/rpc/spoolss.c

index 0ac941190b2ead6c8ca90364750e2b8b99837e52..9a9495b046eb9c22930a1d2a33a616f984839453 100644 (file)
 
        /******************/
        /* Function: 0x01 */
+       typedef struct {
+               uint32 foo;
+       } spoolss_Devmode;
+
+       typedef struct {
+               uint32 size;
+               spoolss_Devmode *devmode;
+       } spoolss_DevmodeContainer;
+
        WERROR spoolss_OpenPrinter(
-               [in] unistr *server,
-               [in] unistr *printer,
-               [in] DATA_BLOB *buffer,
+               [in] unistr *printername,
+               [in] unistr *datatype,
+               [in] spoolss_DevmodeContainer devmode_ctr,
                [in] uint32 access_mask,
-               [out,ref]   policy_handle *handle
+               [out,ref] policy_handle *handle
        );
 
        /******************/
        WERROR spoolss_44(
        );
 
-       typedef struct {
-               uint32 foo;
-       } spoolss_Devmode;
-
-       typedef struct {
-               uint32 size;
-               spoolss_Devmode *devmode;
-       } spoolss_DevmodeContainer;
-
        typedef struct {
                uint32 size;
                unistr *client;
index 8e4ea15677ed32c10749a99e3e0b24b376b101a8..de8da366b72971f4772fe9b88ef36d4fb2b0ad7e 100644 (file)
@@ -646,18 +646,16 @@ static BOOL test_OpenPrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
        NTSTATUS status;
        struct spoolss_OpenPrinter r;
        struct policy_handle handle;
-       DATA_BLOB blob;
        BOOL ret = True;
 
-       blob = data_blob(NULL, 0);
+       r.in.printername        = talloc_asprintf(mem_ctx, "\\\\%s\\%s", dcerpc_server_name(p), name);
+       r.in.datatype           = NULL;
+       r.in.devmode_ctr.size   = 0;
+       r.in.devmode_ctr.devmode= NULL;
+       r.in.access_mask        = SEC_FLAG_MAXIMUM_ALLOWED;
+       r.out.handle            = &handle;
 
-       r.in.server = talloc_asprintf(mem_ctx, "\\\\%s\\%s", dcerpc_server_name(p), name);
-       r.in.printer = NULL;
-       r.in.buffer = &blob;
-       r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;    
-       r.out.handle = &handle;
-
-       printf("\nTesting OpenPrinter(%s)\n", r.in.server);
+       printf("\nTesting OpenPrinter(%s)\n", r.in.printername);
 
        status = dcerpc_spoolss_OpenPrinter(p, mem_ctx, &r);
        if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
@@ -667,7 +665,6 @@ static BOOL test_OpenPrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
                return True;
        }
 
-
        if (!test_GetPrinter(p, mem_ctx, &handle)) {
                ret = False;
        }
@@ -679,7 +676,7 @@ static BOOL test_OpenPrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
        if (!test_ClosePrinter(p, mem_ctx, &handle)) {
                ret = False;
        }
-       
+
        return ret;
 }