Skip to content

Commit 5429771

Browse files
gigaherzHeisSpiter
authored andcommitted
[CDFS_NEW] Re-apply many of the reactos-specific changes and fix build.
- Also, get rid of the old diff file.
1 parent fd34548 commit 5429771

32 files changed

+541
-1198
lines changed

drivers/filesystems/cdfs_new/allocsup.c

Lines changed: 6 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
@@ -86,8 +86,10 @@ CdDiskOffsetFromMcbEntry (
8686

8787
_Requires_lock_held_(_Global_critical_region_)
8888
VOID
89+
#ifdef _MSC_VER
8990
// PREFast currently has no way to express the Fcb==Fcb->Vcb->VolumeDasdFcb early return
9091
#pragma warning(suppress: 6001 6101)
92+
#endif
9193
CdLookupAllocation (
9294
_In_ PIRP_CONTEXT IrpContext,
9395
_In_ PFCB Fcb,
@@ -164,7 +166,7 @@ Return Value:
164166
// Use a try finally to facilitate cleanup.
165167
//
166168

167-
try {
169+
_SEH2_TRY {
168170

169171
//
170172
// We use a loop to perform the lookup. If we don't find the mapping in the
@@ -308,7 +310,7 @@ Return Value:
308310
FirstPass = FALSE;
309311
}
310312

311-
} finally {
313+
} _SEH2_FINALLY {
312314

313315
if (CleanupParent) {
314316

@@ -323,7 +325,7 @@ Return Value:
323325
}
324326

325327
if (UnlockFcb) { CdUnlockFcb( IrpContext, Fcb ); }
326-
}
328+
} _SEH2_END;
327329

328330
return;
329331
}

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
@@ -95,7 +95,7 @@ Return Value:
9595
// Use a try-finally to facilitate cleanup.
9696
//
9797

98-
try {
98+
_SEH2_TRY {
9999

100100
//
101101
// Create the internal stream. The Vpb should be pointing at our volume
@@ -281,7 +281,7 @@ Return Value:
281281
}
282282
}
283283

284-
} finally {
284+
} _SEH2_FINALLY {
285285

286286
//
287287
// Cleanup any dirent structures we may have used.
@@ -323,7 +323,7 @@ Return Value:
323323
}
324324

325325
CdUnlockFcb( IrpContext, Fcb );
326-
}
326+
} _SEH2_END;
327327

328328
return;
329329
}

drivers/filesystems/cdfs_new/cddata.c

Lines changed: 29 additions & 11 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;
@@ -287,7 +287,7 @@ Return Value:
287287
// Use a try-except to handle the exception cases.
288288
//
289289

290-
try {
290+
_SEH2_TRY {
291291

292292
//
293293
// If the IrpContext is NULL then this is the first pass through
@@ -436,10 +436,10 @@ Return Value:
436436
CdCompleteRequest( IrpContext, Irp, Status );
437437
}
438438

439-
} except( CdExceptionFilter( IrpContext, GetExceptionInformation() )) {
439+
} _SEH2_EXCEPT( CdExceptionFilter( IrpContext, _SEH2_GetExceptionInformation() )) {
440440

441-
Status = CdProcessException( IrpContext, Irp, GetExceptionCode() );
442-
}
441+
Status = CdProcessException( IrpContext, Irp, _SEH2_GetExceptionCode() );
442+
} _SEH2_END;
443443

444444
} while (Status == STATUS_CANT_WAIT);
445445

@@ -597,7 +597,9 @@ Return Value:
597597

598598
if (TestStatus && !FsRtlIsNtstatusExpected( ExceptionCode )) {
599599

600-
#pragma prefast( suppress: __WARNING_USE_OTHER_FUNCTION, "We're corrupted." )
600+
#ifdef _MSC_VER
601+
#pragma prefast( suppress: __WARNING_USE_OTHER_FUNCTION, "We're corrupted." )
602+
#endif
601603
CdBugCheck( (ULONG_PTR) ExceptionPointer->ExceptionRecord,
602604
(ULONG_PTR) ExceptionPointer->ContextRecord,
603605
(ULONG_PTR) ExceptionPointer->ExceptionRecord->ExceptionAddress );
@@ -686,7 +688,7 @@ Return Value:
686688
// Note that (children of) CdFsdPostRequest can raise (Mdl allocation).
687689
//
688690

689-
try {
691+
_SEH2_TRY {
690692

691693
if (ExceptionCode == STATUS_CANT_WAIT) {
692694

@@ -702,11 +704,10 @@ Return Value:
702704
ExceptionCode = CdFsdPostRequest( IrpContext, Irp );
703705
}
704706
}
705-
except( CdExceptionFilter( IrpContext, GetExceptionInformation() )) {
706-
707-
ExceptionCode = GetExceptionCode();
708-
}
707+
_SEH2_EXCEPT( CdExceptionFilter( IrpContext, _SEH2_GetExceptionInformation() )) {
709708

709+
ExceptionCode = _SEH2_GetExceptionCode();
710+
} _SEH2_END;
710711
//
711712
// If we posted the request or our caller will retry then just return here.
712713
//
@@ -1009,6 +1010,10 @@ Return Value:
10091010

10101011
{
10111012
PTHREAD_CONTEXT CurrentThreadContext;
1013+
#ifdef __REACTOS__
1014+
ULONG_PTR StackTop;
1015+
ULONG_PTR StackBottom;
1016+
#endif
10121017

10131018
PAGED_CODE();
10141019

@@ -1040,9 +1045,21 @@ Return Value:
10401045
// If this is not a valid Cdfs context then use the input thread
10411046
// context and store it in the top level context.
10421047
//
1048+
1049+
#ifdef __REACTOS__
1050+
IoGetStackLimits( &StackTop, &StackBottom);
1051+
#endif
1052+
1053+
#ifdef _MSC_VER
10431054
#pragma warning(suppress: 6011) // Bug in PREFast around bitflag operations
1055+
#endif
10441056
if (FlagOn( IrpContext->Flags, IRP_CONTEXT_FLAG_TOP_LEVEL ) ||
1057+
#ifndef __REACTOS__
10451058
(!IoWithinStackLimits( (ULONG_PTR)CurrentThreadContext, sizeof( THREAD_CONTEXT ) ) ||
1059+
#else
1060+
(((ULONG_PTR) CurrentThreadContext > StackBottom - sizeof( THREAD_CONTEXT )) ||
1061+
((ULONG_PTR) CurrentThreadContext <= StackTop) ||
1062+
#endif
10461063
FlagOn( (ULONG_PTR) CurrentThreadContext, 0x3 ) ||
10471064
(CurrentThreadContext->Cdfs != 0x53464443))) {
10481065

@@ -1073,6 +1090,7 @@ _Function_class_(FAST_IO_CHECK_IF_POSSIBLE)
10731090
_IRQL_requires_same_
10741091
_Success_(return != FALSE)
10751092
BOOLEAN
1093+
NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
10761094
CdFastIoCheckIfPossible (
10771095
_In_ PFILE_OBJECT FileObject,
10781096
_In_ PLARGE_INTEGER FileOffset,

0 commit comments

Comments
 (0)