From: Mark Hammond Date: Tue, 22 Aug 2000 11:20:21 +0000 (+0000) Subject: Registered modules could only exist in HKEY_LOCAL_MACHINE - now HKEY_CURRENT_USER... X-Git-Tag: v2.0b1~312 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=48b3eee170d84909ed6f7888374847ade0c3b01d;p=thirdparty%2FPython%2Fcpython.git Registered modules could only exist in HKEY_LOCAL_MACHINE - now HKEY_CURRENT_USER can override. --- diff --git a/PC/import_nt.c b/PC/import_nt.c index f0a27350b084..573106fd3ff2 100644 --- a/PC/import_nt.c +++ b/PC/import_nt.c @@ -34,7 +34,7 @@ FILE *PyWin_FindRegisteredModule(const char *moduleName, #endif struct filedescr *fdp = NULL; FILE *fp; - HKEY keyBase = HKEY_LOCAL_MACHINE; + HKEY keyBase = HKEY_CURRENT_USER; int modNameSize; long regStat; @@ -56,8 +56,17 @@ FILE *PyWin_FindRegisteredModule(const char *moduleName, modNameSize = pathLen; regStat = RegQueryValue(keyBase, moduleKey, pathBuf, &modNameSize); - if (regStat != ERROR_SUCCESS) - return NULL; + if (regStat != ERROR_SUCCESS) { + /* No user setting - lookup in machine settings */ + keyBase = HKEY_LOCAL_MACHINE; + /* be anal - failure may have reset size param */ + modNameSize = pathLen; + regStat = RegQueryValue(keyBase, moduleKey, + pathBuf, &modNameSize); + + if (regStat != ERROR_SUCCESS) + return NULL; + } /* use the file extension to locate the type entry. */ for (fdp = _PyImport_Filetab; fdp->suffix != NULL; fdp++) { size_t extLen = strlen(fdp->suffix);