aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Innes1999-05-02 10:28:55 +0000
committerAndrew Innes1999-05-02 10:28:55 +0000
commit49fb6381cae006086974b6c3fa6d03bf52935d8b (patch)
tree7ebba13f2e5b93665a36c58f542f5146a038115e /src
parentf446016fdb7f8b85891ea351799e115dad44304e (diff)
downloademacs-49fb6381cae006086974b6c3fa6d03bf52935d8b.tar.gz
emacs-49fb6381cae006086974b6c3fa6d03bf52935d8b.zip
(w32_get_string_resource): Check for name in current
user area, and if not found look in the local machine area.
Diffstat (limited to 'src')
-rw-r--r--src/w32reg.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/w32reg.c b/src/w32reg.c
index d32032c76e2..6a8413fdc08 100644
--- a/src/w32reg.c
+++ b/src/w32reg.c
@@ -40,13 +40,16 @@ w32_get_string_resource (name, class, dwexptype)
40 DWORD dwType; 40 DWORD dwType;
41 DWORD cbData; 41 DWORD cbData;
42 BOOL ok = FALSE; 42 BOOL ok = FALSE;
43 HKEY hive = HKEY_CURRENT_USER;
43 44
45 trykey:
46
44 BLOCK_INPUT; 47 BLOCK_INPUT;
45 48
46 /* Check both the current user and the local machine to see if we have any resources */ 49 /* Check both the current user and the local machine to see if we have
47 50 any resources */
48 if (RegOpenKeyEx (HKEY_CURRENT_USER, REG_ROOT, 0, KEY_READ, &hrootkey) == ERROR_SUCCESS 51
49 || RegOpenKeyEx (HKEY_LOCAL_MACHINE, REG_ROOT, 0, KEY_READ, &hrootkey) == ERROR_SUCCESS) 52 if (RegOpenKeyEx (hive, REG_ROOT, 0, KEY_READ, &hrootkey) == ERROR_SUCCESS)
50 { 53 {
51 char *keyname; 54 char *keyname;
52 55
@@ -76,13 +79,19 @@ w32_get_string_resource (name, class, dwexptype)
76 79
77 if (!ok) 80 if (!ok)
78 { 81 {
79 if (lpvalue) xfree (lpvalue); 82 if (lpvalue)
83 {
84 xfree (lpvalue);
85 lpvalue = NULL;
86 }
87 if (hive == HKEY_CURRENT_USER)
88 {
89 hive = HKEY_LOCAL_MACHINE;
90 goto trykey;
91 }
80 return (NULL); 92 return (NULL);
81 } 93 }
82 else 94 return (lpvalue);
83 {
84 return (lpvalue);
85 }
86} 95}
87 96
88/* Retrieve the string resource specified by NAME with CLASS from 97/* Retrieve the string resource specified by NAME with CLASS from