summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2002-04-22 18:48:45 +0000
committerGerald Carter <jerry@samba.org>2002-04-22 18:48:45 +0000
commit2699f9b9df3f974a34e40761141361e997638b6c (patch)
treef903d3690aee0e134f13bd69ed4ebdd0ff0b9bb4 /source3/rpc_parse
parent6f366b7809375e4d7b061278a739ce541d291a97 (diff)
downloadsamba-2699f9b9df3f974a34e40761141361e997638b6c.tar.gz
samba-2699f9b9df3f974a34e40761141361e997638b6c.tar.bz2
samba-2699f9b9df3f974a34e40761141361e997638b6c.zip
printing merge from HEAD
(This used to be commit d3aed37dd87d425f51bcdc4e5151f0b0fe8f9c6b)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_spoolss.c61
1 files changed, 19 insertions, 42 deletions
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c
index b74ee3c5c5..e9f0ca858a 100644
--- a/source3/rpc_parse/parse_spoolss.c
+++ b/source3/rpc_parse/parse_spoolss.c
@@ -628,7 +628,6 @@ BOOL spoolss_io_devmode(char *desc, prs_struct *ps, int depth, DEVICEMODE *devmo
break;
/* See the comments on the DEVMODE in the msdn GDI documentation */
- /* (WINVER >= 0x0400) */
case 0x0400:
case 0x0401:
if (!prs_uint32("icmmethod", ps, depth, &devmode->icmmethod))
@@ -643,14 +642,10 @@ BOOL spoolss_io_devmode(char *desc, prs_struct *ps, int depth, DEVICEMODE *devmo
return False;
if (!prs_uint32("reserved2", ps, depth, &devmode->reserved2))
return False;
-
- /* (WINVER >= 0x0500) || (_WIN32_WINNT >= 0x0400) */
- if (devmode->specversion == 0x401) {
if (!prs_uint32("panningwidth", ps, depth, &devmode->panningwidth))
return False;
if (!prs_uint32("panningheight", ps, depth, &devmode->panningheight))
return False;
- }
break;
/* log an error if we see something else */
@@ -1726,12 +1721,19 @@ static uint32 size_of_relative_string(UNISTR *string)
uint32 size=0;
size=str_len_uni(string); /* the string length */
- size=size+1; /* add the leading zero */
+ size=size+1; /* add the trailing zero */
size=size*2; /* convert in char */
- /* Ensure size is 4 byte multiple (prs_align is being called...). */
- size += ((4 - (size & 3)) & 3);
size=size+4; /* add the size of the ptr */
+#if 0 /* JERRY */
+ /*
+ * Do not include alignment as Win2k does not align relative
+ * strings within a buffer --jerry
+ */
+ /* Ensure size is 4 byte multiple (prs_align is being called...). */
+ /* size += ((4 - (size & 3)) & 3); */
+#endif
+
return size;
}
@@ -1760,32 +1762,6 @@ static uint32 size_of_systemtime(SYSTEMTIME *systime)
}
/*******************************************************************
- * write a UNICODE string.
- * used by all the RPC structs passing a buffer
- ********************************************************************/
-
-static BOOL spoolss_smb_io_unistr(char *desc, UNISTR *uni, prs_struct *ps, int depth)
-{
- if (uni == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "spoolss_smb_io_unistr");
- depth++;
-
- /* there should be no align here as it can mess up
- parsing a NEW_BUFFER->prs */
-#if 0 /* JERRY */
- if (!prs_align(ps))
- return False;
-#endif
-
- if (!prs_unistr("unistr", ps, depth, uni))
- return False;
-
- return True;
-}
-
-/*******************************************************************
* write a UNICODE string and its relative pointer.
* used by all the RPC structs passing a buffer
*
@@ -1816,8 +1792,14 @@ static BOOL smb_io_relstr(char *desc, NEW_BUFFER *buffer, int depth, UNISTR *str
buffer->string_at_end -= (size_of_relative_string(string) - 4);
if(!prs_set_offset(ps, buffer->string_at_end))
return False;
+#if 0 /* JERRY */
+ /*
+ * Win2k does not align strings in a buffer
+ * Tested against WinNT 4.0 SP 6a & 2k SP2 --jerry
+ */
if (!prs_align(ps))
return False;
+#endif
buffer->string_at_end = prs_offset(ps);
/* write the string */
@@ -1844,7 +1826,7 @@ static BOOL smb_io_relstr(char *desc, NEW_BUFFER *buffer, int depth, UNISTR *str
return False;
/* read the string */
- if (!spoolss_smb_io_unistr(desc, string, ps, depth))
+ if (!smb_io_unistr(desc, string, ps, depth))
return False;
if(!prs_set_offset(ps, old_offset))
@@ -1901,7 +1883,7 @@ static BOOL smb_io_relarraystr(char *desc, NEW_BUFFER *buffer, int depth, uint16
}
/* write the string */
- if (!spoolss_smb_io_unistr(desc, &chaine, ps, depth)) {
+ if (!smb_io_unistr(desc, &chaine, ps, depth)) {
SAFE_FREE(chaine.buffer);
return False;
}
@@ -1940,7 +1922,7 @@ static BOOL smb_io_relarraystr(char *desc, NEW_BUFFER *buffer, int depth, uint16
return False;
do {
- if (!spoolss_smb_io_unistr(desc, &chaine, ps, depth))
+ if (!smb_io_unistr(desc, &chaine, ps, depth))
return False;
l_chaine=str_len_uni(&chaine);
@@ -5032,11 +5014,6 @@ BOOL make_spoolss_q_addprinterdriver(TALLOC_CTX *mem_ctx,
make_spoolss_driver_info_3(mem_ctx, &q_u->info.info_3, info->info3);
break;
- /* info level 6 is supported by WinME and Win2k */
- case 6:
- /* WRITEME!! will add later --jerry */
- break;
-
default:
DEBUG(0,("make_spoolss_q_addprinterdriver: Unknown info level [%d]\n", level));
break;