@@ -289,7 +289,7 @@ PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream)
289
289
290
290
#define CPH_FETCH () php_com_persist_helper *helper = (php_com_persist_helper*)Z_OBJ_P(getThis());
291
291
292
- #define CPH_NO_OBJ () if (helper->unk == NULL) { php_com_throw_exception(E_INVALIDARG, "No COM object is associated with this helper instance"); return ; }
292
+ #define CPH_NO_OBJ () if (helper->unk == NULL) { php_com_throw_exception(E_INVALIDARG, "No COM object is associated with this helper instance"); RETURN_THROWS() ; }
293
293
294
294
typedef struct {
295
295
zend_object std ;
@@ -490,7 +490,7 @@ CPH_METHOD(GetMaxStreamSize)
490
490
res = IPersistStream_GetSizeMax (helper -> ips , & size );
491
491
} else {
492
492
php_com_throw_exception (res , NULL );
493
- return ;
493
+ RETURN_THROWS () ;
494
494
}
495
495
}
496
496
@@ -545,13 +545,13 @@ CPH_METHOD(LoadFromStream)
545
545
546
546
if (stream == NULL ) {
547
547
php_com_throw_exception (E_INVALIDARG , "expected a stream" );
548
- return ;
548
+ RETURN_THROWS () ;
549
549
}
550
550
551
551
stm = php_com_wrapper_export_stream (stream );
552
552
if (stm == NULL ) {
553
553
php_com_throw_exception (E_UNEXPECTED , "failed to wrap stream" );
554
- return ;
554
+ RETURN_THROWS () ;
555
555
}
556
556
557
557
res = S_OK ;
@@ -581,7 +581,7 @@ CPH_METHOD(LoadFromStream)
581
581
582
582
if (FAILED (res )) {
583
583
php_com_throw_exception (res , NULL );
584
- RETURN_NULL ();
584
+ RETURN_THROWS ();
585
585
}
586
586
}
587
587
/* }}} */
@@ -606,13 +606,13 @@ CPH_METHOD(SaveToStream)
606
606
607
607
if (stream == NULL ) {
608
608
php_com_throw_exception (E_INVALIDARG , "expected a stream" );
609
- return ;
609
+ RETURN_THROWS () ;
610
610
}
611
611
612
612
stm = php_com_wrapper_export_stream (stream );
613
613
if (stm == NULL ) {
614
614
php_com_throw_exception (E_UNEXPECTED , "failed to wrap stream" );
615
- return ;
615
+ RETURN_THROWS () ;
616
616
}
617
617
618
618
res = get_persist_stream_init (helper );
@@ -629,7 +629,7 @@ CPH_METHOD(SaveToStream)
629
629
630
630
if (FAILED (res )) {
631
631
php_com_throw_exception (res , NULL );
632
- return ;
632
+ RETURN_THROWS () ;
633
633
}
634
634
635
635
RETURN_TRUE ;
@@ -657,7 +657,7 @@ CPH_METHOD(__construct)
657
657
658
658
if (V_VT (& obj -> v ) != VT_DISPATCH || V_DISPATCH (& obj -> v ) == NULL ) {
659
659
php_com_throw_exception (E_INVALIDARG , "parameter must represent an IDispatch COM object" );
660
- return ;
660
+ RETURN_THROWS () ;
661
661
}
662
662
663
663
/* it is always safe to cast an interface to IUnknown */
0 commit comments