s3-spoolss: move MAXDEVICENAME to spoolss idl.
authorGünther Deschner <gd@samba.org>
Tue, 1 Dec 2009 01:38:19 +0000 (02:38 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 2 Dec 2009 13:36:36 +0000 (14:36 +0100)
Guenther

librpc/gen_ndr/ndr_spoolss.c
librpc/gen_ndr/spoolss.h
librpc/idl/spoolss.idl
source3/include/nt_printing.h

index a578ed8a85ef4be9df1490b3a2ecb87c1ca7c926..2bde1cad10453005985144aed073336af1626e40 100644 (file)
@@ -1051,7 +1051,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_DeviceMode(struct ndr_push *ndr, int
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
-               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->devicename, 32, sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->devicename, MAXDEVICENAME, sizeof(uint16_t), CH_UTF16));
                NDR_CHECK(ndr_push_spoolss_DeviceModeSpecVersion(ndr, NDR_SCALARS, r->specversion));
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->driverversion));
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size));
                NDR_CHECK(ndr_push_spoolss_DeviceModeSpecVersion(ndr, NDR_SCALARS, r->specversion));
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->driverversion));
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size));
@@ -1070,7 +1070,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_DeviceMode(struct ndr_push *ndr, int
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->yresolution));
                NDR_CHECK(ndr_push_spoolss_DeviceModeTTOption(ndr, NDR_SCALARS, r->ttoption));
                NDR_CHECK(ndr_push_spoolss_DeviceModeCollate(ndr, NDR_SCALARS, r->collate));
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->yresolution));
                NDR_CHECK(ndr_push_spoolss_DeviceModeTTOption(ndr, NDR_SCALARS, r->ttoption));
                NDR_CHECK(ndr_push_spoolss_DeviceModeCollate(ndr, NDR_SCALARS, r->collate));
-               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->formname, 32, sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->formname, MAXDEVICENAME, sizeof(uint16_t), CH_UTF16));
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logpixels));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bitsperpel));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pelswidth));
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logpixels));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bitsperpel));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pelswidth));
@@ -1107,7 +1107,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DeviceMode(struct ndr_pull *ndr, int
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
-               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->devicename, 32, sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->devicename, MAXDEVICENAME, sizeof(uint16_t), CH_UTF16));
                NDR_CHECK(ndr_pull_spoolss_DeviceModeSpecVersion(ndr, NDR_SCALARS, &r->specversion));
                NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->driverversion));
                NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
                NDR_CHECK(ndr_pull_spoolss_DeviceModeSpecVersion(ndr, NDR_SCALARS, &r->specversion));
                NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->driverversion));
                NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
@@ -1126,7 +1126,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DeviceMode(struct ndr_pull *ndr, int
                NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->yresolution));
                NDR_CHECK(ndr_pull_spoolss_DeviceModeTTOption(ndr, NDR_SCALARS, &r->ttoption));
                NDR_CHECK(ndr_pull_spoolss_DeviceModeCollate(ndr, NDR_SCALARS, &r->collate));
                NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->yresolution));
                NDR_CHECK(ndr_pull_spoolss_DeviceModeTTOption(ndr, NDR_SCALARS, &r->ttoption));
                NDR_CHECK(ndr_pull_spoolss_DeviceModeCollate(ndr, NDR_SCALARS, &r->collate));
-               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->formname, 32, sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->formname, MAXDEVICENAME, sizeof(uint16_t), CH_UTF16));
                NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logpixels));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bitsperpel));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pelswidth));
                NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logpixels));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bitsperpel));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pelswidth));
index a4c0010d5c7ad177212600871d6756daf1926720..3153672194a498ec99fd68068dadd8225ef67809 100644 (file)
@@ -12,6 +12,7 @@
 
 #define PRINTER_STATUS_OK      ( 0x00000000 )
 #define JOB_STATUS_QUEUED      ( 0x0000 )
 
 #define PRINTER_STATUS_OK      ( 0x00000000 )
 #define JOB_STATUS_QUEUED      ( 0x0000 )
+#define MAXDEVICENAME  ( 32 )
 #define PRINTER_ENUM_ICONMASK  ( (PRINTER_ENUM_ICON1|PRINTER_ENUM_ICON2|PRINTER_ENUM_ICON3|PRINTER_ENUM_ICON4|PRINTER_ENUM_ICON5|PRINTER_ENUM_ICON6|PRINTER_ENUM_ICON7|PRINTER_ENUM_ICON8) )
 #define SPL_ARCH_WIN40 ( "WIN40" )
 #define SPL_ARCH_W32X86        ( "W32X86" )
 #define PRINTER_ENUM_ICONMASK  ( (PRINTER_ENUM_ICON1|PRINTER_ENUM_ICON2|PRINTER_ENUM_ICON3|PRINTER_ENUM_ICON4|PRINTER_ENUM_ICON5|PRINTER_ENUM_ICON6|PRINTER_ENUM_ICON7|PRINTER_ENUM_ICON8) )
 #define SPL_ARCH_WIN40 ( "WIN40" )
 #define SPL_ARCH_W32X86        ( "W32X86" )
index bb517a10e12fe345f4c682a879b63f8f0c726aab..0e71e1a6bc68a00d84990baabb19cf90e7586c55 100644 (file)
@@ -368,8 +368,10 @@ import "misc.idl", "security.idl", "winreg.idl";
                DMDITHER_GRAYSCALE      = 0x0000000A
        } spoolss_DeviceModeDitherType;
 
                DMDITHER_GRAYSCALE      = 0x0000000A
        } spoolss_DeviceModeDitherType;
 
+       const int MAXDEVICENAME = 32;
+
        typedef [public,gensize] struct {
        typedef [public,gensize] struct {
-               [charset(UTF16)] uint16 devicename[32];
+               [charset(UTF16)] uint16 devicename[MAXDEVICENAME];
                spoolss_DeviceModeSpecVersion specversion;
                uint16 driverversion;
                uint16 size;
                spoolss_DeviceModeSpecVersion specversion;
                uint16 driverversion;
                uint16 size;
@@ -388,7 +390,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                uint16 yresolution;
                spoolss_DeviceModeTTOption ttoption;
                spoolss_DeviceModeCollate collate;
                uint16 yresolution;
                spoolss_DeviceModeTTOption ttoption;
                spoolss_DeviceModeCollate collate;
-               [charset(UTF16)] uint16 formname[32];
+               [charset(UTF16)] uint16 formname[MAXDEVICENAME];
                uint16 logpixels; /* reserved */
                uint32 bitsperpel; /* reserved */
                uint32 pelswidth; /* reserved */
                uint16 logpixels; /* reserved */
                uint32 bitsperpel; /* reserved */
                uint32 pelswidth; /* reserved */
index 3a509a243a29cf9c583132f1593d7e368ee02943..713443a4fa662448240bc1a923cf0d1507d8b9ff 100644 (file)
@@ -36,8 +36,6 @@ typedef struct {
        NT_PRINTER_KEY  *keys;
 } NT_PRINTER_DATA;
 
        NT_PRINTER_KEY  *keys;
 } NT_PRINTER_DATA;
 
-#define MAXDEVICENAME  32
-
 typedef struct ntdevicemode
 {
        fstring devicename;
 typedef struct ntdevicemode
 {
        fstring devicename;