s3-spoolss: fix spoolss GetPrinterData behaviour
authorDavid Disseldorp <ddiss@suse.de>
Fri, 5 Nov 2010 14:24:22 +0000 (15:24 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 15 Nov 2010 19:40:42 +0000 (11:40 -0800)
commit37f856500cd113ddec420ed455a8f0f75d648386
tree1d5a1baf45f8bf81b597bee6542f6688d557d203
parent9262aafb07eff94b5c6281840e30dce4c8edf338
s3-spoolss: fix spoolss GetPrinterData behaviour

Windows sends spoolss GetPrinterData requests with an offered buffer
size of zero, Model and TrayFormTable data is commonly requested in
this way.

Samba's GetPrinterData response for the above case includes the correct
error code (WERR_MORE_DATA), however the type field is set to REG_NONE.
This causes Windows (seen on XP and 2k3) to give up on the request.

If the type field is retained (not set to REG_NONE) when responding with
WERR_MORE_DATA, Windows reissues the GetPrinterData request with an
increased offered buffer size.

Signed-off-by: Günther Deschner <gd@samba.org>
(cherry picked from commit 1c579318ae2d2480ee4cc998443c0d1661b39846)
source3/rpc_server/srv_spoolss_nt.c