[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-test-1560-ge327953

Michael Adam obnox at samba.org
Sun Jan 20 02:56:06 GMT 2008


The branch, v3-2-test has been updated
       via  e327953bd6b11aeb6f2ae48b49550a942eae8e88 (commit)
       via  c3fba415951329ee90c7250b4e8d539f91b227f6 (commit)
       via  d2e3814db8a4a5f0fc097e9f56753888470ef213 (commit)
       via  2c650bf63ccd9dc5dddbf4700831489544ded055 (commit)
       via  faf406a4a1baf2946ea754a0760204748be99541 (commit)
       via  80024f4e1c6594c3038e86a765f763d24fd96b59 (commit)
       via  f245c4e094ad56080847e286c76976f29c95a221 (commit)
       via  8e8bb6ba120adf9942f612b7fd89bdbced6c1285 (commit)
       via  5b3813b233dc2a60e6d5a9942b4044219d800415 (commit)
       via  a8a743b693a162954948ca2438ce4b842c5cba30 (commit)
       via  347b9886547516bc2a43190ae7faaf349d2c9d04 (commit)
       via  d9b89e9d30702f64805b3a3a3612066b19c051d1 (commit)
      from  24f13fb72e4cbaba48235fa840b2a93bf1c5d9c3 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit e327953bd6b11aeb6f2ae48b49550a942eae8e88
Author: Michael Adam <obnox at samba.org>
Date:   Sun Jan 20 03:45:40 2008 +0100

    Remove the dynamic registry overlay.
    
    It is unnecessary now the dynamic functions have been made
    registry backends of their own.
    
    Michael

commit c3fba415951329ee90c7250b4e8d539f91b227f6
Author: Michael Adam <obnox at samba.org>
Date:   Sun Jan 20 03:39:27 2008 +0100

    Add a registry backend perflib that replaces the former dynamic overlay.
    
    Michael

commit d2e3814db8a4a5f0fc097e9f56753888470ef213
Author: Michael Adam <obnox at samba.org>
Date:   Sun Jan 20 03:25:54 2008 +0100

    Some reformatting of current_version_fetch_values().
    
    Michael

commit 2c650bf63ccd9dc5dddbf4700831489544ded055
Author: Michael Adam <obnox at samba.org>
Date:   Sun Jan 20 03:24:13 2008 +0100

    Add a registry backend current_version that replaces the former dynamic overlay.
    
    Make sure to only respond to the exact current version key since subkeys
    are registered by other backends (printing and - soon - perflib).
    
    Michael

commit faf406a4a1baf2946ea754a0760204748be99541
Author: Michael Adam <obnox at samba.org>
Date:   Sun Jan 20 02:23:00 2008 +0100

    Reorder the registry key name constants in a more systematic way.
    
    Michael

commit 80024f4e1c6594c3038e86a765f763d24fd96b59
Author: Michael Adam <obnox at samba.org>
Date:   Sun Jan 20 01:09:52 2008 +0100

    Use some consts instead of literal strings for registry keys.
    
    Michael

commit f245c4e094ad56080847e286c76976f29c95a221
Author: Michael Adam <obnox at samba.org>
Date:   Sun Jan 20 01:15:31 2008 +0100

    Some reformatting in hkpt_params_fetch_values().
    
    Michael

commit 8e8bb6ba120adf9942f612b7fd89bdbced6c1285
Author: Michael Adam <obnox at samba.org>
Date:   Sun Jan 20 01:00:14 2008 +0100

    Add a registry backend hkpt_params that replaces the former dynamic overlay.
    
    Michael

commit 5b3813b233dc2a60e6d5a9942b4044219d800415
Author: Michael Adam <obnox at samba.org>
Date:   Sun Jan 20 01:21:45 2008 +0100

    Some reformatting in tcpip_params_fetch_values().
    
    Michael

commit a8a743b693a162954948ca2438ce4b842c5cba30
Author: Michael Adam <obnox at samba.org>
Date:   Sat Jan 19 23:46:13 2008 +0100

    Add a registry backend tcpip_params that replaces the former dynamic overlay.
    
    Michael

commit 347b9886547516bc2a43190ae7faaf349d2c9d04
Author: Michael Adam <obnox at samba.org>
Date:   Sun Jan 20 01:25:08 2008 +0100

    Some reformatting in prod_options_fetch_values().
    
    Michael

commit d9b89e9d30702f64805b3a3a3612066b19c051d1
Author: Michael Adam <obnox at samba.org>
Date:   Fri Jan 18 16:15:43 2008 +0100

    Add a registry backend prod_options that replaces the former dynamic overlay.
    
    Michael

-----------------------------------------------------------------------

Summary of changes:
 source/Makefile.in                            |    8 +-
 source/include/reg_objects.h                  |   11 +-
 source/registry/reg_backend_current_version.c |   81 ++++++++
 source/registry/reg_backend_hkpt_params.c     |   70 +++++++
 source/registry/reg_backend_perflib.c         |  106 +++++++++++
 source/registry/reg_backend_prod_options.c    |   70 +++++++
 source/registry/reg_backend_tcpip_params.c    |   67 +++++++
 source/registry/reg_db.c                      |   16 +-
 source/registry/reg_dynamic.c                 |  247 -------------------------
 source/registry/reg_frontend.c                |   10 +
 source/registry/reg_frontend_hilvl.c          |   11 -
 11 files changed, 426 insertions(+), 271 deletions(-)
 create mode 100644 source/registry/reg_backend_current_version.c
 create mode 100644 source/registry/reg_backend_hkpt_params.c
 create mode 100644 source/registry/reg_backend_perflib.c
 create mode 100644 source/registry/reg_backend_prod_options.c
 create mode 100644 source/registry/reg_backend_tcpip_params.c
 delete mode 100644 source/registry/reg_dynamic.c


Changeset truncated at 500 lines:

diff --git a/source/Makefile.in b/source/Makefile.in
index ea5e5a8..b32fc2f 100644
--- a/source/Makefile.in
+++ b/source/Makefile.in
@@ -415,10 +415,15 @@ REGOBJS_OBJ = registry/reg_objects.o
 
 REGISTRY_OBJ = registry/reg_frontend.o registry/reg_cachehook.o registry/reg_printing.o \
                registry/reg_db.o registry/reg_eventlog.o registry/reg_shares.o \
-               registry/reg_util.o registry/reg_dynamic.o registry/reg_perfcount.o \
+               registry/reg_util.o registry/reg_perfcount.o \
 	       registry/reg_smbconf.o registry/reg_api.o \
 	       registry/reg_frontend_hilvl.o \
 	       registry/reg_backend_netlogon_params.o \
+	       registry/reg_backend_prod_options.o \
+	       registry/reg_backend_tcpip_params.o \
+	       registry/reg_backend_hkpt_params.o \
+	       registry/reg_backend_current_version.o \
+	       registry/reg_backend_perflib.o \
 	       $(UTIL_REG_API_OBJ) $(UTIL_REG_SMBCONF_OBJ)
 
 RPC_LSA_OBJ = rpc_server/srv_lsa.o rpc_server/srv_lsa_nt.o librpc/gen_ndr/srv_lsa.o
@@ -736,7 +741,6 @@ REG_API_OBJ = registry/reg_api.o \
 	      registry/reg_cachehook.o \
 	      registry/reg_eventlog.o \
 	      registry/reg_perfcount.o \
-	      registry/reg_dynamic.o \
 	      \
 	      lib/util_nttoken.o \
 	      $(UTIL_REG_API_OBJ) \
diff --git a/source/include/reg_objects.h b/source/include/reg_objects.h
index 3b846db..3df701f 100644
--- a/source/include/reg_objects.h
+++ b/source/include/reg_objects.h
@@ -94,13 +94,18 @@ typedef struct {
 #define KEY_HKCU		"HKCU"
 #define KEY_HKDD		"HKDD"
 #define KEY_SERVICES		"HKLM\\SYSTEM\\CurrentControlSet\\Services"
+#define KEY_EVENTLOG 		"HKLM\\SYSTEM\\CurrentControlSet\\Services\\Eventlog"
+#define KEY_SHARES		"HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Shares"
+#define KEY_NETLOGON_PARAMS	"HKLM\\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters"
+#define KEY_TCPIP_PARAMS	"HKLM\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters"
+#define KEY_PROD_OPTIONS	"HKLM\\SYSTEM\\CurrentControlSet\\Control\\ProductOptions"
 #define KEY_PRINTING 		"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Print"
 #define KEY_PRINTING_2K		"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print\\Printers"
 #define KEY_PRINTING_PORTS	"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Ports"
-#define KEY_EVENTLOG 		"HKLM\\SYSTEM\\CurrentControlSet\\Services\\Eventlog"
-#define KEY_SHARES		"HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Shares"
+#define KEY_CURRENT_VERSION	"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"
+#define KEY_PERFLIB		"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib"
+#define KEY_PERFLIB_009		"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib\\009"
 #define KEY_SMBCONF		"HKLM\\SOFTWARE\\Samba\\smbconf"
-#define KEY_NETLOGON_PARAMS	"HKLM\\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters"
 #define KEY_TREE_ROOT		""
 
 /*
diff --git a/source/registry/reg_backend_current_version.c b/source/registry/reg_backend_current_version.c
new file mode 100644
index 0000000..a9d281c
--- /dev/null
+++ b/source/registry/reg_backend_current_version.c
@@ -0,0 +1,81 @@
+/*
+ *  Unix SMB/CIFS implementation.
+ *  Virtual Windows Registry Layer
+ *  Copyright (C) Gerald Carter     2002-2005
+ *  Copyright (C) Michael Adam      2008
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * CurrentVersion registry backend.
+ *
+ * This is a virtual overlay, dynamically presenting version information.
+ */
+
+#include "includes.h"
+
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_REGISTRY
+
+extern REGISTRY_OPS regdb_ops;
+
+#define KEY_CURRENT_VERSION_NORM "HKLM/SOFTWARE/MICROSOFT/WINDOWS NT/CURRENTVERSION"
+
+static int current_version_fetch_values(const char *key, REGVAL_CTR *values)
+{
+	const char *sysroot_string = "c:\\Windows";
+	fstring sysversion;
+	fstring value;
+	uint32 value_length;
+	char *path = NULL;
+	TALLOC_CTX *ctx = talloc_tos();
+
+	path = talloc_strdup(ctx, key);
+	if (path == NULL) {
+		return -1;
+	}
+	path = normalize_reg_path(ctx, path);
+	if (path == NULL) {
+		return -1;
+	}
+
+	if (strncmp(path, KEY_CURRENT_VERSION_NORM, strlen(path)) != 0) {
+		return 0;
+	}
+
+	value_length = push_ucs2(value, value, sysroot_string, sizeof(value),
+				 STR_TERMINATE|STR_NOALIGN );
+	regval_ctr_addvalue(values, "SystemRoot", REG_SZ, value, value_length);
+
+	fstr_sprintf(sysversion, "%d.%d", lp_major_announce_version(),
+		     lp_minor_announce_version());
+	value_length = push_ucs2(value, value, sysversion, sizeof(value),
+				 STR_TERMINATE|STR_NOALIGN);
+	regval_ctr_addvalue(values, "CurrentVersion", REG_SZ, value,
+			    value_length);
+
+	return regval_ctr_numvals(values);
+}
+
+static int current_version_fetch_subkeys(const char *key,
+					 REGSUBKEY_CTR *subkey_ctr)
+{
+	return regdb_ops.fetch_subkeys(key, subkey_ctr);
+}
+
+REGISTRY_OPS current_version_reg_ops = {
+	.fetch_values = current_version_fetch_values,
+	.fetch_subkeys = current_version_fetch_subkeys,
+};
diff --git a/source/registry/reg_backend_hkpt_params.c b/source/registry/reg_backend_hkpt_params.c
new file mode 100644
index 0000000..2ed5e78
--- /dev/null
+++ b/source/registry/reg_backend_hkpt_params.c
@@ -0,0 +1,70 @@
+/*
+ *  Unix SMB/CIFS implementation.
+ *  Virtual Windows Registry Layer
+ *  Copyright (C) Gerald Carter     2002-2005
+ *  Copyright (C) Michael Adam      2008
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * HKPT parameters registry backend.
+ *
+ * This replaces the former dynamic hkpt parameters overlay.
+ */
+
+#include "includes.h"
+
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_REGISTRY
+
+extern REGISTRY_OPS regdb_ops;
+
+static int hkpt_params_fetch_values(const char *key, REGVAL_CTR *regvals)
+{
+	uint32 base_index;
+	uint32 buffer_size;
+	char *buffer = NULL;
+
+	/* This is ALMOST the same as perflib_009_params, but HKPT has
+	   a "Counters" entry instead of a "Counter" key. <Grrrr> */
+
+	base_index = reg_perfcount_get_base_index();
+	buffer_size = reg_perfcount_get_counter_names(base_index, &buffer);
+	regval_ctr_addvalue(regvals, "Counters", REG_MULTI_SZ, buffer,
+			    buffer_size);
+
+	if(buffer_size > 0) {
+		SAFE_FREE(buffer);
+	}
+
+	buffer_size = reg_perfcount_get_counter_help(base_index, &buffer);
+	regval_ctr_addvalue(regvals, "Help", REG_MULTI_SZ, buffer, buffer_size);
+	if(buffer_size > 0) {
+		SAFE_FREE(buffer);
+	}
+
+	return regval_ctr_numvals( regvals );
+}
+
+static int hkpt_params_fetch_subkeys(const char *key,
+					 REGSUBKEY_CTR *subkey_ctr)
+{
+	return regdb_ops.fetch_subkeys(key, subkey_ctr);
+}
+
+REGISTRY_OPS hkpt_params_reg_ops = {
+	.fetch_values = hkpt_params_fetch_values,
+	.fetch_subkeys = hkpt_params_fetch_subkeys,
+};
diff --git a/source/registry/reg_backend_perflib.c b/source/registry/reg_backend_perflib.c
new file mode 100644
index 0000000..999bca2
--- /dev/null
+++ b/source/registry/reg_backend_perflib.c
@@ -0,0 +1,106 @@
+/*
+ *  Unix SMB/CIFS implementation.
+ *  Virtual Windows Registry Layer
+ *  Copyright (C) Gerald Carter     2002-2005
+ *  Copyright (C) Michael Adam      2008
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * perflib registry backend.
+ *
+ * This is a virtual overlay, dynamically presenting perflib values.
+ */
+
+#include "includes.h"
+
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_REGISTRY
+
+extern REGISTRY_OPS regdb_ops;
+
+#define KEY_PERFLIB_NORM	"HKLM/SOFTWARE/MICROSOFT/WINDOWS NT/CURRENTVERSION/PERFLIB"
+#define KEY_PERFLIB_009_NORM	"HKLM/SOFTWARE/MICROSOFT/WINDOWS NT/CURRENTVERSION/PERFLIB/009"
+
+static int perflib_params( REGVAL_CTR *regvals )
+{
+	int base_index = -1;
+	int last_counter = -1;
+	int last_help = -1;
+	int version = 0x00010001;
+	
+	base_index = reg_perfcount_get_base_index();
+	regval_ctr_addvalue(regvals, "Base Index", REG_DWORD, (char *)&base_index, sizeof(base_index));
+	last_counter = reg_perfcount_get_last_counter(base_index);
+	regval_ctr_addvalue(regvals, "Last Counter", REG_DWORD, (char *)&last_counter, sizeof(last_counter));
+	last_help = reg_perfcount_get_last_help(last_counter);
+	regval_ctr_addvalue(regvals, "Last Help", REG_DWORD, (char *)&last_help, sizeof(last_help));
+	regval_ctr_addvalue(regvals, "Version", REG_DWORD, (char *)&version, sizeof(version));
+
+	return regval_ctr_numvals( regvals );
+}
+
+static int perflib_009_params( REGVAL_CTR *regvals )
+{
+	int base_index;
+	int buffer_size;
+	char *buffer = NULL;
+
+	base_index = reg_perfcount_get_base_index();
+	buffer_size = reg_perfcount_get_counter_names(base_index, &buffer);
+	regval_ctr_addvalue(regvals, "Counter", REG_MULTI_SZ, buffer, buffer_size);
+	if(buffer_size > 0)
+		SAFE_FREE(buffer);
+	buffer_size = reg_perfcount_get_counter_help(base_index, &buffer);
+	regval_ctr_addvalue(regvals, "Help", REG_MULTI_SZ, buffer, buffer_size);
+	if(buffer_size > 0)
+		SAFE_FREE(buffer);
+	
+	return regval_ctr_numvals( regvals );
+}
+
+static int perflib_fetch_values(const char *key, REGVAL_CTR *regvals)
+{
+	char *path = NULL;
+	TALLOC_CTX *ctx = talloc_tos();
+
+	path = talloc_strdup(ctx, key);
+	if (path == NULL) {
+		return -1;
+	}
+	path = normalize_reg_path(ctx, path);
+	if (path == NULL) {
+		return -1;
+	}
+
+	if (strncmp(path, KEY_PERFLIB_NORM, strlen(path)) == 0) {
+		return perflib_params(regvals);
+	} else if (strncmp(path, KEY_PERFLIB_009_NORM, strlen(path)) == 0) {
+		return perflib_009_params(regvals);
+	} else {
+		return 0;
+	}
+}
+
+static int perflib_fetch_subkeys(const char *key,
+					 REGSUBKEY_CTR *subkey_ctr)
+{
+	return regdb_ops.fetch_subkeys(key, subkey_ctr);
+}
+
+REGISTRY_OPS perflib_reg_ops = {
+	.fetch_values = perflib_fetch_values,
+	.fetch_subkeys = perflib_fetch_subkeys,
+};
diff --git a/source/registry/reg_backend_prod_options.c b/source/registry/reg_backend_prod_options.c
new file mode 100644
index 0000000..7ac5c5b
--- /dev/null
+++ b/source/registry/reg_backend_prod_options.c
@@ -0,0 +1,70 @@
+/*
+ *  Unix SMB/CIFS implementation.
+ *  Virtual Windows Registry Layer
+ *  Copyright (C) Gerald Carter     2002-2005
+ *  Copyright (C) Michael Adam      2008
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Product options registry backend.
+ *
+ * This replaces the former dynamic product options overlay.
+ */
+
+#include "includes.h"
+
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_REGISTRY
+
+extern REGISTRY_OPS regdb_ops;
+
+static int prod_options_fetch_values(const char *key, REGVAL_CTR *regvals)
+{
+	const char *value_ascii = "";
+	fstring value;
+	int value_length;
+
+	switch (lp_server_role()) {
+		case ROLE_DOMAIN_PDC:
+		case ROLE_DOMAIN_BDC:
+			value_ascii = "LanmanNT";
+			break;
+		case ROLE_STANDALONE:
+			value_ascii = "ServerNT";
+			break;
+		case ROLE_DOMAIN_MEMBER:
+			value_ascii = "WinNT";
+			break;
+	}
+
+	value_length = push_ucs2(value, value, value_ascii, sizeof(value),
+				 STR_TERMINATE|STR_NOALIGN );
+	regval_ctr_addvalue(regvals, "ProductType", REG_SZ, value,
+			    value_length);
+
+	return regval_ctr_numvals( regvals );
+}
+
+static int prod_options_fetch_subkeys(const char *key,
+				      REGSUBKEY_CTR *subkey_ctr)
+{
+	return regdb_ops.fetch_subkeys(key, subkey_ctr);
+}
+
+REGISTRY_OPS prod_options_reg_ops = {
+	.fetch_values = prod_options_fetch_values,
+	.fetch_subkeys = prod_options_fetch_subkeys,
+};
diff --git a/source/registry/reg_backend_tcpip_params.c b/source/registry/reg_backend_tcpip_params.c
new file mode 100644
index 0000000..db7df5d
--- /dev/null
+++ b/source/registry/reg_backend_tcpip_params.c
@@ -0,0 +1,67 @@
+/*
+ *  Unix SMB/CIFS implementation.
+ *  Virtual Windows Registry Layer
+ *  Copyright (C) Gerald Carter     2002-2005
+ *  Copyright (C) Michael Adam      2008
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * TCP/IP parameters registry backend.
+ *
+ * This replaces the former dynamic tcpip parameters overlay.
+ */
+
+#include "includes.h"
+
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_REGISTRY
+
+extern REGISTRY_OPS regdb_ops;
+
+static int tcpip_params_fetch_values(const char *key, REGVAL_CTR *regvals)
+{
+	fstring value;
+	int value_length;
+	char *hname;
+	char *mydomainname = NULL;
+
+	hname = myhostname();
+	value_length = push_ucs2(value, value, hname, sizeof(value),
+				 STR_TERMINATE|STR_NOALIGN);
+	regval_ctr_addvalue(regvals, "Hostname",REG_SZ, value, value_length);
+
+	mydomainname = get_mydnsdomname(talloc_tos());
+	if (!mydomainname) {
+		return -1;
+	}
+
+	value_length = push_ucs2(value, value, mydomainname, sizeof(value),
+				 STR_TERMINATE|STR_NOALIGN);
+	regval_ctr_addvalue(regvals, "Domain", REG_SZ, value, value_length);
+
+	return regval_ctr_numvals(regvals);
+}
+
+static int tcpip_params_fetch_subkeys(const char *key,
+					 REGSUBKEY_CTR *subkey_ctr)
+{
+	return regdb_ops.fetch_subkeys(key, subkey_ctr);
+}
+
+REGISTRY_OPS tcpip_params_reg_ops = {
+	.fetch_values = tcpip_params_fetch_values,
+	.fetch_subkeys = tcpip_params_fetch_subkeys,
+};
diff --git a/source/registry/reg_db.c b/source/registry/reg_db.c
index 1b95c25..e162fb5 100644
--- a/source/registry/reg_db.c
+++ b/source/registry/reg_db.c
@@ -44,17 +44,17 @@ static const char *builtin_registry_paths[] = {
 	KEY_SHARES,
 	KEY_EVENTLOG,
 	KEY_SMBCONF,
-	"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib",
-	"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib\\009",
+	KEY_PERFLIB,
+	KEY_PERFLIB_009,
 	"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Print\\Monitors",
-	"HKLM\\SYSTEM\\CurrentControlSet\\Control\\ProductOptions",
+	KEY_PROD_OPTIONS,
 	"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration",
-	"HKLM\\SYSTEM\\CurrentControlSet\\Services\\TcpIp\\Parameters",
+	KEY_TCPIP_PARAMS,
 	KEY_NETLOGON_PARAMS,
-	"HKU",
-	"HKCR",


-- 
Samba Shared Repository


More information about the samba-cvs mailing list