api_DosPrintQGetInfo
Scott Moomaw
scott at bridgewater.edu
Mon Nov 23 22:01:14 GMT 1998
We've been researching a problem with Win95 printing here on campus. I
have made a change in api_DosPrintQGetInfo inside of ipc.c that seems to
have corrected the problem. Things haven't been fully tested to be sure
that the printing problems are totally gone, but we've gone a whole day
without noticing a single instance.
Currently, api_DosPrintQGetInfo, with the help of check_printq_info, is
returning a NERR_notsupported when unknown format levels are received by
DosPrintQGetInfo. It appears that the Win95 PC is being confused by the
receipt of the API unsupported error code. From my research, it appears
that instead of returning NERR_notsupported that the routine should return
ERROR_INVALID_LEVEL to indicate an unsupported level. This allows the PC
to renegotiate the DosPrintQGetInfo level that it is using. The present
error return code seems to be stalling printing from the PC.
To test it, I put a quick patch into ipc.c. In place of
if (!check_printq_info(&desc,uLevel,str2,str3)) return False;
I placed the following code snippet.
if (!check_printq_info(&desc,uLevel,str2,str3)) {
*rdata_len = 0;
*rparam_len = 6;
*rparam = REALLOC(*rparam,*rparam_len);
SSVALS(*rparam,0,ERROR_INVALID_LEVEL);
SSVAL(*rparam,2,0);
SSVAL(*rparam,4,0);
return(True);
}
This is not the optimal location for the code to be finally integrated
into the release product, but it allowed me to test its effects.
Basically, if the level checking fails for any reason, I'm returning an
ERROR_INVALID_LEVEL code instead of a NERR_notsupported. The net effect
is that Win95 is properly dropping down to lower levels of printqinfo
requests after getting this response.
Scott
------------------------------------------------------------------------
Scott Moomaw, Network Administrator Scott at Bridgewater.edu
Bridgewater College, C E Shull Computing Center
Bridgewater, VA 22812
Phone (540) 828 - 8000 x5437 FAX: (540) 828 - 5493
More information about the samba-technical
mailing list