Lines Matching refs:printer
44 /* Map generic permissions to printer object specific permissions */
76 /* We need one default form to support our default printer. Msoft adds the
229 generate a new TDB_DATA key for storing a printer
250 generate a new TDB_DATA key for storing a printer security descriptor
295 DEBUG(0,("upgrade_to_version_3:moving printer\n"));
298 DEBUG(0,("upgrade_to_version_3: failed to move printer. Error (%s)\n", tdb_errorstr(tdb_printers)));
303 DEBUG(0,("upgrade_to_version_3: failed to delete printer. Error (%s)\n", tdb_errorstr(tdb_drivers)));
460 DEBUG(0,("upgrade_to_version_4: upgrading printer security descriptors\n"));
488 /* upgrade printer records and security descriptors */
527 DEBUG(0,("upgrade_to_version_5: normalizing printer keys\n"));
620 DEBUG(0,("nt_printing_init: Unknown printer database version [%d]\n", vers_id));
635 * register callback to handle updating printer data
680 DEBUG(10,("traverse_counting_printers: printer = [%s] printer_count = %d\n", key.dptr, *printer_count));
690 each add or delete printer RPC. Only Microsoft knows why... JRR020119
704 * otherwise, bump it by the current printer count
1814 * trauma will most likely occur if an client attempts to use any printer
1947 * It does make sense to NOT store the server's name in the printer TDB.
1954 * "The server on which the printer resides does not have a suitable
1955 * <printer driver name> printer driver installed. Click OK if you
2180 DEBUG(20,("Dumping printer driver at level [%d]\n", level));
2282 Pack all values in all printer keys
2343 Delete a printer - this just deletes the printer info file, any open
2382 * in addprinter: no servername and the printer is the name
2384 * and printer is \\server\\printer
2388 * path=\\other_server\printer
2403 * the info->sharename is the thing you can name when you add a printer
2404 * that's the short-name when you create shared printer for 95/98
2405 * So I've made a limitation in SAMBA: you can only have 1 printer model
2463 DEBUG(8, ("error updating printer to tdb on disk\n"));
2467 DEBUG(8,("packed printer [%s] with driver [%s] portname=[%s] len=%d\n",
2716 search for a registry key name in the existing printer data
2746 search for a registry key name in the existing printer data
2793 /* special case of asking for the top level printer data registry key names */
2935 * @param info2 NT_PRINTER_INFO_LEVEL_2 describing printer - gets modified
3033 NT_PRINTER_INFO_LEVEL *printer)
3045 DEBUG(5, ("publishing printer %s\n", printer->info_2->printername));
3090 sharename_escaped = escape_rdn_val_string_alloc(printer->info_2->sharename);
3122 get_local_printer_publishing_data(ctx, &mods, printer->info_2->data);
3124 printer->info_2->sharename);
3132 DEBUG(3, ("error publishing %s: %s\n", printer->info_2->sharename, ads_errstr(ads_rc)));
3141 store_printer_guid(printer->info_2, guid);
3142 win_rc = mod_a_printer(printer, 2);
3150 NT_PRINTER_INFO_LEVEL *printer)
3156 DEBUG(5, ("unpublishing printer %s\n", printer->info_2->printername));
3158 /* remove the printer from the directory */
3160 printer->info_2->sharename, global_myname());
3177 * Publish a printer in the directory
3179 * @param snum describing printer service
3187 NT_PRINTER_INFO_LEVEL *printer = NULL;
3190 win_rc = get_a_printer(print_hnd, &printer, 2, lp_servicename(snum));
3198 if (!(map_nt_printer_info2_to_dsspooler(printer->info_2))) {
3203 printer->info_2->attributes |= PRINTER_ATTRIBUTE_PUBLISHED;
3206 printer->info_2->attributes ^= PRINTER_ATTRIBUTE_PUBLISHED;
3213 win_rc = mod_a_printer(printer, 2);
3241 win_rc = nt_printer_publish_ads(ads, printer);
3244 win_rc = nt_printer_unpublish_ads(ads, printer);
3249 free_a_printer(&printer, 2);
3260 NT_PRINTER_INFO_LEVEL *printer = NULL;
3285 if (W_ERROR_IS_OK(get_a_printer(NULL, &printer, 2,
3287 (printer->info_2->attributes & PRINTER_ATTRIBUTE_PUBLISHED))
3288 nt_printer_publish_ads(ads, printer);
3290 free_a_printer(&printer, 2);
3301 NT_PRINTER_INFO_LEVEL *printer = NULL;
3308 win_rc = get_a_printer(print_hnd, &printer, 2, lp_servicename(snum));
3311 !(printer->info_2->attributes & PRINTER_ATTRIBUTE_PUBLISHED) ||
3312 ((i = lookup_printerkey(printer->info_2->data, SPOOL_DSSPOOLER_KEY)) < 0) ||
3313 !(ctr = printer->info_2->data->keys[i].values) ||
3316 free_a_printer(&printer, 2);
3320 /* fetching printer guids really ought to be a separate function. */
3348 free_a_printer(&printer, 2);
3393 DEBUG(8,("delete_all_printer_data: Removed all Printer Data from printer [%s]\n",
3447 DEBUG(8,("delete_all_printer_data: No keys left for printer [%s]\n", p2->printername ));
3469 /* find the printer key first */
3502 /* find the printer key first */
3744 Get a default printer info 2 struct.
3757 can now run the **local** APW to install a local printer driver
3758 for a Samba shared printer in 2.2. Without this, drivers **must** be
3929 DEBUG(9,("Unpacked printer [%s] name [%s] running driver [%s]\n",
3938 static uint32 dump_a_printer(NT_PRINTER_INFO_LEVEL *printer, uint32 level)
3943 DEBUG(106,("Dumping printer at level [%d]\n", level));
3948 if (printer->info_2 == NULL)
3952 info2=printer->info_2;
4025 Modify a printer. This is called from SETPRINTERDATA/DELETEPRINTERDATA.
4028 WERROR mod_a_printer(NT_PRINTER_INFO_LEVEL *printer, uint32 level)
4032 dump_a_printer(printer, level);
4040 * global spooler variable (not per printer).
4047 printer->info_2->changeid = rev_changeid();
4052 * printer show changes imeediately in
4068 result=update_a_printer_2(printer->info_2);
4081 Initialize printer devmode & data with previously saved driver init values.
4095 * Delete any printer data 'values' already set. When called for driver
4096 * replace, there will generally be some, but during an add printer, there
4125 * The saved DEVMODE contains the devicename from the printer used during
4126 * the initialization save. Change it to reflect the new printer.
4135 * NT/2k does not change out the entire DeviceMode of a printer
4140 * the printer's device mode, bit **only** when you change a
4146 /* Bind the saved DEVMODE to the new the printer */
4151 DEBUG(10,("set_driver_init_2: Set printer [%s] init %s DEVMODE for driver [%s]\n",
4154 /* Add the printer data 'values' to the new printer */
4170 Initialize printer devmode & data with previously saved driver init values.
4171 When a printer is created using AddPrinter, the drivername bound to the
4172 printer is used to lookup previously saved driver initialization info, which
4173 is bound to the new printer.
4176 BOOL set_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level)
4182 result = set_driver_init_2(printer->info_2);
4219 Pack up the DEVMODE and values for a printer into a 'driver init' entry
4220 in the tdb. Note: this is different from the driver entry and the printer
4264 DEBUG(8, ("update_driver_init_2: error updating printer init to tdb on disk\n"));
4268 DEBUG(10,("update_driver_init_2: Saved printer [%s] init DEVMODE & values for driver [%s]\n",
4275 Update (i.e. save) the driver init info (DEVMODE and values) for a printer
4278 static uint32 update_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level)
4282 dump_a_printer(printer, level);
4286 result = update_driver_init_2(printer->info_2);
4297 Convert the printer data value, a REG_BINARY array, into an initialization
4331 this printer into the tdb. Later, new printers that use this driver will
4337 Win32 printer driver code on any Unix that Samba runs on, we are stuck with it.
4344 static WERROR save_driver_init_2(NT_PRINTER_INFO_LEVEL *printer, uint8 *data, uint32 data_len )
4349 NT_DEVICEMODE *tmp_devmode = printer->info_2->devmode;
4352 * When the DEVMODE is already set on the printer, don't try to unpack it.
4356 if ( !printer->info_2->devmode && data_len ) {
4358 * Set devmode on printer info, so entire printer initialization can be
4382 printer->info_2->devmode = nt_devmode;
4386 * Pack up and add (or update) the DEVMODE and any current printer data to
4391 if ( update_driver_init(printer, 2) != 0 ) {
4399 * printer to match it. This allows initialization of the current printer
4402 status = mod_a_printer(printer, 2);
4404 DEBUG(10,("save_driver_init_2: error setting DEVMODE on printer [%s]\n",
4405 printer->info_2->printername));
4412 printer->info_2->devmode = tmp_devmode;
4418 Update the driver init info (DEVMODE and specifics) for a printer
4421 WERROR save_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level, uint8 *data, uint32 data_len)
4427 status = save_driver_init_2( printer, data, data_len );
4483 /* we have a new printer now. Save it with this handle */
4510 NT_PRINTER_INFO_LEVEL *printer = *pp_printer;
4512 if ( !printer )
4517 if ( printer->info_2 )
4518 free_nt_printer_info_level_2(&printer->info_2);
4536 DEBUG(104,("adding a printer at level [%d]\n", level));
4640 to a printer
4647 NT_PRINTER_INFO_LEVEL *printer = NULL;
4661 if ( !W_ERROR_IS_OK(get_a_printer(NULL, &printer, 2, lp_servicename(snum))) )
4664 if ( strequal(info_3->name, printer->info_2->drivername) )
4667 free_a_printer( &printer, 2 );
5018 Remove a printer driver from the TDB. This assumes that the the driver was
5081 Store a security desc for a printer.
5098 present when new ACEs are added or removed by changing printer
5182 Construct a default security descriptor buffer for a printer.
5241 created by NT when setting ACE entries in printer
5266 Get a security desc for a printer.
5387 A printer and a printer driver are 2 different things.
5394 Your third printer is an old dot-matrix model for the accounting :-).
5399 3 files for the printers (1 by printer):
5413 /* Convert generic access rights to printer object specific access rights.
5430 actions we perform when checking printer access.
5447 3) "printer admins" (may result in numerous calls to winbind)
5471 /* Get printer name */
5480 /* Get printer security descriptor */
5498 objects of a printer. */
5512 printer?? -tpot */
5526 /* see if we need to try the printer admin list */
5551 NT_PRINTER_INFO_LEVEL *printer = NULL;
5557 if (!W_ERROR_IS_OK(get_a_printer(NULL, &printer, 2, servicename)))
5560 if (printer->info_2->starttime == 0 && printer->info_2->untiltime == 0)
5566 if (mins >= printer->info_2->starttime && mins <= printer->info_2->untiltime)
5569 free_a_printer(&printer, 2);
5581 char* get_server_name( Printer_entry *printer )
5583 return printer->servername;