RE: [PHP-CVS] com php-src: Get rid of these slow calls to LoadLibrary()/GetProcAddress() calls on Windows, we require Windows Vista as bare minimum
for PHP anyway, so it does not make any sense to do this slow emulation anyway.: ext/gd/gd.c ext/standard/f

From: Date: Thu, 11 Aug 2016 13:58:24 +0000
Subject: RE: [PHP-CVS] com php-src: Get rid of these slow calls to LoadLibrary()/GetProcAddress() calls on Windows, we require Windows Vista as bare minimum
for PHP anyway, so it does not make any sense to do this slow emulation anyway.: ext/gd/gd.c ext/standard/f
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-93750@lists.php.net to get a copy of this message
Hi Kalle, > -----Original Message----- > From: Kalle Sommer Nielsen [mailto:kalle@php.net] > Sent: Thursday, August 11, 2016 2:10 AM > To: php-cvs@lists.php.net > Subject: [PHP-CVS] com php-src: Get rid of these slow calls to > LoadLibrary()/GetProcAddress() calls on Windows, we require Windows Vista as > bare minimum for PHP anyway, so it does not make any sense to do this slow > emulation anyway.: ext/gd/gd.c ext/standard/files > > Commit: 36b050c2c517b1b9bc1c67e07722d01f6eed6aa4 > Author: Kalle Sommer Nielsen <kalle@php.net> Thu, 11 Aug 2016 02:09:50 > +0200 > Parents: ec2dd0217dc536079cb4aec4c045f5ea894409d6 > Branches: master > > Link: http://git.php.net/?p=php- > src.git;a=commitdiff;h=36b050c2c517b1b9bc1c67e07722d01f6eed6aa4 > > Log: > Get rid of these slow calls to LoadLibrary()/GetProcAddress() calls on Windows, > we require Windows Vista as bare minimum for PHP anyway, so it does not > make any sense to do this slow emulation anyway. > > GD: > - PrintWindow() is available as of Windows XP, it requires linking to User32.lib, > which config.w32 for ext/gd already. > > CLI: > - The borrowed functions from PostgreSQL to set the titles of the console > window uses SetConsoleTitle() and GetConsoleTitle(), both are available as of > Windows 2000 from Kernel32.lib which we already are linking against. > > Standard: > - The disk space utility functions uses GetDiskFreeSpaceExA() which is available > as of Windows XP, again links to Kernel32.lib. > - The symlink() PHP function uses CreateSymbolicLinkA() which is available from > Windows Vista, again from Kernel32.lib. > - php_get_windows_name() in info.c uses GetNativeSystemInfo() which is > available as of Windows XP and GetProductInfo() which is available as of > Windows Vista, both are again from Kernel32.lib. > > Notes: > - ext/interbase & ext/pdo_firebird uses GetProcAddress(), I'm not entirely sure > how to handle this one. > - ext/sqlite3, this is apart of the bundled libsqlite3, I don't really wanna play > around with our bundled libs and make it a bigger issue for those who maintain > and upgrade them. > - ext/readline, the call to GetProcAddress() here does not do any system calls, > so it is left as is. > - win32/ioutil.c uses GetProcAddress(), but the function it attempts to load > (PathCchCanonicalizeEx()) is only available from Windows 8 and greater > (Pathcch.lib linkage). > - win32/time.c uses GetSystemTimePreciseAsFileTime() which is available from > Windows 8 and greater to get the current system date and time which the > highest possible precision and falls back to GetSystemTimeAsFileTime() > (available as of Windows 2000), again Kernel32.lib, the > GetSystemTimePreciseAsFileTime() is left in a GetProcAddress(). > > Changed paths: > M ext/gd/gd.c > M ext/standard/filestat.c > M ext/standard/info.c > M ext/standard/link_win32.c > M sapi/cli/ps_title.c > M win32/time.c I ported some of these into 7.1 already. Seems you revealed some missing parts while digging in there. There might be still more in some far code places which are not handled by streams, those related to path handling have to be done in 7.1 as that's a missing part of the implementation. In general, checking symbols is required at some places as sometimes one has to deal with different system/DLL versions. It is fine in MINIT phase (or in DLLMain in PHP7) to setup a correct function pointer. On runtime it should be avoided whenever possible. But we'd better not touch the bundled libs without strong need, and at least send patches to the corresponding upstream, when patched. Regards Anatol

« previous php.cvs (#93750) next »