while (SUCCEEDED(TypeInfo->lpVtbl->GetVarDesc(TypeInfo, j, &pVarDesc))) {
BSTR bstr_ids;
zend_constant c;
- zval exists, results;
+ zval exists, results, value;
char *const_name;
TypeInfo->lpVtbl->GetNames(TypeInfo, pVarDesc->memid, &bstr_ids, 1, &NameCount);
continue;
}
- php_variant_to_pval(pVarDesc->lpvarValue, &c.value, codepage TSRMLS_CC);
- c.flags = mode;
+ php_variant_to_pval(pVarDesc->lpvarValue, &value, codepage TSRMLS_CC);
+ /* we only import enumerations (=int) */
+ if (value.type == IS_LONG) {
+ c.flags = mode;
+ c.value.type = IS_LONG;
+ c.value.value.lval = value.value.lval;
+ c.module_number = 0; /* the module number is not available here */
- zend_register_constant(&c TSRMLS_CC);
+ zend_register_constant(&c TSRMLS_CC);
+ }
+ efree(value);
j++;
}