[Python-checkins] CVS: python/dist/src/Python dynload_win.c,2.7,2.7.6.1

Anthony Baxter anthonybaxter@users.sourceforge.net
2001年11月20日 21:37:34 -0800


Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv17734
Modified Files:
 Tag: release21-maint
	dynload_win.c 
Log Message:
backport of 2.8, after checking with MarkH
. Always pass a full path name to LoadLibraryEx(). Fixes some Windows 9x 
 problems. As discussed on python-dev
Index: dynload_win.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/dynload_win.c,v
retrieving revision 2.7
retrieving revision 2.7.6.1
diff -C2 -d -r2.7 -r2.7.6.1
*** dynload_win.c	2000年10月05日 10:54:45	2.7
--- dynload_win.c	2001年11月21日 05:37:32	2.7.6.1
***************
*** 164,185 ****
 #ifdef MS_WIN32
 	{
! 		HINSTANCE hDLL;
 		char pathbuf[260];
! 		if (strchr(pathname, '\\') == NULL &&
! 		 strchr(pathname, '/') == NULL)
! 		{
! 			/* Prefix bare filename with ".\" */
! 			char *p = pathbuf;
! 			*p = '0円';
! 			_getcwd(pathbuf, sizeof pathbuf);
! 			if (*p != '0円' && p[1] == ':')
! 				p += 2;
! 			sprintf(p, ".\\%-.255s", pathname);
! 			pathname = pathbuf;
! 		}
! 		/* Look for dependent DLLs in directory of pathname first */
! 		/* XXX This call doesn't exist in Windows CE */
! 		hDLL = LoadLibraryEx(pathname, NULL,
! 				 LOAD_WITH_ALTERED_SEARCH_PATH);
 		if (hDLL==NULL){
 			char errBuf[256];
--- 164,182 ----
 #ifdef MS_WIN32
 	{
! 		HINSTANCE hDLL = NULL;
 		char pathbuf[260];
! 		LPTSTR dummy;
! 		/* We use LoadLibraryEx so Windows looks for dependent DLLs 
! 		 in directory of pathname first. However, Windows95
! 		 can sometimes not work correctly unless the absolute
! 		 path is used. If GetFullPathName() fails, the LoadLibrary
! 		 will certainly fail too, so use its error code */
! 		if (GetFullPathName(pathname,
! 				 sizeof(pathbuf),
! 				 pathbuf,
! 				 &dummy))
! 			/* XXX This call doesn't exist in Windows CE */
! 			hDLL = LoadLibraryEx(pathname, NULL,
! 					 LOAD_WITH_ALTERED_SEARCH_PATH);
 		if (hDLL==NULL){
 			char errBuf[256];

AltStyle によって変換されたページ (->オリジナル) /