Skip to content

Commit 1fa758a

Browse files
committed
[CDFS_NEW]
- "Convert" to PSEH2 + unix compilation friendliness - Use svn path=/branches/TransitionPte/; revision=71388
1 parent 30aaf80 commit 1fa758a

30 files changed

+218
-206
lines changed

drivers/filesystems/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

2-
add_subdirectory(cdfs)
2+
#add_subdirectory(cdfs)
3+
add_subdirectory(cdfs_new)
34
add_subdirectory(ext2)
45
add_subdirectory(fastfat)
56
#add_subdirectory(fastfat_new)

drivers/filesystems/cdfs_new/allocsup.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Module Name:
4444
4545
--*/
4646

47-
#include "CdProcs.h"
47+
#include "cdprocs.h"
4848

4949
//
5050
// The Bug check file id for this module
@@ -149,7 +149,7 @@ Return Value:
149149
// Use a try finally to facilitate cleanup.
150150
//
151151

152-
try {
152+
_SEH2_TRY {
153153

154154
//
155155
// We use a loop to perform the lookup. If we don't find the mapping in the
@@ -296,7 +296,7 @@ Return Value:
296296
FirstPass = FALSE;
297297
}
298298

299-
} finally {
299+
} _SEH2_FINALLY {
300300

301301
if (CleanupParent) {
302302

@@ -311,7 +311,7 @@ Return Value:
311311
}
312312

313313
if (UnlockFcb) { CdUnlockFcb( IrpContext, Fcb ); }
314-
}
314+
} _SEH2_END
315315

316316
return;
317317
}

drivers/filesystems/cdfs_new/cachesup.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Module Name:
1414
1515
--*/
1616

17-
#include "CdProcs.h"
17+
#include "cdprocs.h"
1818

1919
//
2020
// The Bug check file id for this module
@@ -94,7 +94,7 @@ Return Value:
9494
// Use a try-finally to facilitate cleanup.
9595
//
9696

97-
try {
97+
_SEH2_TRY {
9898

9999
//
100100
// Create the internal stream. The Vpb should be pointing at our volume
@@ -272,7 +272,7 @@ Return Value:
272272
}
273273
}
274274

275-
} finally {
275+
} _SEH2_FINALLY {
276276

277277
//
278278
// Cleanup any dirent structures we may have used.
@@ -306,7 +306,7 @@ Return Value:
306306
}
307307

308308
CdUnlockFcb( IrpContext, Fcb );
309-
}
309+
} _SEH2_END
310310

311311
return;
312312
}

drivers/filesystems/cdfs_new/cddata.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Module Name:
1717
1818
--*/
1919

20-
#include "CdProcs.h"
20+
#include "cdprocs.h"
2121

2222
#ifdef CD_SANITY
2323
BOOLEAN CdTestTopLevel = TRUE;
@@ -259,7 +259,7 @@ Return Value:
259259
// Use a try-except to handle the exception cases.
260260
//
261261

262-
try {
262+
_SEH2_TRY {
263263

264264
//
265265
// If the IrpContext is NULL then this is the first pass through
@@ -398,10 +398,10 @@ Return Value:
398398
CdCompleteRequest( IrpContext, Irp, Status );
399399
}
400400

401-
} except( CdExceptionFilter( IrpContext, GetExceptionInformation() )) {
401+
} _SEH2_EXCEPT( CdExceptionFilter( IrpContext, _exception_info() )) {
402402

403-
Status = CdProcessException( IrpContext, Irp, GetExceptionCode() );
404-
}
403+
Status = CdProcessException( IrpContext, Irp, _exception_code() );
404+
} _SEH2_END
405405

406406
} while (Status == STATUS_CANT_WAIT);
407407

@@ -653,7 +653,7 @@ Return Value:
653653
// Note that (children of) CdFsdPostRequest can raise (Mdl allocation).
654654
//
655655

656-
try {
656+
_SEH2_TRY {
657657

658658
if (ExceptionCode == STATUS_CANT_WAIT) {
659659

@@ -670,10 +670,10 @@ Return Value:
670670
}
671671
}
672672
}
673-
except( CdExceptionFilter( IrpContext, GetExceptionInformation() )) {
673+
_SEH2_EXCEPT( CdExceptionFilter( IrpContext, _exception_info() )) {
674674

675-
ExceptionCode = GetExceptionCode();
676-
}
675+
ExceptionCode = _exception_code();
676+
} _SEH2_END
677677

