php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16628 w32api_invoke_function() is missing
Submitted: 2002-04-16 03:46 UTC Modified: 2002-04-16 10:20 UTC
From: ryan at wonko dot com Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: 4.2.0 OS: Windows XP Pro
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ryan at wonko dot com
New email:
PHP Version: OS:

 

 [2002-04-16 03:46 UTC] ryan at wonko dot com
Using the Windows binary build of PHP 4.2.0 RC4, the function w32api_invoke_function() seems to be broken. With the w32api extension loaded, I can call other w32api functions such as w32api_register_function(), but if I call w32api_invoke_function() PHP spits out this error:

<b>Fatal error</b>:  Call to undefined function:  w32api_invoke_function() in <b
>C:\source\uptime.php</b> on line <b>13</b>

uptime.php is a test script I downloaded from the w32api CVS directory. Here it is:

<?php

        dl("php_w32api.dll");

        w32api_register_function("kernel32.dll",
                                 "GetTickCount",
                                 W32_LONG);

        w32api_register_function("User32.dll",
                                 "MessageBoxA",
                                 W32_LONG);

        $ticks = w32api_invoke_function("GetTickCount");

        $secs = floor($ticks / 1000);
        $mins = floor($secs / 60);
        $hours = floor($mins / 60);

        $str = sprintf("You have been using your computer for:".
                        "\r\n %d Milliseconds, or \r\n %d Seconds".
                        "or \r\n %d mins or\r\n %d hours %d mins.",
                        $ticks,
                        $secs,
                        $mins,
                        $hours,
                        $mins - ($hours*60));

        w32api_invoke_function("MessageBoxA",
                                NULL,
                                $str,
                                "Uptime Information",
                                MB_OK);
?>

php_w32api.dll is the only module I'm loading. w32api_invoke_function() *does* exist in CVS and looks like it should work just fine, but apparently something broke when the binaries were built. I can't re-build anything myself since I don't own a copy of Microsoft VC++.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-16 04:24 UTC] sander@php.net
Yeah, I see what's wrong. I'll fix it tonight when I can get into CVS again...
 [2002-04-16 10:20 UTC] sander@php.net
This bug has been fixed in CVS.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 04:01:29 2024 UTC