mirror of
https://github.com/samba-team/samba.git
synced 2025-01-21 18:04:06 +03:00
More attributes to publish. All DsSpooler attributes except REG_MULTI_SZ ones should be published now.
(This used to be commit 4fc602fd7da4b216748b005f62b14be0cfdddd63)
This commit is contained in:
parent
cf7f1d5de0
commit
6d66efe6c2
@ -227,6 +227,9 @@ typedef struct nt_printer_driver_info_level
|
||||
#define SPOOL_REG_PRINTSEPARATORFILE "printSeparatorFile"
|
||||
#define SPOOL_REG_PRINTSHARENAME "printShareName"
|
||||
#define SPOOL_REG_PRINTSPOOLING "printSpooling"
|
||||
#define SPOOL_REGVAL_PRINTWHILESPOOLING "PrintWhileSpooling"
|
||||
#define SPOOL_REGVAL_PRINTAFTERSPOOLED "PrintAfterSpooled"
|
||||
#define SPOOL_REGVAL_PRINTDIRECT "PrintDirect"
|
||||
#define SPOOL_REG_PRINTSTAPLINGSUPPORTED "printStaplingSupported"
|
||||
#define SPOOL_REG_PRINTSTARTTIME "printStartTime"
|
||||
#define SPOOL_REG_PRINTSTATUS "printStatus"
|
||||
|
@ -2456,7 +2456,8 @@ static BOOL map_nt_printer_info2_to_dsspooler(NT_PRINTER_INFO_LEVEL_2 *info2)
|
||||
smb_ucs2_t conv_str[1024];
|
||||
size_t str_size;
|
||||
fstring longname;
|
||||
char *uncname;
|
||||
char *ascii_str;
|
||||
uint8 bin_bool;
|
||||
uint32 dword;
|
||||
int i;
|
||||
|
||||
@ -2495,11 +2496,69 @@ static BOOL map_nt_printer_info2_to_dsspooler(NT_PRINTER_INFO_LEVEL_2 *info2)
|
||||
(char *) &dword, sizeof(dword));
|
||||
|
||||
regval_ctr_delvalue(ctr, SPOOL_REG_UNCNAME);
|
||||
asprintf(&uncname, "\\\\%s\\%s", longname, info2->sharename);
|
||||
str_size = push_ucs2(NULL, conv_str, uncname, sizeof(conv_str),
|
||||
asprintf(&ascii_str, "\\\\%s\\%s", longname, info2->sharename);
|
||||
str_size = push_ucs2(NULL, conv_str, ascii_str, sizeof(conv_str),
|
||||
STR_TERMINATE | STR_NOALIGN);
|
||||
regval_ctr_addvalue(ctr, SPOOL_REG_UNCNAME, REG_SZ, (char *) conv_str,
|
||||
str_size);
|
||||
safe_free(ascii_str);
|
||||
|
||||
regval_ctr_delvalue(ctr, SPOOL_REG_DRIVERNAME);
|
||||
str_size = push_ucs2(NULL, conv_str, info2->drivername,
|
||||
sizeof(conv_str), STR_TERMINATE | STR_NOALIGN);
|
||||
regval_ctr_addvalue(ctr, SPOOL_REG_DRIVERNAME, REG_SZ,
|
||||
(char *) conv_str, str_size);
|
||||
|
||||
regval_ctr_delvalue(ctr, SPOOL_REG_LOCATION);
|
||||
str_size = push_ucs2(NULL, conv_str, info2->location,
|
||||
sizeof(conv_str), STR_TERMINATE | STR_NOALIGN);
|
||||
regval_ctr_addvalue(ctr, SPOOL_REG_LOCATION, REG_SZ,
|
||||
(char *) conv_str, str_size);
|
||||
|
||||
regval_ctr_delvalue(ctr, SPOOL_REG_PRINTSEPARATORFILE);
|
||||
str_size = push_ucs2(NULL, conv_str, info2->sepfile,
|
||||
sizeof(conv_str), STR_TERMINATE | STR_NOALIGN);
|
||||
regval_ctr_addvalue(ctr, SPOOL_REG_PRINTSEPARATORFILE, REG_SZ,
|
||||
(char *) conv_str, str_size);
|
||||
|
||||
regval_ctr_delvalue(ctr, SPOOL_REG_PRINTSTARTTIME);
|
||||
dword = info2->starttime;
|
||||
regval_ctr_addvalue(ctr, SPOOL_REG_PRINTSTARTTIME, REG_DWORD,
|
||||
(char *) &dword, sizeof(dword));
|
||||
|
||||
regval_ctr_delvalue(ctr, SPOOL_REG_PRINTENDTIME);
|
||||
dword = info2->untiltime;
|
||||
regval_ctr_addvalue(ctr, SPOOL_REG_PRINTENDTIME, REG_DWORD,
|
||||
(char *) &dword, sizeof(dword));
|
||||
|
||||
regval_ctr_delvalue(ctr, SPOOL_REG_PRIORITY);
|
||||
dword = info2->priority;
|
||||
regval_ctr_addvalue(ctr, SPOOL_REG_PRIORITY, REG_DWORD,
|
||||
(char *) &dword, sizeof(dword));
|
||||
|
||||
regval_ctr_delvalue(ctr, SPOOL_REG_PRINTKEEPPRINTEDJOBS);
|
||||
bin_bool = (info2->attributes >> 8) & 0x1;
|
||||
regval_ctr_addvalue(ctr, SPOOL_REG_PRINTKEEPPRINTEDJOBS, REG_BINARY,
|
||||
(char *) &bin_bool, sizeof(bin_bool));
|
||||
|
||||
regval_ctr_delvalue(ctr, SPOOL_REG_PRINTSPOOLING);
|
||||
switch (info2->attributes & 0x3) {
|
||||
case 0:
|
||||
ascii_str = SPOOL_REGVAL_PRINTWHILESPOOLING;
|
||||
break;
|
||||
case 1:
|
||||
ascii_str = SPOOL_REGVAL_PRINTAFTERSPOOLED;
|
||||
break;
|
||||
case 2:
|
||||
ascii_str = SPOOL_REGVAL_PRINTDIRECT;
|
||||
break;
|
||||
default:
|
||||
ascii_str = "unknown";
|
||||
}
|
||||
str_size = push_ucs2(NULL, conv_str, ascii_str, sizeof(conv_str),
|
||||
STR_TERMINATE | STR_NOALIGN);
|
||||
regval_ctr_addvalue(ctr, SPOOL_REG_PRINTSPOOLING, REG_SZ,
|
||||
(char *) conv_str, str_size);
|
||||
|
||||
return True;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user