678678
//
679679
// If we posted the request or our caller will retry then just return here.

drivers/filesystems/cdfs_new/cdinit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Module Name:
1313
1414
--*/
1515

16-
#include "CdProcs.h"
16+
#include "cdprocs.h"
1717

1818
//
1919
// The Bug check file id for this module

drivers/filesystems/cdfs_new/cdprocs.h

Lines changed: 29 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ Module Name:
2828
#endif
2929

3030
#include "nodetype.h"
31-
#include "Cd.h"
32-
#include "CdStruc.h"
33-
#include "CdData.h"
31+
#include "cd.h"
32+
#include "cdstruc.h"
33+
#include "cddata.h"
34+
35+
#include <pseh/pseh2.h>
3436

3537

3638
//**** x86 compiler bug ****
@@ -44,30 +46,28 @@ Module Name:
4446
// Here are the different pool tags.
4547
//
4648

47-
/* ReactOS Change: GCC doesn't understand this, use TAG macro */
48-
#include <reactos/helper.h>
49-
#define TAG_CCB TAG('c','c','d','C') // Ccb
50-
#define TAG_CDROM_TOC TAG('c','t','d','C') // TOC
51-
#define TAG_DIRENT_NAME TAG('n','d','d','C') // CdName in dirent
52-
#define TAG_ENUM_EXPRESSION TAG('e','e','d','C') // Search expression for enumeration
53-
#define TAG_FCB_DATA TAG('d','f','d','C') // Data Fcb
54-
#define TAG_FCB_INDEX TAG('i','f','d','C') // Index Fcb
55-
#define TAG_FCB_NONPAGED TAG('n','f','d','C') // Nonpaged Fcb
56-
#define TAG_FCB_TABLE TAG('t','f','d','C') // Fcb Table entry
57-
#define TAG_FILE_NAME TAG('n','F','d','C') // Filename buffer
58-
#define TAG_GEN_SHORT_NAME TAG('s','g','d','C') // Generated short name
59-
#define TAG_IO_BUFFER TAG('f','b','d','C') // Temporary IO buffer
60-
#define TAG_IO_CONTEXT TAG('o','i','d','C') // Io context for async reads
61-
#define TAG_IRP_CONTEXT TAG('c','i','d','C') // Irp Context
62-
#define TAG_IRP_CONTEXT_LITE TAG('l','i','d','C') // Irp Context lite
63-
#define TAG_MCB_ARRAY TAG('a','m','d','C') // Mcb array
64-
#define TAG_PATH_ENTRY_NAME TAG('n','P','d','C') // CdName in path entry
65-
#define TAG_PREFIX_ENTRY TAG('e','p','d','C') // Prefix Entry
66-
#define TAG_PREFIX_NAME TAG('n','p','d','C') // Prefix Entry name
67-
#define TAG_SPANNING_PATH_TABLE TAG('p','s','d','C') // Buffer for spanning path table
68-
#define TAG_UPCASE_NAME TAG('n','u','d','C') // Buffer for upcased name
69-
#define TAG_VOL_DESC TAG('d','v','d','C') // Buffer for volume descriptor
70-
#define TAG_VPB TAG('p','v','d','C') // Vpb allocated in filesystem
49+
#define TAG_CCB 'ccdC' // Ccb
50+
#define TAG_CDROM_TOC 'ctdC' // TOC
51+
#define TAG_DIRENT_NAME 'nddC' // CdName in dirent
52+
#define TAG_ENUM_EXPRESSION 'eedC' // Search expression for enumeration
53+
#define TAG_FCB_DATA 'dfdC' // Data Fcb
54+
#define TAG_FCB_INDEX 'ifdC' // Index Fcb
55+
#define TAG_FCB_NONPAGED 'nfdC' // Nonpaged Fcb
56+
#define TAG_FCB_TABLE 'tfdC' // Fcb Table entry
57+
#define TAG_FILE_NAME 'nFdC' // Filename buffer
58+
#define TAG_GEN_SHORT_NAME 'sgdC' // Generated short name
59+
#define TAG_IO_BUFFER 'fbdC' // Temporary IO buffer
60+
#define TAG_IO_CONTEXT 'oidC' // Io context for async reads
61+
#define TAG_IRP_CONTEXT 'cidC' // Irp Context
62+
#define TAG_IRP_CONTEXT_LITE 'lidC' // Irp Context lite
63+
#define TAG_MCB_ARRAY 'amdC' // Mcb array
64+
#define TAG_PATH_ENTRY_NAME 'nPdC' // CdName in path entry
65+
#define TAG_PREFIX_ENTRY 'epdC' // Prefix Entry
66+
#define TAG_PREFIX_NAME 'npdC' // Prefix Entry name
67+
#define TAG_SPANNING_PATH_TABLE 'psdC' // Buffer for spanning path table
68+
#define TAG_UPCASE_NAME 'nudC' // Buffer for upcased name
69+
#define TAG_VOL_DESC 'dvdC' // Buffer for volume descriptor
70+
#define TAG_VPB 'pvdC' // Vpb allocated in filesystem
7171

