@@ -311,18 +311,20 @@ ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj
311
311
312
312
if (obj ) {
313
313
if (dispname == NULL && sink ) {
314
- IProvideClassInfo2 * pci2 ;
315
- IProvideClassInfo * pci ;
314
+ if (V_VT (& obj -> v ) == VT_DISPATCH ) {
315
+ IProvideClassInfo2 * pci2 ;
316
+ IProvideClassInfo * pci ;
316
317
317
- if (SUCCEEDED (IDispatch_QueryInterface (V_DISPATCH (& obj -> v ), & IID_IProvideClassInfo2 , (void * * )& pci2 ))) {
318
- gotguid = SUCCEEDED (IProvideClassInfo2_GetGUID (pci2 , GUIDKIND_DEFAULT_SOURCE_DISP_IID , & iid ));
319
- IProvideClassInfo2_Release (pci2 );
320
- }
321
- if (!gotguid && SUCCEEDED (IDispatch_QueryInterface (V_DISPATCH (& obj -> v ), & IID_IProvideClassInfo , (void * * )& pci ))) {
322
- /* examine the available interfaces */
323
- /* TODO: write some code here */
324
- php_error_docref (NULL , E_WARNING , "IProvideClassInfo: this code not yet written!" );
325
- IProvideClassInfo_Release (pci );
318
+ if (SUCCEEDED (IDispatch_QueryInterface (V_DISPATCH (& obj -> v ), & IID_IProvideClassInfo2 , (void * * )& pci2 ))) {
319
+ gotguid = SUCCEEDED (IProvideClassInfo2_GetGUID (pci2 , GUIDKIND_DEFAULT_SOURCE_DISP_IID , & iid ));
320
+ IProvideClassInfo2_Release (pci2 );
321
+ }
322
+ if (!gotguid && SUCCEEDED (IDispatch_QueryInterface (V_DISPATCH (& obj -> v ), & IID_IProvideClassInfo , (void * * )& pci ))) {
323
+ /* examine the available interfaces */
324
+ /* TODO: write some code here */
325
+ php_error_docref (NULL , E_WARNING , "IProvideClassInfo: this code not yet written!" );
326
+ IProvideClassInfo_Release (pci );
327
+ }
326
328
}
327
329
} else if (dispname == NULL ) {
328
330
if (obj -> typeinfo ) {
@@ -339,15 +341,17 @@ ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj
339
341
/* get the library from the object; the rest will be dealt with later */
340
342
ITypeInfo_GetContainingTypeLib (obj -> typeinfo , & typelib , & idx );
341
343
} else if (typelibname == NULL ) {
342
- IDispatch_GetTypeInfo (V_DISPATCH (& obj -> v ), 0 , LANG_NEUTRAL , & typeinfo );
343
- if (dispname ) {
344
- unsigned int idx ;
345
- /* get the library from the object; the rest will be dealt with later */
346
- ITypeInfo_GetContainingTypeLib (typeinfo , & typelib , & idx );
347
-
348
- if (typelib ) {
349
- ITypeInfo_Release (typeinfo );
350
- typeinfo = NULL ;
344
+ if (V_VT (& obj -> v ) == VT_DISPATCH ) {
345
+ IDispatch_GetTypeInfo (V_DISPATCH (& obj -> v ), 0 , LANG_NEUTRAL , & typeinfo );
346
+ if (dispname ) {
347
+ unsigned int idx ;
348
+ /* get the library from the object; the rest will be dealt with later */
349
+ ITypeInfo_GetContainingTypeLib (typeinfo , & typelib , & idx );
350
+
351
+ if (typelib ) {
352
+ ITypeInfo_Release (typeinfo );
353
+ typeinfo = NULL ;
354
+ }
351
355
}
352
356
}
353
357
}
0 commit comments