Author: pschweitzer
Date: Sat Jul 12 04:56:52 2008
New Revision: 34436
URL:
http://svn.reactos.org/svn/reactos?rev=34436&view=rev
Log:
- Switched more files to PSEH use
- Also fixed some warnings
Modified:
branches/pierre-fsd/drivers/filesystems/ext3fsd/block.c
branches/pierre-fsd/drivers/filesystems/ext3fsd/cleanup.c
branches/pierre-fsd/drivers/filesystems/ext3fsd/close.c
branches/pierre-fsd/drivers/filesystems/ext3fsd/debug.c
Modified: branches/pierre-fsd/drivers/filesystems/ext3fsd/block.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/drivers/filesystems/…
==============================================================================
--- branches/pierre-fsd/drivers/filesystems/ext3fsd/block.c [iso-8859-1] (original)
+++ branches/pierre-fsd/drivers/filesystems/ext3fsd/block.c [iso-8859-1] Sat Jul 12
04:56:52 2008
@@ -4,9 +4,9 @@
* FILE: block.c
* PROGRAMMER: Matt Wu <mattwu(a)163.com>
* HOMEPAGE:
http://ext2.yeah.net
- * UPDATE HISTORY: 11 Jul 2008
- * Replaced SEH support with PSEH support (Pierre Schweitzer
<heis_spiter(a)hotmail.com>)
- * Fixed some warning under GCC
+ * UPDATE HISTORY: 11 Jul 2008 (Pierre Schweitzer <heis_spiter(a)hotmail.com>)
+ * Replaced SEH support with PSEH support
+ * Fixed some warnings under GCC
*/
/* INCLUDES *****************************************************************/
Modified: branches/pierre-fsd/drivers/filesystems/ext3fsd/cleanup.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/drivers/filesystems/…
==============================================================================
--- branches/pierre-fsd/drivers/filesystems/ext3fsd/cleanup.c [iso-8859-1] (original)
+++ branches/pierre-fsd/drivers/filesystems/ext3fsd/cleanup.c [iso-8859-1] Sat Jul 12
04:56:52 2008
@@ -4,7 +4,8 @@
* FILE: cleanup.c
* PROGRAMMER: Matt Wu <mattwu(a)163.com>
* HOMEPAGE:
http://ext2.yeah.net
- * UPDATE HISTORY:
+ * UPDATE HISTORY: 12 Jul 2008 (Pierre Schweitzer <heis_spiter(a)hotmail.com>)
+ * Replaced SEH support with PSEH support
*/
/* INCLUDES *****************************************************************/
@@ -16,11 +17,77 @@
extern PEXT2_GLOBAL Ext2Global;
/* DEFINITIONS *************************************************************/
+
+VOID
+Ext2CleanupFinal (
+ IN PEXT2_IRP_CONTEXT IrpContext,
+ IN PNTSTATUS pStatus,
+ IN PEXT2_VCB Vcb,
+ IN PEXT2_FCB Fcb,
+ IN BOOLEAN VcbResourceAcquired,
+ IN BOOLEAN FcbResourceAcquired,
+ IN BOOLEAN FcbPagingIoResourceAcquired );
#ifdef ALLOC_PRAGMA
#pragma alloc_text(PAGE, Ext2Cleanup)
#endif
+
+/* FUNCTIONS ***************************************************************/
+
+
+_SEH_DEFINE_LOCALS(Ext2CleanupFinal)
+{
+ PEXT2_IRP_CONTEXT IrpContext;
+ PNTSTATUS pStatus;
+ PEXT2_VCB Vcb;
+ PEXT2_FCB Fcb;
+ BOOLEAN VcbResourceAcquired;
+ BOOLEAN FcbResourceAcquired;
+ BOOLEAN FcbPagingIoResourceAcquired;
+};
+
+_SEH_FINALLYFUNC(Ext2CleanupFinal_PSEH)
+{
+ _SEH_ACCESS_LOCALS(Ext2CleanupFinal);
+ Ext2CleanupFinal(_SEH_VAR(IrpContext), _SEH_VAR(pStatus), _SEH_VAR(Vcb),
+ _SEH_VAR(Fcb), _SEH_VAR(VcbResourceAcquired),
+ _SEH_VAR(FcbResourceAcquired),
+ _SEH_VAR(FcbPagingIoResourceAcquired));
+}
+
+VOID
+Ext2CleanupFinal (
+ IN PEXT2_IRP_CONTEXT IrpContext,
+ IN PNTSTATUS pStatus,
+ IN PEXT2_VCB Vcb,
+ IN PEXT2_FCB Fcb,
+ IN BOOLEAN VcbResourceAcquired,
+ IN BOOLEAN FcbResourceAcquired,
+ IN BOOLEAN FcbPagingIoResourceAcquired
+ )
+{
+ if (FcbPagingIoResourceAcquired) {
+ ExReleaseResourceLite(&Fcb->PagingIoResource);
+ }
+
+ if (FcbResourceAcquired) {
+ ExReleaseResourceLite(&Fcb->MainResource);
+ }
+
+ if (VcbResourceAcquired) {
+ ExReleaseResourceLite(&Vcb->MainResource);
+ }
+
+ if (!IrpContext->ExceptionInProgress) {
+ if (*pStatus == STATUS_PENDING) {
+ Ext2QueueRequest(IrpContext);
+ } else {
+ IrpContext->Irp->IoStatus.Status = *pStatus;
+ Ext2CompleteIrpContext(IrpContext, *pStatus);
+ }
+ }
+}
NTSTATUS
Ext2Cleanup (IN PEXT2_IRP_CONTEXT IrpContext)
@@ -33,11 +100,14 @@
PEXT2_CCB Ccb;
PIRP Irp;
- BOOLEAN VcbResourceAcquired = FALSE;
- BOOLEAN FcbResourceAcquired = FALSE;
- BOOLEAN FcbPagingIoResourceAcquired = FALSE;
-
- __try {
+ _SEH_TRY {
+
+ _SEH_DECLARE_LOCALS(Ext2CleanupFinal);
+ _SEH_VAR(IrpContext) = IrpContext;
+ _SEH_VAR(pStatus) = &Status;
+ _SEH_VAR(VcbResourceAcquired) = FALSE;
+ _SEH_VAR(FcbResourceAcquired) = FALSE;
+ _SEH_VAR(FcbPagingIoResourceAcquired) = FALSE;
ASSERT(IrpContext != NULL);
ASSERT((IrpContext->Identifier.Type == EXT2ICX) &&
@@ -46,34 +116,36 @@
DeviceObject = IrpContext->DeviceObject;
if (IsExt2FsDevice(DeviceObject)) {
Status = STATUS_SUCCESS;
- __leave;
+ _SEH_LEAVE;
}
Irp = IrpContext->Irp;
Vcb = (PEXT2_VCB) DeviceObject->DeviceExtension;
+ _SEH_VAR(Vcb) = Vcb;
ASSERT(Vcb != NULL);
ASSERT((Vcb->Identifier.Type == EXT2VCB) &&
(Vcb->Identifier.Size == sizeof(EXT2_VCB)));
if (!IsFlagOn(Vcb->Flags, VCB_INITIALIZED)) {
Status = STATUS_SUCCESS;
- __leave;
+ _SEH_LEAVE;
}
FileObject = IrpContext->FileObject;
Fcb = (PEXT2_FCB) FileObject->FsContext;
+ _SEH_VAR(Fcb) = Fcb;
if (!Fcb || (Fcb->Identifier.Type != EXT2VCB &&
Fcb->Identifier.Type != EXT2FCB)) {
Status = STATUS_SUCCESS;
- __leave;
+ _SEH_LEAVE;
}
if (IsFlagOn(FileObject->Flags, FO_CLEANUP_COMPLETE)) {
Status = STATUS_SUCCESS;
- __leave;
- }
-
- VcbResourceAcquired =
+ _SEH_LEAVE;
+ }
+
+ _SEH_VAR(VcbResourceAcquired) =
ExAcquireResourceExclusiveLite(
&Vcb->MainResource,
IsFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_WAIT)
@@ -96,7 +168,7 @@
}
Status = STATUS_SUCCESS;
- __leave;
+ _SEH_LEAVE;
}
ASSERT((Fcb->Identifier.Type == EXT2FCB) &&
@@ -110,12 +182,12 @@
!IsFlagOn(Vcb->Flags, VCB_WRITE_PROTECTED) ) {
Status = Ext2FlushFile(IrpContext, Fcb, Ccb);
}
- __leave;
+ _SEH_LEAVE;
}
if (Ccb == NULL) {
Status = STATUS_SUCCESS;
- __leave;
+ _SEH_LEAVE;
}
if (IsDirectory(Fcb)) {
@@ -140,9 +212,9 @@
}
ExReleaseResourceLite(&Vcb->MainResource);
- VcbResourceAcquired = FALSE;
-
- FcbResourceAcquired =
+ _SEH_VAR(VcbResourceAcquired) = FALSE;
+
+ _SEH_VAR(FcbResourceAcquired) =
ExAcquireResourceExclusiveLite(
&Fcb->MainResource,
IsFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_WAIT)
@@ -235,7 +307,7 @@
LARGE_INTEGER Size;
ExAcquireResourceExclusiveLite(&Fcb->PagingIoResource, TRUE);
- FcbPagingIoResourceAcquired = TRUE;
+ _SEH_VAR(FcbPagingIoResourceAcquired) = TRUE;
Size.QuadPart = CEILING_ALIGNED(ULONGLONG,
(ULONGLONG)Fcb->Mcb->FileSize.QuadPart,
@@ -258,7 +330,7 @@
ClearLongFlag(Fcb->Flags, FCB_ALLOC_IN_CREATE|FCB_ALLOC_IN_WRITE);
Fcb->RealSize.QuadPart = 0;
ExReleaseResourceLite(&Fcb->PagingIoResource);
- FcbPagingIoResourceAcquired = FALSE;
+ _SEH_VAR(FcbPagingIoResourceAcquired) = FALSE;
}
}
@@ -272,9 +344,9 @@
// Ext2DeleteFile will acquire these lock inside
//
- if (FcbResourceAcquired) {
+ if (_SEH_VAR(FcbResourceAcquired)) {
ExReleaseResourceLite(&Fcb->MainResource);
- FcbResourceAcquired = FALSE;
+ _SEH_VAR(FcbResourceAcquired) = FALSE;
}
//
@@ -310,7 +382,7 @@
// re-acquire the main resource lock
//
- FcbResourceAcquired =
+ _SEH_VAR(FcbResourceAcquired) =
ExAcquireResourceExclusiveLite(
&Fcb->MainResource,
IsFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_WAIT)
@@ -361,29 +433,9 @@
SetFlag(FileObject->Flags, FO_CLEANUP_COMPLETE);
}
- } __finally {
-
- if (FcbPagingIoResourceAcquired) {
- ExReleaseResourceLite(&Fcb->PagingIoResource);
- }
-
- if (FcbResourceAcquired) {
- ExReleaseResourceLite(&Fcb->MainResource);
- }
-
- if (VcbResourceAcquired) {
- ExReleaseResourceLite(&Vcb->MainResource);
- }
-
- if (!IrpContext->ExceptionInProgress) {
- if (Status == STATUS_PENDING) {
- Ext2QueueRequest(IrpContext);
- } else {
- IrpContext->Irp->IoStatus.Status = Status;
- Ext2CompleteIrpContext(IrpContext, Status);
- }
- }
}
+ _SEH_FINALLY(Ext2CleanupFinal_PSEH)
+ _SEH_END;
return Status;
}
Modified: branches/pierre-fsd/drivers/filesystems/ext3fsd/close.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/drivers/filesystems/…
==============================================================================
--- branches/pierre-fsd/drivers/filesystems/ext3fsd/close.c [iso-8859-1] (original)
+++ branches/pierre-fsd/drivers/filesystems/ext3fsd/close.c [iso-8859-1] Sat Jul 12
04:56:52 2008
@@ -4,7 +4,8 @@
* FILE: close.c
* PROGRAMMER: Matt Wu <mattwu(a)163.com>
* HOMEPAGE:
http://ext2.yeah.net
- * UPDATE HISTORY:
+ * UPDATE HISTORY: 12 Jul 2008 (Pierre Schweitzer <heis_spiter(a)hotmail.com>)
+ * Replaced SEH support with PSEH support
*/
/* INCLUDES *****************************************************************/
@@ -16,6 +17,18 @@
extern PEXT2_GLOBAL Ext2Global;
/* DEFINITIONS *************************************************************/
+
+VOID
+Ext2CloseFinal (
+ IN PEXT2_IRP_CONTEXT IrpContext,
+ IN PNTSTATUS pStatus,
+ IN PEXT2_VCB Vcb,
+ IN BOOLEAN VcbResourceAcquired,
+ IN PEXT2_FCB Fcb,
+ IN BOOLEAN FcbResourceAcquired,
+ IN BOOLEAN bDeleteVcb,
+ IN BOOLEAN bBeingClosed,
+ IN BOOLEAN bSkipLeave );
#ifdef ALLOC_PRAGMA
#pragma alloc_text(PAGE, Ext2Close)
@@ -23,22 +36,107 @@
#pragma alloc_text(PAGE, Ext2DeQueueCloseRequest)
#endif
+
+/* FUNCTIONS ***************************************************************/
+
+
+_SEH_DEFINE_LOCALS(Ext2CloseFinal)
+{
+ PEXT2_IRP_CONTEXT IrpContext;
+ PNTSTATUS pStatus;
+ PEXT2_VCB Vcb;
+ BOOLEAN VcbResourceAcquired;
+ PEXT2_FCB Fcb;
+ BOOLEAN FcbResourceAcquired;
+ BOOLEAN bDeleteVcb;
+ BOOLEAN bBeingClosed;
+ BOOLEAN bSkipLeave;
+};
+
+_SEH_FINALLYFUNC(Ext2CloseFinal_PSEH)
+{
+ _SEH_ACCESS_LOCALS(Ext2CloseFinal);
+ Ext2CloseFinal(_SEH_VAR(IrpContext), _SEH_VAR(pStatus), _SEH_VAR(Vcb),
+ _SEH_VAR(VcbResourceAcquired), _SEH_VAR(Fcb),
+ _SEH_VAR(FcbResourceAcquired), _SEH_VAR(bDeleteVcb),
+ _SEH_VAR(bBeingClosed), _SEH_VAR(bSkipLeave));
+}
+
+VOID
+Ext2CloseFinal (
+ IN PEXT2_IRP_CONTEXT IrpContext,
+ IN PNTSTATUS pStatus,
+ IN PEXT2_VCB Vcb,
+ IN BOOLEAN VcbResourceAcquired,
+ IN PEXT2_FCB Fcb,
+ IN BOOLEAN FcbResourceAcquired,
+ IN BOOLEAN bDeleteVcb,
+ IN BOOLEAN bBeingClosed,
+ IN BOOLEAN bSkipLeave
+ )
+{
+ if (bSkipLeave && !bBeingClosed) {
+ ClearFlag(Vcb->Flags, VCB_BEING_CLOSED);
+ }
+
+ if (FcbResourceAcquired) {
+ ExReleaseResourceLite(&Fcb->MainResource);
+ }
+
+ if (VcbResourceAcquired) {
+ ExReleaseResourceLite(&Vcb->MainResource);
+ }
+
+ if (!IrpContext->ExceptionInProgress) {
+
+ if (*pStatus == STATUS_PENDING) {
+
+ Ext2QueueCloseRequest(IrpContext);
+
+ } else {
+
+ Ext2CompleteIrpContext(IrpContext, *pStatus);
+
+ if (bDeleteVcb) {
+
+ PVPB Vpb = Vcb->Vpb;
+ DEBUG(DL_DBG, ( "Ext2Close: Try to free Vcb %p and Vpb %p\n",
+ Vcb, Vpb));
+
+ if (Ext2CheckDismount(IrpContext, Vcb, FALSE)) {
+ if ((Vpb->RealDevice->Vpb != Vpb) &&
+ !IsFlagOn(Vpb->Flags, VPB_PERSISTENT)) {
+ DEC_MEM_COUNT(PS_VPB, Vpb, sizeof(VPB));
+ DEBUG(DL_DBG, ( "Ext2Close: freeing Vpb %p\n", Vpb));
+ ExFreePoolWithTag(Vpb, TAG_VPB);
+ }
+ Ext2ClearVpbFlag(Vcb->Vpb, VPB_MOUNTED);
+ }
+ }
+ }
+ }
+}
+
NTSTATUS
Ext2Close (IN PEXT2_IRP_CONTEXT IrpContext)
{
PDEVICE_OBJECT DeviceObject;
NTSTATUS Status = STATUS_SUCCESS;
PEXT2_VCB Vcb;
- BOOLEAN VcbResourceAcquired = FALSE;
PFILE_OBJECT FileObject;
PEXT2_FCB Fcb;
- BOOLEAN FcbResourceAcquired = FALSE;
PEXT2_CCB Ccb;
- BOOLEAN bDeleteVcb = FALSE;
- BOOLEAN bBeingClosed = FALSE;
- BOOLEAN bSkipLeave = FALSE;
-
- __try {
+
+ _SEH_TRY {
+
+ _SEH_DECLARE_LOCALS(Ext2CloseFinal);
+ _SEH_VAR(IrpContext) = IrpContext;
+ _SEH_VAR(pStatus) = &Status;
+ _SEH_VAR(VcbResourceAcquired) = FALSE;
+ _SEH_VAR(FcbResourceAcquired) = FALSE;
+ _SEH_VAR(bDeleteVcb) = FALSE;
+ _SEH_VAR(bBeingClosed) = FALSE;
+ _SEH_VAR(bSkipLeave) = FALSE;
ASSERT(IrpContext != NULL);
ASSERT((IrpContext->Identifier.Type == EXT2ICX) &&
@@ -47,10 +145,11 @@
DeviceObject = IrpContext->DeviceObject;
if (IsExt2FsDevice(DeviceObject)) {
Status = STATUS_SUCCESS;
- __leave;
+ _SEH_LEAVE;
}
Vcb = (PEXT2_VCB) DeviceObject->DeviceExtension;
+ _SEH_VAR(Vcb) = Vcb;
ASSERT(Vcb != NULL);
ASSERT((Vcb->Identifier.Type == EXT2VCB) &&
(Vcb->Identifier.Size == sizeof(EXT2_VCB)));
@@ -62,31 +161,33 @@
Vcb->OpenFileHandleCount, Vcb->ReferenceCount));
Status = STATUS_PENDING;
- __leave;
- }
- VcbResourceAcquired = TRUE;
-
- bSkipLeave = TRUE;
+ _SEH_LEAVE;
+ }
+ _SEH_VAR(VcbResourceAcquired) = TRUE;
+
+ _SEH_VAR(bSkipLeave) = TRUE;
if (IsFlagOn(Vcb->Flags, VCB_BEING_CLOSED)) {
- bBeingClosed = TRUE;
+ _SEH_VAR(bBeingClosed) = TRUE;
} else {
SetLongFlag(Vcb->Flags, VCB_BEING_CLOSED);
- bBeingClosed = FALSE;
+ _SEH_VAR(bBeingClosed) = FALSE;
}
if (IsFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_DELAY_CLOSE)) {
FileObject = NULL;
Fcb = IrpContext->Fcb;
+ _SEH_VAR(Fcb) = Fcb;
Ccb = IrpContext->Ccb;
} else {
FileObject = IrpContext->FileObject;
Fcb = (PEXT2_FCB) FileObject->FsContext;
+ _SEH_VAR(Fcb) = Fcb;
if (!Fcb) {
Status = STATUS_SUCCESS;
- __leave;
+ _SEH_LEAVE;
}
ASSERT(Fcb != NULL);
Ccb = (PEXT2_CCB) FileObject->FsContext2;
@@ -94,13 +195,13 @@
DEBUG(DL_DBG, ( "Ext2Close: (VCB) bBeingClosed = %d Vcb = %p ReferCount =
%d\n",
- bBeingClosed, Vcb, Vcb->ReferenceCount));
+ _SEH_VAR(bBeingClosed), Vcb, Vcb->ReferenceCount));
if (Fcb->Identifier.Type == EXT2VCB) {
- if ((!bBeingClosed) && (Vcb->ReferenceCount <= 1)&&
+ if ((!_SEH_VAR(bBeingClosed)) && (Vcb->ReferenceCount <=
1)&&
(!IsMounted(Vcb) || IsDispending(Vcb))) {
- bDeleteVcb = TRUE;
+ _SEH_VAR(bDeleteVcb) = TRUE;
}
if (Ccb) {
@@ -114,27 +215,27 @@
}
Status = STATUS_SUCCESS;
- __leave;
+ _SEH_LEAVE;
}
if ( Fcb->Identifier.Type != EXT2FCB ||
Fcb->Identifier.Size != sizeof(EXT2_FCB)) {
- __leave;
+ _SEH_LEAVE;
}
if (!ExAcquireResourceExclusiveLite(
&Fcb->MainResource,
IsFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_WAIT) )) {
Status = STATUS_PENDING;
- __leave;
- }
- FcbResourceAcquired = TRUE;
+ _SEH_LEAVE;
+ }
+ _SEH_VAR(FcbResourceAcquired) = TRUE;
Fcb->Header.IsFastIoPossible = FastIoIsNotPossible;
if (!Ccb) {
Status = STATUS_SUCCESS;
- __leave;
+ _SEH_LEAVE;
}
ASSERT((Ccb->Identifier.Type == EXT2CCB) &&
@@ -144,14 +245,14 @@
SetFlag(IrpContext->Flags, IRP_CONTEXT_FLAG_FILE_BUSY);
DEBUG(DL_USR, ( "Ext2Close: busy bit set: %wZ\n",
&Fcb->Mcb->FullName ));
Status = STATUS_PENDING;
- __leave;
+ _SEH_LEAVE;
}
Ext2DerefXcb(&Vcb->ReferenceCount);
- if ((!bBeingClosed) && !Vcb->ReferenceCount &&
+ if ((!_SEH_VAR(bBeingClosed)) && !Vcb->ReferenceCount &&
(!IsMounted(Vcb) || IsDispending(Vcb))) {
- bDeleteVcb = TRUE;
+ _SEH_VAR(bDeleteVcb) = TRUE;
DEBUG(DL_DBG, ( "Ext2Close: Vcb is being released.\n"));
}
@@ -173,9 +274,9 @@
// Remove Fcb from Vcb->FcbList ...
//
- if (FcbResourceAcquired) {
+ if (_SEH_VAR(FcbResourceAcquired)) {
ExReleaseResourceLite(&Fcb->MainResource);
- FcbResourceAcquired = FALSE;
+ _SEH_VAR(FcbResourceAcquired) = FALSE;
}
Ext2FreeFcb(Fcb);
@@ -187,49 +288,9 @@
Status = STATUS_SUCCESS;
- } __finally {
-
- if (bSkipLeave && !bBeingClosed) {
- ClearFlag(Vcb->Flags, VCB_BEING_CLOSED);
- }
-
- if (FcbResourceAcquired) {
- ExReleaseResourceLite(&Fcb->MainResource);
- }
-
- if (VcbResourceAcquired) {
- ExReleaseResourceLite(&Vcb->MainResource);
- }
-
- if (!IrpContext->ExceptionInProgress) {
-
- if (Status == STATUS_PENDING) {
-
- Ext2QueueCloseRequest(IrpContext);
-
- } else {
-
- Ext2CompleteIrpContext(IrpContext, Status);
-
- if (bDeleteVcb) {
-
- PVPB Vpb = Vcb->Vpb;
- DEBUG(DL_DBG, ( "Ext2Close: Try to free Vcb %p and Vpb
%p\n",
- Vcb, Vpb));
-
- if (Ext2CheckDismount(IrpContext, Vcb, FALSE)) {
- if ((Vpb->RealDevice->Vpb != Vpb) &&
- !IsFlagOn(Vpb->Flags, VPB_PERSISTENT)) {
- DEC_MEM_COUNT(PS_VPB, Vpb, sizeof(VPB));
- DEBUG(DL_DBG, ( "Ext2Close: freeing Vpb %p\n",
Vpb));
- ExFreePoolWithTag(Vpb, TAG_VPB);
- }
- Ext2ClearVpbFlag(Vcb->Vpb, VPB_MOUNTED);
- }
- }
- }
- }
- }
+ }
+ _SEH_FINALLY(Ext2CloseFinal_PSEH)
+ _SEH_END;
return Status;
}
@@ -266,6 +327,19 @@
ExQueueWorkItem(&IrpContext->WorkQueueItem, DelayedWorkQueue);
}
+_SEH_DEFINE_LOCALS(Ext2ExceptionFilter)
+{
+ PEXT2_IRP_CONTEXT IrpContext;
+};
+
+_SEH_FILTER(Ext2ExceptionFilter_PSEH)
+{
+ _SEH_ACCESS_LOCALS(Ext2ExceptionFilter);
+ return Ext2ExceptionFilter(_SEH_VAR(IrpContext), _SEH_GetExceptionPointers());
+}
+
+_SEH_WRAP_FINALLY(FsRtlExitFileSystem_PSEH_finally, FsRtlExitFileSystem);
+
VOID
Ext2DeQueueCloseRequest (IN PVOID Context)
{
@@ -276,20 +350,24 @@
ASSERT((IrpContext->Identifier.Type == EXT2ICX) &&
(IrpContext->Identifier.Size == sizeof(EXT2_IRP_CONTEXT)));
- __try {
-
- __try {
+ _SEH_TRY {
+
+ _SEH_DECLARE_LOCALS(Ext2ExceptionFilter);
+ _SEH_VAR(IrpContext) = IrpContext;
+
+ _SEH_TRY {
FsRtlEnterFileSystem();
Ext2Close(IrpContext);
- } __except (Ext2ExceptionFilter(IrpContext, GetExceptionInformation())) {
+ }
+ _SEH_EXCEPT(Ext2ExceptionFilter_PSEH) {
Ext2ExceptionHandler(IrpContext);
}
-
- } __finally {
-
- FsRtlExitFileSystem();
- }
-}
+ _SEH_END;
+
+ }
+ _SEH_FINALLY(FsRtlExitFileSystem_PSEH_finally)
+ _SEH_END;
+}
Modified: branches/pierre-fsd/drivers/filesystems/ext3fsd/debug.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/drivers/filesystems/…
==============================================================================
--- branches/pierre-fsd/drivers/filesystems/ext3fsd/debug.c [iso-8859-1] (original)
+++ branches/pierre-fsd/drivers/filesystems/ext3fsd/debug.c [iso-8859-1] Sat Jul 12
04:56:52 2008
@@ -4,7 +4,8 @@
* FILE: Debug.c
* PROGRAMMER: Matt Wu <mattwu(a)163.com>
* HOMEPAGE:
http://ext2.yeah.net
- * UPDATE HISTORY:
+ * UPDATE HISTORY: 12 Jul 2008 (Pierre Schweitzer <heis_spiter(a)hotmail.com>)
+ * Fixed some warnings under GCC
*/
/* INCLUDES **************************************************************/
@@ -36,7 +37,7 @@
/* Static Definitions ****************************************************/
-static PUCHAR IrpMjStrings[] = {
+static PCHAR IrpMjStrings[] = {
"IRP_MJ_CREATE",
"IRP_MJ_CREATE_NAMED_PIPE",
"IRP_MJ_CLOSE",
@@ -67,7 +68,7 @@
"IRP_MJ_PNP"
};
-static PUCHAR FileInformationClassStrings[] = {
+static PCHAR FileInformationClassStrings[] = {
"Unknown FileInformationClass 0",
"FileDirectoryInformation",
"FileFullDirectoryInformation",
@@ -107,7 +108,7 @@
"FileTrackingInformation"
};
-static PUCHAR FsInformationClassStrings[] = {
+static PCHAR FsInformationClassStrings[] = {
"Unknown FsInformationClass 0",
"FileFsVolumeInformation",
"FileFsLabelInformation",
@@ -742,7 +743,7 @@
}
}
-PUCHAR
+PCHAR
Ext2NtStatusToString ( IN NTSTATUS Status )
{
switch (Status) {