7272
//
7373
// Tag all of our allocations if tagging is turned on
@@ -1883,16 +1883,9 @@ CdCommonPnp ( // Implemented in Pnp.c
18831883
//
18841884
// #define try_return(S) { S; goto try_exit; }
18851885
//
1886-
/* ReactOS Change: Remove SEH */
1887-
#define try
1888-
#define leave goto exitLabel;
1889-
#define finally if (0) goto exitLabel; exitLabel:
1890-
#define except(x) while (0)
1891-
#define GetExceptionCode() 0
1892-
#define AbnormalTermination() 0
18931886

1894-
#define try_return(S) { goto try_exit; }
1895-
#define try_leave(S) { leave; }
1887+
#define try_return(S) {S; goto try_exit; }
1888+
#define try_leave(S) {S; _SEH2_LEAVE; }
18961889

18971890

18981891
//

drivers/filesystems/cdfs_new/cleanup.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Module Name:
1414
1515
--*/
1616

17-
#include "CdProcs.h"
17+
#include "cdprocs.h"
1818

1919
//
2020
// The Bug check file id for this module
@@ -159,7 +159,7 @@ Return Value:
159159
// Use a try-finally to facilitate cleanup.
160160
//
161161

162-
//try { /* ReactOS Change: Manual removal of SEH since macros to hack around it don't allow multiple SEH usage within one function */
162+
_SEH2_TRY {
163163

164164
//
165165
// Case on the type of open that we are trying to cleanup.
@@ -279,15 +279,15 @@ Return Value:
279279

280280
IoRemoveShareAccess( FileObject, &Fcb->ShareAccess );
281281

282-
//} finally { /* ReactOS Change: Manual removal of SEH since macros to hack around it don't allow multiple SEH usage within one function */
282+
} _SEH2_FINALLY {
283283

284284
CdReleaseFcb( IrpContext, Fcb );
285285

286286
if (SendUnlockNotification) {
287287

288288
FsRtlNotifyVolumeEvent( FileObject, FSRTL_VOLUME_UNLOCK );
289289
}
290-
//} /* ReactOS Change: Manual removal of SEH since macros to hack around it don't allow multiple SEH usage within one function */
290+
} _SEH2_END
291291

292292
//
293293
// If appropriate, try to spark teardown by purging the volume. Should
@@ -305,19 +305,19 @@ Return Value:
305305

306306
CdAcquireCdData( IrpContext);
307307

308-
try {
308+
_SEH2_TRY {
309309

310310
CdAcquireVcbExclusive( IrpContext, Vcb, FALSE );
311311
VcbAcquired = TRUE;
312312

313313
CdPurgeVolume( IrpContext, Vcb, FALSE );
314314

315-
} finally {
315+
} _SEH2_FINALLY {
316316

317317
if (VcbAcquired) { CdReleaseVcb( IrpContext, Vcb ); }
318318

319319
CdReleaseCdData( IrpContext);
320-
}
320+
} _SEH2_END
321321
}
322322

323323
//

drivers/filesystems/cdfs_new/close.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Module Name:
4242
4343
--*/
4444

45-
#include "CdProcs.h"
45+
#include "cdprocs.h"
4646

4747
//
4848
// The Bug check file id for this module

0 commit comments

Comments
 (0)