From:             robert dot johnson at icap dot com
Operating system: Win XP sp3
PHP version:      5.2.9
PHP Bug Type:     COM related
Bug description:  com_load_typelib holds reference, fails on second call

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 bug report at http://bugs.php.net/?id=48585&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=48585&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=48585&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=48585&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=48585&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48585&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=48585&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=48585&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=48585&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=48585&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=48585&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=48585&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=48585&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=48585&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=48585&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=48585&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=48585&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=48585&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=48585&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=48585&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=48585&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=48585&r=mysqlcfg

Reply via email to