summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2002-12-04 21:30:52 +0000
committerJim McDonough <jmcd@samba.org>2002-12-04 21:30:52 +0000
commit6d66efe6c2a3c716f0aff857d4c9b88203efe733 (patch)
treef273cfcf7f6ba9bbb435d5bc031904038913723b /source3
parentcf7f1d5de0b8a6e6af8b91fe82034a83030da656 (diff)
downloadsamba-6d66efe6c2a3c716f0aff857d4c9b88203efe733.tar.gz
samba-6d66efe6c2a3c716f0aff857d4c9b88203efe733.tar.bz2
samba-6d66efe6c2a3c716f0aff857d4c9b88203efe733.zip
More attributes to publish. All DsSpooler attributes except REG_MULTI_SZ ones should be published now.
(This used to be commit 4fc602fd7da4b216748b005f62b14be0cfdddd63)
Diffstat (limited to 'source3')
-rw-r--r--source3/include/nt_printing.h3
-rw-r--r--source3/printing/nt_printing.c65
2 files changed, 65 insertions, 3 deletions
diff --git a/source3/include/nt_printing.h b/source3/include/nt_printing.h
index 23d474c957..54d55683fc 100644
--- a/source3/include/nt_printing.h
+++ b/source3/include/nt_printing.h
@@ -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"
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 00d1eaacd3..e7aa82577d 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -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;
}