Problem with enumprinterdataex
Martin Zielinski
mz at seh.de
Tue Aug 22 10:45:05 GMT 2006
Hello!
The client system is Windows XP SP2.
When calling "enumprinterdataex" and receiving a response with a length
that is not 4-byte aligned, I receive an error 1783 (RPC_X_BAD_STUB_DATA)
The following patch (3.0.23b) fixes this:
diff -urN srv_spoolss_nt.c.orig srv_spoolss_nt.c
--- srv_spoolss_nt.c.orig 2006-08-22 12:33:37.000000000 +0200
+++ srv_spoolss_nt.c 2006-08-22 12:40:43.000000000 +0200
@@ -9374,6 +9374,9 @@
}
/* housekeeping information in the reply */
+
+ if (needed % 4)
+ needed = (needed + 4) - (needed % 4);
r_u->needed = needed;
r_u->returned = num_entries;
----------------------------
It seems to work without reallocating the buffer, but that could be a
possible "follow-up" problem.?
BTW the EnumPrinterDataEx call returns an aligned size for the required
buffer (when asking for the buffer size) although samba reports a
different size.
Bye,
Martin
--
Martin Zielinski mz at seh.de
Software Development
SEH Computertechnik GmbH www.seh.de
More information about the samba-technical
mailing list