[Python-checkins] CVS: python/dist/src/PC import_nt.c,1.13,1.14
Mark Hammond
python-dev@python.org
Tue, 22 Aug 2000 04:20:25 -0700
Update of /cvsroot/python/python/dist/src/PC
In directory slayer.i.sourceforge.net:/tmp/cvs-serv32480
Modified Files:
import_nt.c
Log Message:
Registered modules could only exist in HKEY_LOCAL_MACHINE - now HKEY_CURRENT_USER can override.
Index: import_nt.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/PC/import_nt.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** import_nt.c 2000/07/03 23:51:17 1.13
--- import_nt.c 2000/08/22 11:20:21 1.14
***************
*** 35,39 ****
struct filedescr *fdp = NULL;
FILE *fp;
! HKEY keyBase = HKEY_LOCAL_MACHINE;
int modNameSize;
long regStat;
--- 35,39 ----
struct filedescr *fdp = NULL;
FILE *fp;
! HKEY keyBase = HKEY_CURRENT_USER;
int modNameSize;
long regStat;
***************
*** 57,62 ****
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++) {
--- 57,71 ----
modNameSize = pathLen;
regStat = RegQueryValue(keyBase, moduleKey, pathBuf, &modNameSize);
! 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++) {