@@ -17,7 +17,7 @@ Module Name:
17
17
18
18
--*/
19
19
20
- #include "CdProcs .h"
20
+ #include "cdprocs .h"
21
21
22
22
#ifdef CD_SANITY
23
23
BOOLEAN CdTestTopLevel = TRUE;
@@ -287,7 +287,7 @@ Return Value:
287
287
// Use a try-except to handle the exception cases.
288
288
//
289
289
290
- try {
290
+ _SEH2_TRY {
291
291
292
292
//
293
293
// If the IrpContext is NULL then this is the first pass through
@@ -436,10 +436,10 @@ Return Value:
436
436
CdCompleteRequest ( IrpContext , Irp , Status );
437
437
}
438
438
439
- } except ( CdExceptionFilter ( IrpContext , GetExceptionInformation () )) {
439
+ } _SEH2_EXCEPT ( CdExceptionFilter ( IrpContext , _SEH2_GetExceptionInformation () )) {
440
440
441
- Status = CdProcessException ( IrpContext , Irp , GetExceptionCode () );
442
- }
441
+ Status = CdProcessException ( IrpContext , Irp , _SEH2_GetExceptionCode () );
442
+ } _SEH2_END ;
443
443
444
444
} while (Status == STATUS_CANT_WAIT );
445
445
@@ -597,7 +597,9 @@ Return Value:
597
597
598
598
if (TestStatus && !FsRtlIsNtstatusExpected ( ExceptionCode )) {
599
599
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
601
603
CdBugCheck ( (ULONG_PTR ) ExceptionPointer -> ExceptionRecord ,
602
604
(ULONG_PTR ) ExceptionPointer -> ContextRecord ,
603
605
(ULONG_PTR ) ExceptionPointer -> ExceptionRecord -> ExceptionAddress );
@@ -686,7 +688,7 @@ Return Value:
686
688
// Note that (children of) CdFsdPostRequest can raise (Mdl allocation).
687
689
//
688
690
689
- try {
691
+ _SEH2_TRY {
690
692
691
693
if (ExceptionCode == STATUS_CANT_WAIT ) {
692
694
@@ -702,11 +704,10 @@ Return Value:
702
704
ExceptionCode = CdFsdPostRequest ( IrpContext , Irp );
703
705
}
704
706
}
705
- except ( CdExceptionFilter ( IrpContext , GetExceptionInformation () )) {
706
-
707
- ExceptionCode = GetExceptionCode ();
708
- }
707
+ _SEH2_EXCEPT ( CdExceptionFilter ( IrpContext , _SEH2_GetExceptionInformation () )) {
709
708
709
+ ExceptionCode = _SEH2_GetExceptionCode ();
710
+ } _SEH2_END ;
710
711
//
711
712
// If we posted the request or our caller will retry then just return here.
712
713
//
@@ -1009,6 +1010,10 @@ Return Value:
1009
1010
1010
1011
{
1011
1012
PTHREAD_CONTEXT CurrentThreadContext ;
1013
+ #ifdef __REACTOS__
1014
+ ULONG_PTR StackTop ;
1015
+ ULONG_PTR StackBottom ;
1016
+ #endif
1012
1017
1013
1018
PAGED_CODE ();
1014
1019
@@ -1040,9 +1045,21 @@ Return Value:
1040
1045
// If this is not a valid Cdfs context then use the input thread
1041
1046
// context and store it in the top level context.
1042
1047
//
1048
+
1049
+ #ifdef __REACTOS__
1050
+ IoGetStackLimits ( & StackTop , & StackBottom );
1051
+ #endif
1052
+
1053
+ #ifdef _MSC_VER
1043
1054
#pragma warning(suppress: 6011) // Bug in PREFast around bitflag operations
1055
+ #endif
1044
1056
if (FlagOn ( IrpContext -> Flags , IRP_CONTEXT_FLAG_TOP_LEVEL ) ||
1057
+ #ifndef __REACTOS__
1045
1058
(!IoWithinStackLimits ( (ULONG_PTR )CurrentThreadContext , sizeof ( THREAD_CONTEXT ) ) ||
1059
+ #else
1060
+ (((ULONG_PTR ) CurrentThreadContext > StackBottom - sizeof ( THREAD_CONTEXT )) ||
1061
+ ((ULONG_PTR ) CurrentThreadContext <= StackTop ) ||
1062
+ #endif
1046
1063
FlagOn ( (ULONG_PTR ) CurrentThreadContext , 0x3 ) ||
1047
1064
(CurrentThreadContext -> Cdfs != 0x53464443 ))) {
1048
1065
@@ -1073,6 +1090,7 @@ _Function_class_(FAST_IO_CHECK_IF_POSSIBLE)
1073
1090
_IRQL_requires_same_
1074
1091
_Success_ (return != FALSE)
1075
1092
BOOLEAN
1093
+ NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
1076
1094
CdFastIoCheckIfPossible (
1077
1095
_In_ PFILE_OBJECT FileObject ,
1078
1096
_In_ PLARGE_INTEGER FileOffset ,
0 commit comments