From 27787c591812596feaeb1633fe4bdf2db5c7f285 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Sat, 22 Feb 2014 09:53:25 +0000 Subject: [PATCH] [KS] - Call Property handler guarded in seh block - Needs to be done in portcls too - svn path=/trunk/; revision=62285 --- reactos/drivers/ksfilter/ks/property.c | 28 +++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/reactos/drivers/ksfilter/ks/property.c b/reactos/drivers/ksfilter/ks/property.c index 960b4997406..7d6a29b704c 100644 --- a/reactos/drivers/ksfilter/ks/property.c +++ b/reactos/drivers/ksfilter/ks/property.c @@ -8,6 +8,9 @@ #include "precomp.h" +/* SEH support with PSEH */ +#include + #define NDEBUG #include @@ -280,8 +283,16 @@ KspPropertyHandler( KSPROPERTY_ITEM_IRP_STORAGE(Irp) = PropertyItem; } - /* call property handler */ - Status = PropertyHandler(Irp, Property, (OutputBufferLength > 0 ? Irp->AssociatedIrp.SystemBuffer : NULL)); + _SEH2_TRY + { + /* call property handler */ + Status = PropertyHandler(Irp, Property, (OutputBufferLength > 0 ? Irp->AssociatedIrp.SystemBuffer : NULL)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + _SEH2_YIELD(return _SEH2_GetExceptionCode()); + } + _SEH2_END; if (Status == STATUS_BUFFER_TOO_SMALL) { @@ -297,9 +308,16 @@ KspPropertyHandler( /* no memory */ return STATUS_INSUFFICIENT_RESOURCES; } - - /* re-call property handler */ - Status = PropertyHandler(Irp, Property, Irp->AssociatedIrp.SystemBuffer); + _SEH2_TRY + { + /* re-call property handler */ + Status = PropertyHandler(Irp, Property, Irp->AssociatedIrp.SystemBuffer); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; } } }