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
] = {
43 /**********************************************************************
44 It is safe to assume that every registry path passed into on of
45 the exported functions here begins with KEY_PRINTING else
46 these functions would have never been called. This is a small utility
47 function to strip the beginning of the path and make a copy that the
48 caller can modify. Note that the caller is responsible for releasing
49 the memory allocated here.
50 **********************************************************************/
52 static char* trim_reg_path( char *path
)
55 uint16 key_len
= strlen(path
);
58 int key_printing_len
= strlen( KEY_PRINTING
);
59 int key_printing2k_len
= strlen( KEY_PRINTING_2K
);
60 int key_printing_ports_len
= strlen( KEY_PRINTING_PORTS
);
65 * sanity check...this really should never be True.
66 * It is only here to prevent us from accessing outside
67 * the path buffer in the extreme case.
70 if ( (key_len
< key_printing_len
)
71 && (key_len
< key_printing2k_len
)
72 && (key_len
< key_printing_ports_len
) )
74 DEBUG(0,("trim_reg_path: Registry path too short! [%s]\n", path
));
79 if ( StrnCaseCmp( KEY_PRINTING
, path
, key_printing_len
) == 0 ) {
80 base_key_len
= key_printing_len
;
82 else if ( StrnCaseCmp( KEY_PRINTING_2K
, path
, key_printing2k_len
) == 0 ) {
83 base_key_len
= key_printing2k_len
;
85 else if ( StrnCaseCmp( KEY_PRINTING_PORTS
, path
, key_printing2k_len
) == 0 ) {
86 base_key_len
= key_printing_ports_len
;
89 DEBUG(0,("trim_reg_path: invalid path [%s]\n", path
));
93 p
= path
+ base_key_len
;
104 /**********************************************************************
105 *********************************************************************/
107 static int fill_ports_values( REGVAL_CTR
*values
)
114 result
= enumports_hook( &numlines
, &lines
);
116 if ( !W_ERROR_IS_OK(result
) )
119 init_unistr2( &data
, "", UNI_STR_TERMINATE
);
120 for ( i
=0; i
<numlines
; i
++ )
121 regval_ctr_addvalue( values
, lines
[i
], REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
127 /**********************************************************************
128 handle enumeration of subkeys below KEY_PRINTING\Environments
129 Environments\$ARCH\Print Processors
130 Environments\$ARCH\Drivers\{0,2,3}
131 *********************************************************************/
133 #define ENVIRONMENT_DRIVERS 1
134 #define ENVIRONMENT_PRINTPROC 2
136 static int print_subpath_environments( char *key
, REGSUBKEY_CTR
*subkeys
)
138 const char *environments
[] = {
142 "Windows NT Alpha_AXP",
143 "Windows NT PowerPC",
147 fstring
*drivers
= NULL
;
148 int i
, env_index
, num_drivers
;
149 char *keystr
, *base
, *subkeypath
;
151 int num_subkeys
= -1;
152 int env_subkey_type
= 0;
155 DEBUG(10,("print_subpath_environments: key=>[%s]\n", key
? key
: "NULL" ));
157 /* list all possible architectures */
160 for ( num_subkeys
=0; environments
[num_subkeys
]; num_subkeys
++ )
161 regsubkey_ctr_addkey( subkeys
, environments
[num_subkeys
] );
166 /* we are dealing with a subkey of "Environments */
168 pstrcpy( key2
, key
);
170 reg_split_path( keystr
, &base
, &subkeypath
);
174 for ( env_index
=0; environments
[env_index
]; env_index
++ ) {
175 if ( strequal( environments
[env_index
], base
) )
178 if ( !environments
[env_index
] )
181 /* ...\Print\Environements\...\ */
184 regsubkey_ctr_addkey( subkeys
, "Drivers" );
185 regsubkey_ctr_addkey( subkeys
, "Print Processors" );
190 /* more of the key path to process */
193 reg_split_path( keystr
, &base
, &subkeypath
);
195 /* ...\Print\Environements\...\Drivers\ */
197 if ( strequal(base
, "Drivers") )
198 env_subkey_type
= ENVIRONMENT_DRIVERS
;
199 else if ( strequal(base
, "Print Processors") )
200 env_subkey_type
= ENVIRONMENT_PRINTPROC
;
206 switch ( env_subkey_type
) {
207 case ENVIRONMENT_DRIVERS
:
208 switch ( env_index
) {
210 regsubkey_ctr_addkey( subkeys
, "Version-0" );
212 default: /* Windows NT based systems */
213 regsubkey_ctr_addkey( subkeys
, "Version-2" );
214 regsubkey_ctr_addkey( subkeys
, "Version-3" );
218 return regsubkey_ctr_numkeys( subkeys
);
220 case ENVIRONMENT_PRINTPROC
:
221 if ( env_index
== 1 || env_index
== 5 || env_index
== 6 )
222 regsubkey_ctr_addkey( subkeys
, "winprint" );
224 return regsubkey_ctr_numkeys( subkeys
);
228 /* we finally get to enumerate the drivers */
231 reg_split_path( keystr
, &base
, &subkeypath
);
233 /* get thr print processors key out of the way */
234 if ( env_subkey_type
== ENVIRONMENT_PRINTPROC
) {
235 if ( !strequal( base
, "winprint" ) )
237 return !subkeypath
? 0 : -1;
240 /* only dealing with drivers from here on out */
242 version
= atoi(&base
[strlen(base
)-1]);
250 if ( version
!= 2 && version
!= 3 )
257 num_drivers
= get_ntdrivers( &drivers
, environments
[env_index
], version
);
258 for ( i
=0; i
<num_drivers
; i
++ )
259 regsubkey_ctr_addkey( subkeys
, drivers
[i
] );
261 return regsubkey_ctr_numkeys( subkeys
);
264 /* if anything else left, just say if has no subkeys */
266 DEBUG(1,("print_subpath_environments: unhandled key [%s] (subkey == %s\n",
272 /***********************************************************************
273 simple function to prune a pathname down to the basename of a file
274 **********************************************************************/
276 static char* dos_basename ( char *path
)
280 p
= strrchr( path
, '\\' );
289 /**********************************************************************
290 handle enumeration of values below
291 KEY_PRINTING\Environments\<arch>\<version>\<drivername>
292 *********************************************************************/
294 static int print_subpath_values_environments( char *key
, REGVAL_CTR
*val
)
296 char *keystr
, *base
, *subkeypath
;
298 fstring arch_environment
;
301 NT_PRINTER_DRIVER_INFO_LEVEL driver_ctr
;
302 NT_PRINTER_DRIVER_INFO_LEVEL_3
*info3
;
305 char *buffer2
= NULL
;
310 int env_subkey_type
= 0;
313 DEBUG(8,("print_subpath_values_environments: Enter key => [%s]\n", key
? key
: "NULL"));
318 /* The only keys below KEY_PRINTING\Environments is the
319 specific printer driver info */
323 pstrcpy( key2
, key
);
325 reg_split_path( keystr
, &base
, &subkeypath
);
328 fstrcpy( arch_environment
, base
);
333 reg_split_path( keystr
, &base
, &subkeypath
);
335 if ( strequal(base
, "Drivers") )
336 env_subkey_type
= ENVIRONMENT_DRIVERS
;
337 else if ( strequal(base
, "Print Processors") )
338 env_subkey_type
= ENVIRONMENT_PRINTPROC
;
346 /* for now bail out if we are seeing anything other than the drivers key */
348 if ( env_subkey_type
== ENVIRONMENT_PRINTPROC
)
352 reg_split_path( keystr
, &base
, &subkeypath
);
354 version
= atoi(&base
[strlen(base
)-1]);
356 /* printer driver name */
359 reg_split_path( keystr
, &base
, &subkeypath
);
360 /* don't go any deeper for now */
363 fstrcpy( driver
, base
);
365 w_result
= get_a_printer_driver( &driver_ctr
, 3, driver
, arch_environment
, version
);
367 if ( !W_ERROR_IS_OK(w_result
) )
370 /* build the values out of the driver information */
371 info3
= driver_ctr
.info_3
;
373 filename
= dos_basename( info3
->driverpath
);
374 init_unistr2( &data
, filename
, UNI_STR_TERMINATE
);
375 regval_ctr_addvalue( val
, "Driver", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
377 filename
= dos_basename( info3
->configfile
);
378 init_unistr2( &data
, filename
, UNI_STR_TERMINATE
);
379 regval_ctr_addvalue( val
, "Configuration File", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
381 filename
= dos_basename( info3
->datafile
);
382 init_unistr2( &data
, filename
, UNI_STR_TERMINATE
);
383 regval_ctr_addvalue( val
, "Data File", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
385 filename
= dos_basename( info3
->helpfile
);
386 init_unistr2( &data
, filename
, UNI_STR_TERMINATE
);
387 regval_ctr_addvalue( val
, "Help File", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
389 init_unistr2( &data
, info3
->defaultdatatype
, UNI_STR_TERMINATE
);
390 regval_ctr_addvalue( val
, "Data Type", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
392 regval_ctr_addvalue( val
, "Version", REG_DWORD
, (char*)&info3
->cversion
, sizeof(info3
->cversion
) );
394 if ( info3
->dependentfiles
) {
395 /* place the list of dependent files in a single
396 character buffer, separating each file name by
399 for ( i
=0; strcmp(info3
->dependentfiles
[i
], ""); i
++ ) {
400 /* strip the path to only the file's base name */
402 filename
= dos_basename( info3
->dependentfiles
[i
] );
404 length
= strlen(filename
);
406 buffer2
= SMB_REALLOC( buffer
, buffer_size
+ (length
+ 1)*sizeof(uint16
) );
411 init_unistr2( &data
, filename
, UNI_STR_TERMINATE
);
412 memcpy( buffer
+buffer_size
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
414 buffer_size
+= (length
+ 1)*sizeof(uint16
);
417 /* terminated by double NULL. Add the final one here */
419 buffer2
= SMB_REALLOC( buffer
, buffer_size
+ 2 );
425 buffer
[buffer_size
++] = '\0';
426 buffer
[buffer_size
++] = '\0';
430 regval_ctr_addvalue( val
, "Dependent Files", REG_MULTI_SZ
, buffer
, buffer_size
);
432 free_a_printer_driver( driver_ctr
, 3 );
436 DEBUG(8,("print_subpath_values_environments: Exit\n"));
438 return regval_ctr_numvals( val
);
442 /**********************************************************************
443 handle enumeration of subkeys below KEY_PRINTING\Forms
444 Really just a stub function, but left here in case it needs to
446 *********************************************************************/
448 static int print_subpath_forms( char *key
, REGSUBKEY_CTR
*subkeys
)
450 DEBUG(10,("print_subpath_forms: key=>[%s]\n", key
? key
: "NULL" ));
452 /* there are no subkeys */
460 /**********************************************************************
461 handle enumeration of values below KEY_PRINTING\Forms
462 *********************************************************************/
464 static int print_subpath_values_forms( char *key
, REGVAL_CTR
*val
)
470 DEBUG(10,("print_values_forms: key=>[%s]\n", key
? key
: "NULL" ));
472 /* handle ..\Forms\ */
476 nt_forms_struct
*forms_list
= NULL
;
477 nt_forms_struct
*form
= NULL
;
480 if ( (num_values
= get_ntforms( &forms_list
)) == 0 )
483 DEBUG(10,("print_subpath_values_forms: [%d] user defined forms returned\n",
486 /* handle user defined forms */
488 for ( i
=0; i
<num_values
; i
++ )
490 form
= &forms_list
[i
];
492 data
[0] = form
->width
;
493 data
[1] = form
->length
;
494 data
[2] = form
->left
;
496 data
[4] = form
->right
;
497 data
[5] = form
->bottom
;
498 data
[6] = form_index
++;
499 data
[7] = form
->flag
;
501 regval_ctr_addvalue( val
, form
->name
, REG_BINARY
, (char*)data
, sizeof(data
) );
505 SAFE_FREE( forms_list
);
508 /* handle built-on forms */
510 if ( (num_values
= get_builtin_ntforms( &forms_list
)) == 0 )
513 DEBUG(10,("print_subpath_values_forms: [%d] built-in forms returned\n",
516 for ( i
=0; i
<num_values
; i
++ )
518 form
= &forms_list
[i
];
520 data
[0] = form
->width
;
521 data
[1] = form
->length
;
522 data
[2] = form
->left
;
524 data
[4] = form
->right
;
525 data
[5] = form
->bottom
;
526 data
[6] = form_index
++;
527 data
[7] = form
->flag
;
529 regval_ctr_addvalue( val
, form
->name
, REG_BINARY
, (char*)data
, sizeof(data
) );
532 SAFE_FREE( forms_list
);
538 /**********************************************************************
539 handle enumeration of subkeys below KEY_PRINTING\Printers
540 *********************************************************************/
542 static int print_subpath_printers( char *key
, REGSUBKEY_CTR
*subkeys
)
544 int n_services
= lp_numservices();
549 char *keystr
, *key2
= NULL
;
550 char *base
, *new_path
;
551 NT_PRINTER_INFO_LEVEL
*printer
= NULL
;
552 fstring
*subkey_names
= NULL
;
554 DEBUG(10,("print_subpath_printers: key=>[%s]\n", key
? key
: "NULL" ));
558 /* enumerate all printers */
560 for (snum
=0; snum
<n_services
; snum
++) {
561 if ( !(lp_snum_ok(snum
) && lp_print_ok(snum
) ) )
564 /* don't report the [printers] share */
566 if ( strequal( lp_servicename(snum
), PRINTERS_NAME
) )
569 fstrcpy( sname
, lp_servicename(snum
) );
571 regsubkey_ctr_addkey( subkeys
, sname
);
574 num_subkeys
= regsubkey_ctr_numkeys( subkeys
);
578 /* get information for a specific printer */
580 key2
= SMB_STRDUP( key
);
582 reg_split_path( keystr
, &base
, &new_path
);
584 if ( !W_ERROR_IS_OK( get_a_printer(NULL
, &printer
, 2, base
) ) )
587 num_subkeys
= get_printer_subkeys( &printer
->info_2
->data
, new_path
?new_path
:"", &subkey_names
);
589 for ( i
=0; i
<num_subkeys
; i
++ )
590 regsubkey_ctr_addkey( subkeys
, subkey_names
[i
] );
592 free_a_printer( &printer
, 2 );
594 /* no other subkeys below here */
598 SAFE_FREE( subkey_names
);
603 /**********************************************************************
604 handle enumeration of values below KEY_PRINTING\Printers
605 *********************************************************************/
607 static int print_subpath_values_printers( char *key
, REGVAL_CTR
*val
)
610 char *keystr
, *key2
= NULL
;
611 char *base
, *new_path
;
612 NT_PRINTER_INFO_LEVEL
*printer
= NULL
;
613 NT_PRINTER_INFO_LEVEL_2
*info2
;
619 NT_PRINTER_DATA
*p_data
;
624 * Theres are tw cases to deal with here
625 * (1) enumeration of printer_info_2 values
626 * (2) enumeration of the PrinterDriverData subney
630 /* top level key has no values */
634 key2
= SMB_STRDUP( key
);
636 reg_split_path( keystr
, &base
, &new_path
);
638 fstrcpy( printername
, base
);
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
) );
655 regval_ctr_addvalue( val
, "Status", REG_DWORD
, (char*)&info2
->status
, sizeof(info2
->status
) );
656 regval_ctr_addvalue( val
, "StartTime", REG_DWORD
, (char*)&info2
->starttime
, sizeof(info2
->starttime
) );
657 regval_ctr_addvalue( val
, "UntilTime", REG_DWORD
, (char*)&info2
->untiltime
, sizeof(info2
->untiltime
) );
659 /* strip the \\server\ from this string */
660 if ( !(p
= strrchr( info2
->printername
, '\\' ) ) )
661 p
= info2
->printername
;
664 init_unistr2( &data
, p
, UNI_STR_TERMINATE
);
665 regval_ctr_addvalue( val
, "Name", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
667 init_unistr2( &data
, info2
->location
, UNI_STR_TERMINATE
);
668 regval_ctr_addvalue( val
, "Location", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
670 init_unistr2( &data
, info2
->comment
, UNI_STR_TERMINATE
);
671 regval_ctr_addvalue( val
, "Description", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
673 init_unistr2( &data
, info2
->parameters
, UNI_STR_TERMINATE
);
674 regval_ctr_addvalue( val
, "Parameters", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
676 init_unistr2( &data
, info2
->portname
, UNI_STR_TERMINATE
);
677 regval_ctr_addvalue( val
, "Port", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
679 init_unistr2( &data
, info2
->sharename
, UNI_STR_TERMINATE
);
680 regval_ctr_addvalue( val
, "Share Name", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
682 init_unistr2( &data
, info2
->drivername
, UNI_STR_TERMINATE
);
683 regval_ctr_addvalue( val
, "Printer Driver", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
685 init_unistr2( &data
, info2
->sepfile
, UNI_STR_TERMINATE
);
686 regval_ctr_addvalue( val
, "Separator File", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
688 init_unistr2( &data
, "WinPrint", UNI_STR_TERMINATE
);
689 regval_ctr_addvalue( val
, "Print Processor", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
691 init_unistr2( &data
, "RAW", UNI_STR_TERMINATE
);
692 regval_ctr_addvalue( val
, "Datatype", REG_SZ
, (char*)data
.buffer
, data
.uni_str_len
*sizeof(uint16
) );
695 /* use a prs_struct for converting the devmode and security
696 descriptor to REG_BINARY */
698 prs_init( &prs
, MAX_PDU_FRAG_LEN
, regval_ctr_getctx(val
), MARSHALL
);
700 /* stream the device mode */
702 snum
= lp_servicenumber(info2
->sharename
);
703 if ( (devmode
= construct_dev_mode( snum
)) != NULL
)
705 if ( spoolss_io_devmode( "devmode", &prs
, 0, devmode
) ) {
707 offset
= prs_offset( &prs
);
709 regval_ctr_addvalue( val
, "Default Devmode", REG_BINARY
, prs_data_p(&prs
), offset
);
715 prs_mem_clear( &prs
);
716 prs_set_offset( &prs
, 0 );
718 if ( info2
->secdesc_buf
&& info2
->secdesc_buf
->len
)
720 if ( sec_io_desc("sec_desc", &info2
->secdesc_buf
->sec
, &prs
, 0 ) ) {
722 offset
= prs_offset( &prs
);
724 regval_ctr_addvalue( val
, "Security", REG_BINARY
, prs_data_p(&prs
), offset
);
728 prs_mem_free( &prs
);
730 num_values
= regval_ctr_numvals( val
);
736 /* now enumerate the key */
738 if ( !W_ERROR_IS_OK( get_a_printer(NULL
, &printer
, 2, printername
) ) )
741 /* iterate over all printer data and fill the regval container */
743 p_data
= &printer
->info_2
->data
;
744 if ( (key_index
= lookup_printerkey( p_data
, new_path
)) == -1 ) {
745 DEBUG(10,("print_subpath_values_printer: Unknown keyname [%s]\n", new_path
));
749 num_values
= regval_ctr_numvals( &p_data
->keys
[key_index
].values
);
751 for ( i
=0; i
<num_values
; i
++ )
752 regval_ctr_copyvalue( val
, regval_ctr_specific_value(&p_data
->keys
[key_index
].values
, i
) );
757 free_a_printer( &printer
, 2 );
764 /**********************************************************************
765 Routine to handle enumeration of subkeys and values
766 below KEY_PRINTING (depending on whether or not subkeys/val are
768 *********************************************************************/
770 static int handle_printing_subpath( char *key
, REGSUBKEY_CTR
*subkeys
, REGVAL_CTR
*val
)
776 DEBUG(10,("handle_printing_subpath: key=>[%s]\n", key
));
779 * break off the first part of the path
780 * topmost base **must** be one of the strings
781 * in top_level_keys[]
784 reg_split_path( key
, &base
, &p
);
786 for ( i
=0; i
<MAX_TOP_LEVEL_KEYS
; i
++ ) {
787 if ( StrCaseCmp( top_level_keys
[i
], base
) == 0 )
791 DEBUG(10,("handle_printing_subpath: base=>[%s], i==[%d]\n", base
, i
));
793 if ( !(i
< MAX_TOP_LEVEL_KEYS
) )
796 /* Call routine to handle each top level key */
799 case KEY_INDEX_ENVIR
:
801 print_subpath_environments( p
, subkeys
);
803 print_subpath_values_environments( p
, val
);
806 case KEY_INDEX_FORMS
:
808 print_subpath_forms( p
, subkeys
);
810 print_subpath_values_forms( p
, val
);
813 case KEY_INDEX_PRINTER
:
815 print_subpath_printers( p
, subkeys
);
817 print_subpath_values_printers( p
, val
);
820 /* default case for top level key that has no handler */
831 /**********************************************************************
832 Enumerate registry subkey names given a registry path.
833 Caller is responsible for freeing memory to **subkeys
834 *********************************************************************/
836 static int printing_subkey_info( char *key
, REGSUBKEY_CTR
*subkey_ctr
)
839 BOOL top_level
= False
;
842 DEBUG(10,("printing_subkey_info: key=>[%s]\n", key
));
844 path
= trim_reg_path( key
);
846 /* check to see if we are dealing with the top level key */
852 /* check between the two top level keys here */
854 if ( strequal( KEY_PRINTING
, key
) ) {
855 regsubkey_ctr_addkey( subkey_ctr
, "Environments" );
856 regsubkey_ctr_addkey( subkey_ctr
, "Forms" );
858 else if ( strequal( KEY_PRINTING_2K
, key
) ) {
859 regsubkey_ctr_addkey( subkey_ctr
, "Printers" );
863 num_subkeys
= handle_printing_subpath( path
, subkey_ctr
, NULL
);
870 /**********************************************************************
871 Enumerate registry values given a registry path.
872 Caller is responsible for freeing memory
873 *********************************************************************/
875 static int printing_value_info( char *key
, REGVAL_CTR
*val
)
878 BOOL top_level
= False
;
881 DEBUG(10,("printing_value_info: key=>[%s]\n", key
));
883 path
= trim_reg_path( key
);
885 /* check to see if we are dealing with the top level key */
890 /* fill in values from the getprinterdata_printer_server() */
892 if ( strequal( key
, KEY_PRINTING_PORTS
) )
893 num_values
= fill_ports_values( val
);
895 num_values
= handle_printing_subpath( path
, NULL
, val
);
901 /**********************************************************************
902 Stub function which always returns failure since we don't want
903 people storing printing information directly via regostry calls
905 *********************************************************************/
907 static BOOL
printing_store_subkey( char *key
, REGSUBKEY_CTR
*subkeys
)
912 /**********************************************************************
913 Stub function which always returns failure since we don't want
914 people storing printing information directly via regostry calls
916 *********************************************************************/
918 static BOOL
printing_store_value( char *key
, REGVAL_CTR
*val
)
924 * Table of function pointers for accessing printing data
927 REGISTRY_OPS printing_ops
= {
928 printing_subkey_info
,
930 printing_store_subkey
,