Bug #71879 [NEW]: Variant type VT_ARRAY as output parameter invalid
From: markus dot demml at bmlvs dot gv dot at
Operating system: Windows 7 x64
PHP version: 7.0.4
Package: COM related
Bug Type: Bug
Bug description:Variant type VT_ARRAY as output parameter invalid
Description:
------------
With PHP 7.0.4 (x64) i get an com_exception "Type mismatch" from the
WMI-Functions EnumValues, EnumKey but this works with 5.6.19 5.5.33
5.5.29 5.5.12.
I used php.ini-development with these changes:
extension_dir = "ext"
extension=php_com_dotnet.dll
Test script:
---------------
define('HKEY_LOCAL_MACHINE', 0x80000002);
$StdRegProv = new
COM("WinMgmts:{impersonationLevel=impersonate}//localhost/root/default:StdRegProv");
$valueNames = new Variant(array(), VT_ARRAY); // also new
Variant(array())
$valueTypes = new Variant(array(), VT_ARRAY); // also new
Variant(array())
try {
$StdRegProv->EnumValues(HKEY_LOCAL_MACHINE, "SOFTWARE\PhpTestRegEnum",
$valueNames, $valueTypes);
foreach($valueNames as $name) {
echo "[" . __LINE__ . "] " . "name: $name \n";
}
foreach($valueTypes as $type) {
echo "[" . __LINE__ . "] " . "type: $type \n";
}
} catch (Exception $e) {
echo "[" . __LINE__ . "] " . "Exception $e\n";
echo "[" . __LINE__ . "] " . "var_dump:\n"; var_dump($e);
echo "[" . __LINE__ . "] " . "print_r:\n"; print_r($e);
}
Expected result:
----------------
C:\php-5.6.19-Win32-VC11-x64>php
..\test-registry-access-shortversion.php
[9]name: test-reg_sz
[9]name: test-reg_bin
[9]name: test-reg_dword_32
[9]name: test-reg_qword_64
[9]name: test-reg_multi_sz
[12]type: 1
[12]type: 3
[12]type: 4
[12]type: 11
[12]type: 7
Actual result:
--------------
C:\php-7.0.4-Win32-VC14-x64>php
..\test-registry-access-shortversion.php
[15]Exception com_exception: Source: SWbemObjectEx
Description: Type mismatch in
C:\test-registry-access-shortversion.php:7
Stack trace:
#0 C:\test-registry-access-shortversion.php(7):
com->EnumValues(2147483650, 'SOFTWARE\\PhpTes...', Object(variant),
Object(variant))
#1 {main}
[16]var_dump:
...
--
Edit bug report at https://bugs.php.net/bug.php?id=71879&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71879&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71879&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71879&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71879&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71879&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71879&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71879&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71879&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71879&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71879&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71879&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71879&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71879&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71879&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71879&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71879&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71879&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71879&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71879&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71879&r=mysqlcfg
Thread (4 messages)
- markus dot demml at bmlvs dot gv dot at