diff options
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 01535b2933..ba122e04f8 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -25,6 +25,8 @@ #include "includes.h" +#define RELIES_ON_SMBD_FUNCTIONS_LINKED_INTO_SPOOLSSD + extern int DEBUGLEVEL; extern pstring global_myname; @@ -168,7 +170,7 @@ static Printer_entry *find_printer_index_by_hnd(const POLICY_HND *hnd) ****************************************************************************/ static void clear_handle(POLICY_HND *hnd) { - memset(hnd->data, 0, POLICY_HND_SIZE); + ZERO_STRUCTP(hnd); } /**************************************************************************** @@ -1198,6 +1200,17 @@ static void spoolss_notify_job_position(int snum, SPOOL_NOTIFY_INFO_DATA *data, #define END 65535 +struct s_notify_info_data_table +{ + uint16 type; + uint16 field; + char *name; + uint32 size; + void (*fn) (int snum, SPOOL_NOTIFY_INFO_DATA *data, + print_queue_struct *queue, + NT_PRINTER_INFO_LEVEL *printer); +}; + struct s_notify_info_data_table notify_info_data_table[] = { { PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_SERVER_NAME, "PRINTER_NOTIFY_SERVER_NAME", POINTER, spoolss_notify_server_name }, @@ -3840,11 +3853,13 @@ uint32 _spoolss_addprinterex( const UNISTR2 *uni_srv_name, uint32 level, Modify internal driver heirarchy. ****************************************************************************/ +#if RELIES_ON_SMBD_FUNCTIONS_LINKED_INTO_SPOOLSSD static uint32 modify_driver_heirarchy(NT_PRINTER_DRIVER_INFO_LEVEL *driver, uint32 level) { pstring path_old; pstring path_new; pstring short_archi; + /* find_service is an smbd-specific function call */ int snum = find_service("print$"); char *model = NULL; @@ -3878,6 +3893,7 @@ static uint32 modify_driver_heirarchy(NT_PRINTER_DRIVER_INFO_LEVEL *driver, uint return NT_STATUS_NO_PROBLEMO; } +#endif /**************************************************************************** ****************************************************************************/ @@ -3894,11 +3910,13 @@ uint32 _spoolss_addprinterdriver( const UNISTR2 *server_name, if (add_a_printer_driver(driver, level)!=0) return ERROR_ACCESS_DENIED; +#if RELIES_ON_SMBD_FUNCTIONS_LINKED_INTO_SPOOLSSD if ((err = modify_driver_heirarchy(&driver, level)) != 0) { safe_free(driver.info_3); safe_free(driver.info_6); return err; } +#endif safe_free(driver.info_3); safe_free(driver.info_6); @@ -3928,8 +3946,13 @@ static uint32 getprinterdriverdir_level_1(UNISTR2 *name, UNISTR2 *uni_environmen unistr2_to_ascii(long_archi, uni_environment, sizeof(long_archi)-1); get_short_archi(short_archi, long_archi); +#if RELIES_ON_SMBD_FUNCTIONS_LINKED_INTO_SPOOLSSD slprintf(path, sizeof(path)-1, "\\\\%s\\print$\\%s\\TMP_%u", global_myname, short_archi, (unsigned int)sys_getpid()); +#else + slprintf(path, sizeof(path)-1, "\\\\%s\\print$\\%s", + global_myname, short_archi); +#endif DEBUG(4,("printer driver directory: [%s]\n", path)); fill_driverdir_1(info, path); |