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

From: Date: Wed, 02 Jul 2003 20:04:25 +0000
Subject: #24453 [Opn]: w32api registerfunction fails on 3rd call
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-43113@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 New Comment: Works here as expected with 4.3.2 CLI and CGI on XP Pro. Previous Comments: ------------------------------------------------------------------------ [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 (#43113) next »