The first of Martin Zielinski <mz@seh.de> Vista printing patches.
authorJeremy Allison <jra@samba.org>
Thu, 24 Apr 2008 21:04:47 +0000 (14:04 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 24 Apr 2008 21:04:47 +0000 (14:04 -0700)
Jerry will test and should get into 3.2 final (and the next 3.0.x
release).
Jeremy.

source/rpc_parse/parse_spoolss.c
source/rpc_server/srv_spoolss_nt.c

index bf7166b2addd346e36163d51abcfc36beac20b85..ec6d44293d2f1181eee3d83596ebbb228c5f9111 100644 (file)
@@ -2129,7 +2129,12 @@ static bool smb_io_reldevmode(const char *desc, RPC_BUFFER *buffer, int depth, D
                }
                
                buffer->string_at_end -= ((*devmode)->size + (*devmode)->driverextra);
-               
+
+               /* mz:  we have to align the device mode for VISTA */
+               if (buffer->string_at_end % 4) {
+                       buffer->string_at_end += 4 - (buffer->string_at_end % 4);
+               }
+
                if(!prs_set_offset(ps, buffer->string_at_end))
                        return False;
                
index 4c5fcf53418bf5f16e77ee14c8e2d57992fb6793..a7b477e17d5e2ba336224eb0213ecfeab7352852 100644 (file)
@@ -9626,13 +9626,16 @@ WERROR _spoolss_enumprinterdataex(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATAEX *q_
 
        /* copy data into the reply */
 
-       r_u->ctr.size           = r_u->needed;
+       /* mz: Vista x64 returns 0x6f7 (The stub received bad data), if the
+          response buffer size is != the offered buffer size
+
+               r_u->ctr.size           = r_u->needed;
+       */
+       r_u->ctr.size           = in_size;
 
        r_u->ctr.size_of_array  = r_u->returned;
        r_u->ctr.values         = enum_values;
 
-
-
 done:
        if ( printer )
        free_a_printer(&printer, 2);