Edit report at https://bugs.php.net/bug.php?id=48585&edit=1

 ID:                 48585
 Comment by:         hendri dot cacem at gmail dot com
 Reported by:        robert dot johnson at icap dot com
 Summary:            com_load_typelib holds reference, fails on second
                     call
 Status:             Open
 Type:               Bug
 Package:            COM related
 Operating System:   Win XP sp3
 PHP Version:        5.2.9
 Block user comment: N
 Private report:     N

 New Comment:

Same to my version:
PHP Version: 5.3.1
XAMPP 1.7.3


Previous Comments:
------------------------------------------------------------------------
[2010-02-03 19:03:46] marc at parknpool dot com

I am having the same problem.  I use com_load_typelib to load COM constants.  
The result of calling com_load_typelib always returns true.  However, the 
constants are defined on the first call and undefined for each subsequent call 
to the page I am testing.  This is true when I go away from the page or switch 
browsers.

Apparently restarting the web server (Apache) resets the system state and I can 
see the constants again, but on the first call only.

OS: Windows Server 2008
PHP Version: 5.2.6
In php.ini:

com.allow_dcom = true
com.autoregister_typelib = true
com.autoregister_casesensitive = false
com.autoregister_verbose = true

------------------------------------------------------------------------
[2009-06-17 15:19:03] robert dot johnson at icap dot com

Description:
------------
com_load_typelib successfully loads a type library defintitions on its first 
call.

It fails on the second call, and the previous definitions disappear.

Other points:
First call holds a reference to the type library which does not get released 
until the web server (Apache 2.2) is stopped.  If you're creating define()'s, 
why do you need to hold a library reference - you could load the types then 
release the references?

This behaviour is the same when php.ini contains 'com.autoregister_typelib=1', 
instead of calling com_load_typelib.


Reproduce code:
---------------
This uses a private COM object, but if you want a copy it's no problem.

////////////////////////////
function test()
{
    com_load_typelib('{8F387CCB-379F-4F13-9470-9D04DF3B04F8},1,0');
    $domain = '';
    $dns = 'some_u...@domain.com';
    $wincall = new COM('wincall.wincall');
    $snu = $wincall->LookupAccount('', $dns, $domain);
    echo 'SidTypeUser == ' . SidTypeUser . "<br />\r\n";
}

test();
/////////////////////////////

Run this script twice...

Expected result:
----------------
// first call of script:
SidTypeUser == 1

// second call of script:
SidTypeUser == 1

Actual result:
--------------
// first call of script:
SidTypeUser == 1

// second call of script:
SidTypeUser == SidTypeUser


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=48585&edit=1

Reply via email to