From 37f856500cd113ddec420ed455a8f0f75d648386 Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Fri, 5 Nov 2010 15:24:22 +0100 Subject: [PATCH] s3-spoolss: fix spoolss GetPrinterData behaviour MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit 1c579318ae2d2480ee4cc998443c0d1661b39846) --- source3/rpc_server/srv_spoolss_nt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index d767c187753..262f4a38e28 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -8699,7 +8699,7 @@ WERROR _spoolss_GetPrinterDataEx(struct pipes_struct *p, } done: - *r->out.type = SPOOLSS_BUFFER_OK(*r->out.type, REG_NONE); + /* retain type when returning WERR_MORE_DATA */ r->out.data = SPOOLSS_BUFFER_OK(r->out.data, r->out.data); return SPOOLSS_BUFFER_OK(WERR_OK, WERR_MORE_DATA); -- 2.11.4.GIT