2 * Unix SMB/CIFS implementation.
3 * Virtual Windows Registry Layer
4 * Copyright (C) Gerald Carter 2002-2005
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 /* Implementation of registry virtual views for printing information */
26 #define DBGC_CLASS DBGC_RPC_SRV
28 #define MAX_TOP_LEVEL_KEYS 3
30 /* some symbolic indexes into the top_level_keys */
32 #define KEY_INDEX_ENVIR 0
33 #define KEY_INDEX_FORMS 1
34 #define KEY_INDEX_PRINTER 2
36 static const char *top_level_keys
[MAX_TOP_LEVEL_KEYS
] = {
42 /**********************************************************************
43 It is safe to assume that every registry path passed into on of
44 the exported functions here begins with KEY_PRINTING else
45 these functions would have never been called. This is a small utility
46 function to strip the beginning of the path and make a copy that the
47 caller can modify. Note that the caller is responsible for releasing
48 the memory allocated here.
49 **********************************************************************/
51 static char* trim_reg_path( const char *path
)
54 uint16 key_len
= strlen(path
);
57 int key_printing_len
= strlen( KEY_PRINTING
);
58 int key_printing2k_len
= strlen( KEY_PRINTING_2K
);
59 int key_printing_ports_len
= strlen( KEY_PRINTING_PORTS
);
64 * sanity check...this really should never be True.
65 * It is only here to prevent us from accessing outside
66 * the path buffer in the extreme case.
69 if ( (key_len
< key_printing_len
)
70 && (key_len
< key_printing2k_len
)
71 && (key_len
< key_printing_ports_len
) )
73 DEBUG(0,("trim_reg_path: Registry path too short! [%s]\n", path
));
78 if ( StrnCaseCmp( KEY_PRINTING
, path
, key_printing_len
) == 0 ) {
79 base_key_len
= key_printing_len
;
81 else if ( StrnCaseCmp( KEY_PRINTING_2K
, path
, key_printing2k_len
) == 0 ) {
82 base_key_len
= key_printing2k_len
;
84 else if ( StrnCaseCmp( KEY_PRINTING_PORTS
, path
, key_printing2k_len
) == 0 ) {
85 base_key_len
= key_printing_ports_len
;
88 DEBUG(0,("trim_reg_path: invalid path [%s]\n", path
));
92 p
= path
+ base_key_len
;
103 /**********************************************************************
104 *********************************************************************/
106 static int fill_ports_values( REGVAL_CTR
*values
)
113 result
= enumports_hook( &numlines
, &lines
);
115 if ( !W_ERROR_IS_OK(result
) )
118 init_unistr2( &data
, "", UNI_STR_TERMINATE
);
119 for ( i
=0; i
<numlines
; i
++ )
120 regval_ctr_addvalue( values
, lines
[i
], REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
126 /**********************************************************************
127 handle enumeration of subkeys below KEY_PRINTING\Environments
128 Environments\$ARCH\Print Processors
129 Environments\$ARCH\Drivers\{0,2,3}
130 *********************************************************************/
132 #define ENVIRONMENT_DRIVERS 1
133 #define ENVIRONMENT_PRINTPROC 2
135 static int print_subpath_environments( char *key
, REGSUBKEY_CTR
*subkeys
)
137 const char *environments
[] = {
141 "Windows NT Alpha_AXP",
142 "Windows NT PowerPC",
146 fstring
*drivers
= NULL
;
147 int i
, env_index
, num_drivers
;
148 char *keystr
, *base
, *subkeypath
;
150 int num_subkeys
= -1;
151 int env_subkey_type
= 0;
154 DEBUG(10,("print_subpath_environments: key=>[%s]\n", key
? key
: "NULL" ));
156 /* list all possible architectures */
159 for ( num_subkeys
=0; environments
[num_subkeys
]; num_subkeys
++ )
160 regsubkey_ctr_addkey( subkeys
, environments
[num_subkeys
] );
165 /* we are dealing with a subkey of "Environments */
167 pstrcpy( key2
, key
);
169 reg_split_path( keystr
, &base
, &subkeypath
);
173 for ( env_index
=0; environments
[env_index
]; env_index
++ ) {
174 if ( strequal( environments
[env_index
], base
) )
177 if ( !environments
[env_index
] )
180 /* ...\Print\Environements\...\ */
183 regsubkey_ctr_addkey( subkeys
, "Drivers" );
184 regsubkey_ctr_addkey( subkeys
, "Print Processors" );
189 /* more of the key path to process */
192 reg_split_path( keystr
, &base
, &subkeypath
);
194 /* ...\Print\Environements\...\Drivers\ */
196 if ( strequal(base
, "Drivers") )
197 env_subkey_type
= ENVIRONMENT_DRIVERS
;
198 else if ( strequal(base
, "Print Processors") )
199 env_subkey_type
= ENVIRONMENT_PRINTPROC
;
205 switch ( env_subkey_type
) {
206 case ENVIRONMENT_DRIVERS
:
207 switch ( env_index
) {
209 regsubkey_ctr_addkey( subkeys
, "Version-0" );
211 default: /* Windows NT based systems */
212 regsubkey_ctr_addkey( subkeys
, "Version-2" );
213 regsubkey_ctr_addkey( subkeys
, "Version-3" );
217 return regsubkey_ctr_numkeys( subkeys
);
219 case ENVIRONMENT_PRINTPROC
:
220 if ( env_index
== 1 || env_index
== 5 || env_index
== 6 )
221 regsubkey_ctr_addkey( subkeys
, "winprint" );
223 return regsubkey_ctr_numkeys( subkeys
);
227 /* we finally get to enumerate the drivers */
230 reg_split_path( keystr
, &base
, &subkeypath
);
232 /* get thr print processors key out of the way */
233 if ( env_subkey_type
== ENVIRONMENT_PRINTPROC
) {
234 if ( !strequal( base
, "winprint" ) )
236 return !subkeypath
? 0 : -1;
239 /* only dealing with drivers from here on out */
241 version
= atoi(&base
[strlen(base
)-1]);
249 if ( version
!= 2 && version
!= 3 )
256 num_drivers
= get_ntdrivers( &drivers
, environments
[env_index
], version
);
257 for ( i
=0; i
<num_drivers
; i
++ )
258 regsubkey_ctr_addkey( subkeys
, drivers
[i
] );
260 return regsubkey_ctr_numkeys( subkeys
);
263 /* if anything else left, just say if has no subkeys */
265 DEBUG(1,("print_subpath_environments: unhandled key [%s] (subkey == %s\n",
271 /***********************************************************************
272 simple function to prune a pathname down to the basename of a file
273 **********************************************************************/
275 static char* dos_basename ( char *path
)
279 p
= strrchr( path
, '\\' );
288 /**********************************************************************
289 handle enumeration of values below
290 KEY_PRINTING\Environments\<arch>\<version>\<drivername>
291 *********************************************************************/
293 static int print_subpath_values_environments( char *key
, REGVAL_CTR
*val
)
295 char *keystr
, *base
, *subkeypath
;
297 fstring arch_environment
;
300 NT_PRINTER_DRIVER_INFO_LEVEL driver_ctr
;
301 NT_PRINTER_DRIVER_INFO_LEVEL_3
*info3
;
304 char *buffer2
= NULL
;
309 int env_subkey_type
= 0;
312 DEBUG(8,("print_subpath_values_environments: Enter key => [%s]\n", key
? key
: "NULL"));
317 /* The only keys below KEY_PRINTING\Environments is the
318 specific printer driver info */
322 pstrcpy( key2
, key
);
324 reg_split_path( keystr
, &base
, &subkeypath
);
327 fstrcpy( arch_environment
, base
);
332 reg_split_path( keystr
, &base
, &subkeypath
);
334 if ( strequal(base
, "Drivers") )
335 env_subkey_type
= ENVIRONMENT_DRIVERS
;
336 else if ( strequal(base
, "Print Processors") )
337 env_subkey_type
= ENVIRONMENT_PRINTPROC
;
345 /* for now bail out if we are seeing anything other than the drivers key */
347 if ( env_subkey_type
== ENVIRONMENT_PRINTPROC
)
351 reg_split_path( keystr
, &base
, &subkeypath
);
353 version
= atoi(&base
[strlen(base
)-1]);
355 /* printer driver name */
358 reg_split_path( keystr
, &base
, &subkeypath
);
359 /* don't go any deeper for now */
362 fstrcpy( driver
, base
);
364 w_result
= get_a_printer_driver( &driver_ctr
, 3, driver
, arch_environment
, version
);
366 if ( !W_ERROR_IS_OK(w_result
) )
369 /* build the values out of the driver information */
370 info3
= driver_ctr
.info_3
;
372 filename
= dos_basename( info3
->driverpath
);
373 init_unistr2( &data
, filename
, UNI_STR_TERMINATE
);
374 regval_ctr_addvalue( val
, "Driver", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
376 filename
= dos_basename( info3
->configfile
);
377 init_unistr2( &data
, filename
, UNI_STR_TERMINATE
);
378 regval_ctr_addvalue( val
, "Configuration File", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
380 filename
= dos_basename( info3
->datafile
);
381 init_unistr2( &data
, filename
, UNI_STR_TERMINATE
);
382 regval_ctr_addvalue( val
, "Data File", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
384 filename
= dos_basename( info3
->helpfile
);
385 init_unistr2( &data
, filename
, UNI_STR_TERMINATE
);
386 regval_ctr_addvalue( val
, "Help File", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
388 init_unistr2( &data
, info3
->defaultdatatype
, UNI_STR_TERMINATE
);
389 regval_ctr_addvalue( val
, "Data Type", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
391 regval_ctr_addvalue( val
, "Version", REG_DWORD
, (char*)&info3
->cversion
, sizeof(info3
->cversion
) );
393 if ( info3
->dependentfiles
) {
394 /* place the list of dependent files in a single
395 character buffer, separating each file name by
398 for ( i
=0; strcmp(info3
->dependentfiles
[i
], ""); i
++ ) {
399 /* strip the path to only the file's base name */
401 filename
= dos_basename( info3
->dependentfiles
[i
] );
403 length
= strlen(filename
);
405 buffer2
= SMB_REALLOC( buffer
, buffer_size
+ (length
+ 1)*sizeof(uint16
) );
410 init_unistr2( &data
, filename
, UNI_STR_TERMINATE
);
411 memcpy( buffer
+buffer_size
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
413 buffer_size
+= (length
+ 1)*sizeof(uint16
);
416 /* terminated by double NULL. Add the final one here */
418 buffer2
= SMB_REALLOC( buffer
, buffer_size
+ 2 );
424 buffer
[buffer_size
++] = '\0';
425 buffer
[buffer_size
++] = '\0';
429 regval_ctr_addvalue( val
, "Dependent Files", REG_MULTI_SZ
, buffer
, buffer_size
);
431 free_a_printer_driver( driver_ctr
, 3 );
435 DEBUG(8,("print_subpath_values_environments: Exit\n"));
437 return regval_ctr_numvals( val
);
441 /**********************************************************************
442 handle enumeration of subkeys below KEY_PRINTING\Forms
443 Really just a stub function, but left here in case it needs to
445 *********************************************************************/
447 static int print_subpath_forms( char *key
, REGSUBKEY_CTR
*subkeys
)
449 DEBUG(10,("print_subpath_forms: key=>[%s]\n", key
? key
: "NULL" ));
451 /* there are no subkeys */
459 /**********************************************************************
460 handle enumeration of values below KEY_PRINTING\Forms
461 *********************************************************************/
463 static int print_subpath_values_forms( char *key
, REGVAL_CTR
*val
)
469 DEBUG(10,("print_values_forms: key=>[%s]\n", key
? key
: "NULL" ));
471 /* handle ..\Forms\ */
475 nt_forms_struct
*forms_list
= NULL
;
476 nt_forms_struct
*form
= NULL
;
479 if ( (num_values
= get_ntforms( &forms_list
)) == 0 )
482 DEBUG(10,("print_subpath_values_forms: [%d] user defined forms returned\n",
485 /* handle user defined forms */
487 for ( i
=0; i
<num_values
; i
++ )
489 form
= &forms_list
[i
];
491 data
[0] = form
->width
;
492 data
[1] = form
->length
;
493 data
[2] = form
->left
;
495 data
[4] = form
->right
;
496 data
[5] = form
->bottom
;
497 data
[6] = form_index
++;
498 data
[7] = form
->flag
;
500 regval_ctr_addvalue( val
, form
->name
, REG_BINARY
, (char*)data
, sizeof(data
) );
504 SAFE_FREE( forms_list
);
507 /* handle built-on forms */
509 if ( (num_values
= get_builtin_ntforms( &forms_list
)) == 0 )
512 DEBUG(10,("print_subpath_values_forms: [%d] built-in forms returned\n",
515 for ( i
=0; i
<num_values
; i
++ )
517 form
= &forms_list
[i
];
519 data
[0] = form
->width
;
520 data
[1] = form
->length
;
521 data
[2] = form
->left
;
523 data
[4] = form
->right
;
524 data
[5] = form
->bottom
;
525 data
[6] = form_index
++;
526 data
[7] = form
->flag
;
528 regval_ctr_addvalue( val
, form
->name
, REG_BINARY
, (char*)data
, sizeof(data
) );
531 SAFE_FREE( forms_list
);
537 /**********************************************************************
538 handle enumeration of subkeys below KEY_PRINTING\Printers
539 *********************************************************************/
541 static int print_subpath_printers( char *key
, REGSUBKEY_CTR
*subkeys
)
543 int n_services
= lp_numservices();
548 char *keystr
, *key2
= NULL
;
549 char *base
, *new_path
;
550 NT_PRINTER_INFO_LEVEL
*printer
= NULL
;
551 fstring
*subkey_names
= NULL
;
553 DEBUG(10,("print_subpath_printers: key=>[%s]\n", key
? key
: "NULL" ));
557 /* enumerate all printers */
559 for (snum
=0; snum
<n_services
; snum
++) {
560 if ( !(lp_snum_ok(snum
) && lp_print_ok(snum
) ) )
563 /* don't report the [printers] share */
565 if ( strequal( lp_servicename(snum
), PRINTERS_NAME
) )
568 fstrcpy( sname
, lp_servicename(snum
) );
570 regsubkey_ctr_addkey( subkeys
, sname
);
573 num_subkeys
= regsubkey_ctr_numkeys( subkeys
);
577 /* get information for a specific printer */
579 key2
= SMB_STRDUP( key
);
581 reg_split_path( keystr
, &base
, &new_path
);
583 if ( !W_ERROR_IS_OK( get_a_printer(NULL
, &printer
, 2, base
) ) )
586 num_subkeys
= get_printer_subkeys( &printer
->info_2
->data
, new_path
?new_path
:"", &subkey_names
);
588 for ( i
=0; i
<num_subkeys
; i
++ )
589 regsubkey_ctr_addkey( subkeys
, subkey_names
[i
] );
591 free_a_printer( &printer
, 2 );
593 /* no other subkeys below here */
597 SAFE_FREE( subkey_names
);
602 /**********************************************************************
603 handle enumeration of values below KEY_PRINTING\Printers
604 *********************************************************************/
606 static int print_subpath_values_printers( char *key
, REGVAL_CTR
*val
)
609 char *keystr
, *key2
= NULL
;
610 char *base
, *new_path
;
611 NT_PRINTER_INFO_LEVEL
*printer
= NULL
;
612 NT_PRINTER_INFO_LEVEL_2
*info2
;
618 NT_PRINTER_DATA
*p_data
;
623 * Theres are tw cases to deal with here
624 * (1) enumeration of printer_info_2 values
625 * (2) enumeration of the PrinterDriverData subney
629 /* top level key has no values */
633 key2
= SMB_STRDUP( key
);
635 reg_split_path( keystr
, &base
, &new_path
);
637 fstrcpy( printername
, base
);
641 uint32 printer_status
= PRINTER_STATUS_OK
;
643 /* we are dealing with the printer itself */
645 if ( !W_ERROR_IS_OK( get_a_printer(NULL
, &printer
, 2, printername
) ) )
648 info2
= printer
->info_2
;
651 regval_ctr_addvalue( val
, "Attributes", REG_DWORD
, (char*)&info2
->attributes
, sizeof(info2
->attributes
) );
652 regval_ctr_addvalue( val
, "Priority", REG_DWORD
, (char*)&info2
->priority
, sizeof(info2
->attributes
) );
653 regval_ctr_addvalue( val
, "ChangeID", REG_DWORD
, (char*)&info2
->changeid
, sizeof(info2
->changeid
) );
654 regval_ctr_addvalue( val
, "Default Priority", REG_DWORD
, (char*)&info2
->default_priority
, sizeof(info2
->default_priority
) );
656 /* lie and say everything is ok since we don't want to call print_queue_length() to get the real status */
657 regval_ctr_addvalue( val
, "Status", REG_DWORD
, (char*)&printer_status
, sizeof(info2
->status
) );
659 regval_ctr_addvalue( val
, "StartTime", REG_DWORD
, (char*)&info2
->starttime
, sizeof(info2
->starttime
) );
660 regval_ctr_addvalue( val
, "UntilTime", REG_DWORD
, (char*)&info2
->untiltime
, sizeof(info2
->untiltime
) );
662 /* strip the \\server\ from this string */
663 if ( !(p
= strrchr( info2
->printername
, '\\' ) ) )
664 p
= info2
->printername
;
667 init_unistr2( &data
, p
, UNI_STR_TERMINATE
);
668 regval_ctr_addvalue( val
, "Name", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
670 init_unistr2( &data
, info2
->location
, UNI_STR_TERMINATE
);
671 regval_ctr_addvalue( val
, "Location", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
673 init_unistr2( &data
, info2
->comment
, UNI_STR_TERMINATE
);
674 regval_ctr_addvalue( val
, "Description", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
676 init_unistr2( &data
, info2
->parameters
, UNI_STR_TERMINATE
);
677 regval_ctr_addvalue( val
, "Parameters", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
679 init_unistr2( &data
, info2
->portname
, UNI_STR_TERMINATE
);
680 regval_ctr_addvalue( val
, "Port", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
682 init_unistr2( &data
, info2
->sharename
, UNI_STR_TERMINATE
);
683 regval_ctr_addvalue( val
, "Share Name", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
685 init_unistr2( &data
, info2
->drivername
, UNI_STR_TERMINATE
);
686 regval_ctr_addvalue( val
, "Printer Driver", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
688 init_unistr2( &data
, info2
->sepfile
, UNI_STR_TERMINATE
);
689 regval_ctr_addvalue( val
, "Separator File", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
691 init_unistr2( &data
, "WinPrint", UNI_STR_TERMINATE
);
692 regval_ctr_addvalue( val
, "Print Processor", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
694 init_unistr2( &data
, "RAW", UNI_STR_TERMINATE
);
695 regval_ctr_addvalue( val
, "Datatype", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
698 /* use a prs_struct for converting the devmode and security
699 descriptor to REG_BINARY */
701 prs_init( &prs
, MAX_PDU_FRAG_LEN
, regval_ctr_getctx(val
), MARSHALL
);
703 /* stream the device mode */
705 snum
= lp_servicenumber(info2
->sharename
);
706 if ( (devmode
= construct_dev_mode( snum
)) != NULL
)
708 if ( spoolss_io_devmode( "devmode", &prs
, 0, devmode
) ) {
710 offset
= prs_offset( &prs
);
712 regval_ctr_addvalue( val
, "Default Devmode", REG_BINARY
, prs_data_p(&prs
), offset
);
718 prs_mem_clear( &prs
);
719 prs_set_offset( &prs
, 0 );
721 if ( info2
->secdesc_buf
&& info2
->secdesc_buf
->len
)
723 if ( sec_io_desc("sec_desc", &info2
->secdesc_buf
->sec
, &prs
, 0 ) ) {
725 offset
= prs_offset( &prs
);
727 regval_ctr_addvalue( val
, "Security", REG_BINARY
, prs_data_p(&prs
), offset
);
731 prs_mem_free( &prs
);
733 num_values
= regval_ctr_numvals( val
);
739 /* now enumerate the key */
741 if ( !W_ERROR_IS_OK( get_a_printer(NULL
, &printer
, 2, printername
) ) )
744 /* iterate over all printer data and fill the regval container */
746 p_data
= &printer
->info_2
->data
;
747 if ( (key_index
= lookup_printerkey( p_data
, new_path
)) == -1 ) {
748 DEBUG(10,("print_subpath_values_printer: Unknown keyname [%s]\n", new_path
));
752 num_values
= regval_ctr_numvals( &p_data
->keys
[key_index
].values
);
754 for ( i
=0; i
<num_values
; i
++ )
755 regval_ctr_copyvalue( val
, regval_ctr_specific_value(&p_data
->keys
[key_index
].values
, i
) );
760 free_a_printer( &printer
, 2 );
767 /**********************************************************************
768 Routine to handle enumeration of subkeys and values
769 below KEY_PRINTING (depending on whether or not subkeys/val are
771 *********************************************************************/
773 static int handle_printing_subpath( char *key
, REGSUBKEY_CTR
*subkeys
, REGVAL_CTR
*val
)
779 DEBUG(10,("handle_printing_subpath: key=>[%s]\n", key
));
782 * break off the first part of the path
783 * topmost base **must** be one of the strings
784 * in top_level_keys[]
787 reg_split_path( key
, &base
, &p
);
789 for ( i
=0; i
<MAX_TOP_LEVEL_KEYS
; i
++ ) {
790 if ( StrCaseCmp( top_level_keys
[i
], base
) == 0 )
794 DEBUG(10,("handle_printing_subpath: base=>[%s], i==[%d]\n", base
, i
));
796 if ( !(i
< MAX_TOP_LEVEL_KEYS
) )
799 /* Call routine to handle each top level key */
802 case KEY_INDEX_ENVIR
:
804 print_subpath_environments( p
, subkeys
);
806 print_subpath_values_environments( p
, val
);
809 case KEY_INDEX_FORMS
:
811 print_subpath_forms( p
, subkeys
);
813 print_subpath_values_forms( p
, val
);
816 case KEY_INDEX_PRINTER
:
818 print_subpath_printers( p
, subkeys
);
820 print_subpath_values_printers( p
, val
);
823 /* default case for top level key that has no handler */
835 /**********************************************************************
836 Enumerate registry subkey names given a registry path.
837 Caller is responsible for freeing memory to **subkeys
838 *********************************************************************/
840 static int printing_subkey_info( const char *key
, REGSUBKEY_CTR
*subkey_ctr
)
845 DEBUG(10,("printing_subkey_info: key=>[%s]\n", key
));
847 path
= trim_reg_path( key
);
849 /* check to see if we are dealing with the top level key */
852 num_subkeys
= handle_printing_subpath( path
, subkey_ctr
, NULL
);
857 /* handle top level keys here */
859 if ( strequal( KEY_PRINTING
, key
) ) {
860 regsubkey_ctr_addkey( subkey_ctr
, "Environments" );
861 regsubkey_ctr_addkey( subkey_ctr
, "Forms" );
863 else if ( strequal( KEY_PRINTING_2K
, key
) ) {
864 regsubkey_ctr_addkey( subkey_ctr
, "Printers" );
870 /**********************************************************************
871 Enumerate registry values given a registry path.
872 Caller is responsible for freeing memory
873 *********************************************************************/
875 static int printing_value_info( const char *key
, REGVAL_CTR
*val
)
880 DEBUG(10,("printing_value_info: key=>[%s]\n", key
));
882 path
= trim_reg_path( key
);
885 num_values
= handle_printing_subpath( path
, NULL
, val
);
892 if ( strequal( key
, KEY_PRINTING_PORTS
) )
893 num_values
= fill_ports_values( val
);
898 /**********************************************************************
899 Stub function which always returns failure since we don't want
900 people storing printing information directly via regostry calls
902 *********************************************************************/
904 static BOOL
printing_store_subkey( const char *key
, REGSUBKEY_CTR
*subkeys
)
909 /**********************************************************************
910 Stub function which always returns failure since we don't want
911 people storing printing information directly via regostry calls
913 *********************************************************************/
915 static BOOL
printing_store_value( const char *key
, REGVAL_CTR
*val
)
921 * Table of function pointers for accessing printing data
924 REGISTRY_OPS printing_ops
= {
925 printing_subkey_info
,
927 printing_store_subkey
,
928 printing_store_value
,