1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-08 04:58:40 +03:00

specversion merge from SAMBA_2_2

This commit is contained in:
Gerald Carter -
parent f8673bd499
commit d87aa35d48
2 changed files with 29 additions and 0 deletions

View File

@ -3099,6 +3099,8 @@ static WERROR save_driver_init_2(NT_PRINTER_INFO_LEVEL *printer, NT_PRINTER_PARA
goto done;
}
memset(nt_devmode, 0x0, sizeof(NT_DEVICEMODE));
ZERO_STRUCTP(nt_devmode);
/*

View File

@ -616,6 +616,21 @@ BOOL spoolss_io_devmode(char *desc, prs_struct *ps, int depth, DEVICEMODE *devmo
return False;
if (!prs_uint32("displayfrequency", ps, depth, &devmode->displayfrequency))
return False;
/*
* Conditional parsing. Assume that the DeviceMode has been
* zero'd by the caller.
*/
switch(devmode->specversion) {
/* Used by spooler when issuing OpenPrinter() calls. NT 3.5x? */
case 0x0320:
break;
/* See the comments on the DEVMODE in the msdn GDI documentation */
/* (WINVER >= 0x0400) */
case 0x0400:
case 0x0401:
if (!prs_uint32("icmmethod", ps, depth, &devmode->icmmethod))
return False;
if (!prs_uint32("icmintent", ps, depth, &devmode->icmintent))
@ -628,10 +643,22 @@ BOOL spoolss_io_devmode(char *desc, prs_struct *ps, int depth, DEVICEMODE *devmo
return False;
if (!prs_uint32("reserved2", ps, depth, &devmode->reserved2))
return False;
/* (WINVER >= 0x0500) || (_WIN32_WINNT >= 0x0400) */
if (devmode->specversion == 0x401) {
if (!prs_uint32("panningwidth", ps, depth, &devmode->panningwidth))
return False;
if (!prs_uint32("panningheight", ps, depth, &devmode->panningheight))
return False;
}
break;
/* log an error if we see something else */
default:
DEBUG(0,("spoolss_io_devmode: Unknown specversion [0x%x]!\n", devmode->specversion));
DEBUG(0,("spoolss_io_devmode: Please report to samba-technical@samba.org\n"));
break;
}
if (devmode->driverextra!=0) {
if (UNMARSHALLING(ps)) {