#24453 [Opn]: w32api registerfunction fails on 3rd call

From: Date: Thu, 03 Jul 2003 20:56:55 +0000
Subject: #24453 [Opn]: w32api registerfunction fails on 3rd call
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-43212@lists.php.net to get a copy of this message
ID: 24453 Updated by: stone@php.net Reported By: jlim at natsoft dot com Status: Open Bug Type: Feature/Change Request Operating System: Windows XP -PHP Version: 4.3.2 +PHP Version: 4.3.3-RC2dev New Comment: No errors with 4.3.3 RC2 dev on XP either. Previous Comments: ------------------------------------------------------------------------ [2003-07-03 02:02:47] jlim at natsoft dot com OK, tested again with 4.3.3RC2-dev, Windows XP with the following results C:\php4\php43b>php d:\inetpub\wwwroot\php\w32.inc.php Content-type: text/html X-Powered-By: PHP/4.3.3RC2-dev Ticks=57669013 u='jlim ' Array ( [0] => registerfunction [1] => unregisterfunction [2] => registercallback [3] => definetype [4] => gettypesize [5] => inittype [6] => decref [7] => gettickcount [8] => getusername ) <br /> <b>Fatal error</b>: Call to undefined function: registerfunction() in <b>d:\in etpub\wwwroot\php\w32.inc.php</b> on line <b>18</b><br /> Also tested on a 2nd windows 2000 server, with php 4.3.2. Same result. ------------------------------------------------------------------------ [2003-07-02 15:04:25] stone@php.net Works here as expected with 4.3.2 CLI and CGI on XP Pro. ------------------------------------------------------------------------ [2003-07-02 01:11:52] jlim at natsoft dot com Description: ------------ If the 3rd registerfunction (for messageboxa) is commented out, the code works properly. Tested with cli version of php. Reproduce code: --------------- <?php error_reporting(E_ALL); $api = new win32(); $api->registerfunction("long GetTickCount () From Kernel32.dll"); echo "Ticks=",$api->GetTickCount(),"\n"; $api->registerfunction("long GetUserName (string &a, int &b) From advapi32.dll"); $s1 = " "; $size = strlen($s1); $api->GetUsername($s1,$size); $s1 = substr($s1,0,$size); echo "u='$s1'\n"; print_r(get_class_methods($api)); $api->registerfunction("int MessageBoxA(long hWnd, string &title, string &lpCaption, int uType) from User32.dll"); ?> Expected result: ---------------- Ticks=192755858 u='jlim ' Array ( [0] => registerfunction [1] => unregisterfunction [2] => registercallback [3] => definetype [4] => gettypesize [5] => inittype [6] => decref [7] => gettickcount [8] => getusername ) <br /> Actual result: -------------- Ticks=192755858 u='jlim ' Array ( [0] => registerfunction [1] => unregisterfunction [2] => registercallback [3] => definetype [4] => gettypesize [5] => inittype [6] => decref [7] => gettickcount [8] => getusername ) <br /> <b>Fatal error</b>: Call to undefined function: registerfunction() in <b>d:\in etpub\wwwroot\php\w32.inc.php</b> on line <b>18</b><br /> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24453&edit=1

« previous php.bugs (#43212) next »