ID: 21504
Updated by: [EMAIL PROTECTED]
Reported By: thingol at mail dot ru
-Status: Open
+Status: Wont fix
Bug Type: Documentation problem
Operating System: win32
PHP Version: Irrelevant
New Comment:
This pecl extension is dead. If anything the documentation
will be removed.
Previous Comments:
------------------------------------------------------------------------
[2006-06-20 16:21:18] nightwulfe at gmail dot com
That's PHP 4.4.1, sorry.
------------------------------------------------------------------------
[2006-06-20 16:20:32] nightwulfe at gmail dot com
I receive the following error:
Call to undefined function: registerfunction() in
D:\web_4\wwwroot\shm.php on line 25
In CGI mode, this happens if I have a third call to registerfunction in
the script.
In ISAPI mode, this happens if the page attempts a third call (between
all page accesses) to registerfunction.
The PHP code is as follows:
<?php
function Output($text)
{
echo str_pad($text, 4096), "\n";
flush();
}
header('Content-Type: text/plain');
while(ob_get_level() > 0)
{
ob_end_clean();
}
Output("Start");
set_time_limit(0);
Output("Register Functions");
$api = new win32();
$api->registerFunction("int Log (string sfile, string sText, string
sData, string sStack) From Support.dll");
$api->registerFunction("int Test (int nValue) From TestSupport.dll");
Output("Execute Log Statement");
Output("Result " . $api->Log("Tset", "Test", "test", "Value"));
Output("Wait 5 Seconds");
Sleep(5);
Output("Call Test");
Output($api->Test(432));
Output("Wait 5 Seconds");
Sleep(5);
Output("Exit");
?>
Additionally, the statement Output("Result " . $api->Log("Tset",
"Test", "test", "Value")); will echo 0 to the browser. I know the
correct function is being called as I have logging code that is being
executed.
The Output($api->Test(432)) line, however returns the correct value
(432) and displays it. This C function just returns what is passed to
it.
------------------------------------------------------------------------
[2003-07-17 11:55:46] iron at ironiq dot hu
The rewritten w32api extension works wrong on WinXP with PHP 4.3.2 (as
isapi dll) and IIS 5.
If I use the php as isapi dll, the unregisterfunction doesn't work. I
get an "Access Violation" if I run second time.
After restarting the IIS, the php script works first and doesn't on the
second time.
The sample:
$api = new win32;
$api->registerfunction("long GetTickCount () From Kernel32.dll");
[...]
$api->unregisterfunction("GetTickCount");
------------------------------------------------------------------------
[2003-05-12 14:00:14] thingol at mail dot ru
I notice that I use wrong syntax.
But:
<?php
dl("php_w32api.dll");
$api = new win32();
$api->RegisterFunction("long MessageBoxA (long hWnd, string &lpText,
string &lpCaption, long uType) From User32.dll", 0);
$str = "Test, oh my god";
$api->MessageBoxA(NULL, $str, $str, 0);
?>
with new ext shows no errors and no messagebox.
<?php
@dl("php_w32api.dll");
w32api_register_function("User32.dll", "MessageBoxA", "long");
$str = "Test, oh my god";
MessageBoxA(NULL, $str, $str, 0);
?>
with old ext shows messagebox.
------------------------------------------------------------------------
[2003-05-12 13:44:26] thingol at mail dot ru
This documentation gives no sample.
I try this code and it don't work:
<?php
dl("php_w32api.dll");
Win32::RegisterFunction("long MessageBox (long hWnd, string lpText,
string lpCaption, long uType) From User32.dll", 0);
$str = "Test, oh my god";
echo Win32::MessageBox(NULL, $str, "Information", 0);
?>
PHP 4.3.2RC1
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/21504
--
Edit this bug report at http://bugs.php.net/?id=21504&edit=1