- Also, get rid of the old diff file.
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
\f
_Requires_lock_held_(_Global_critical_region_)
VOID
+#ifdef _MSC_VER
// PREFast currently has no way to express the Fcb==Fcb->Vcb->VolumeDasdFcb early return
#pragma warning(suppress: 6001 6101)
+#endif
CdLookupAllocation (
_In_ PIRP_CONTEXT IrpContext,
_In_ PFCB Fcb,
// Use a try finally to facilitate cleanup.
//
- try {
+ _SEH2_TRY {
//
// We use a loop to perform the lookup. If we don't find the mapping in the
FirstPass = FALSE;
}
- } finally {
+ } _SEH2_FINALLY {
if (CleanupParent) {
}
if (UnlockFcb) { CdUnlockFcb( IrpContext, Fcb ); }
- }
+ } _SEH2_END;
return;
}
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
// Use a try-finally to facilitate cleanup.
//
- try {
+ _SEH2_TRY {
//
// Create the internal stream. The Vpb should be pointing at our volume
}
}
- } finally {
+ } _SEH2_FINALLY {
//
// Cleanup any dirent structures we may have used.
}
CdUnlockFcb( IrpContext, Fcb );
- }
+ } _SEH2_END;
return;
}
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
#ifdef CD_SANITY
BOOLEAN CdTestTopLevel = TRUE;
// Use a try-except to handle the exception cases.
//
- try {
+ _SEH2_TRY {
//
// If the IrpContext is NULL then this is the first pass through
CdCompleteRequest( IrpContext, Irp, Status );
}
- } except( CdExceptionFilter( IrpContext, GetExceptionInformation() )) {
+ } _SEH2_EXCEPT( CdExceptionFilter( IrpContext, _SEH2_GetExceptionInformation() )) {
- Status = CdProcessException( IrpContext, Irp, GetExceptionCode() );
- }
+ Status = CdProcessException( IrpContext, Irp, _SEH2_GetExceptionCode() );
+ } _SEH2_END;
} while (Status == STATUS_CANT_WAIT);
if (TestStatus && !FsRtlIsNtstatusExpected( ExceptionCode )) {
-#pragma prefast( suppress: __WARNING_USE_OTHER_FUNCTION, "We're corrupted." )
+#ifdef _MSC_VER
+#pragma prefast( suppress: __WARNING_USE_OTHER_FUNCTION, "We're corrupted." )
+#endif
CdBugCheck( (ULONG_PTR) ExceptionPointer->ExceptionRecord,
(ULONG_PTR) ExceptionPointer->ContextRecord,
(ULONG_PTR) ExceptionPointer->ExceptionRecord->ExceptionAddress );
// Note that (children of) CdFsdPostRequest can raise (Mdl allocation).
//
- try {
+ _SEH2_TRY {
if (ExceptionCode == STATUS_CANT_WAIT) {
ExceptionCode = CdFsdPostRequest( IrpContext, Irp );
}
}
- except( CdExceptionFilter( IrpContext, GetExceptionInformation() )) {
-
- ExceptionCode = GetExceptionCode();
- }
+ _SEH2_EXCEPT( CdExceptionFilter( IrpContext, _SEH2_GetExceptionInformation() )) {
+ ExceptionCode = _SEH2_GetExceptionCode();
+ } _SEH2_END;
//
// If we posted the request or our caller will retry then just return here.
//
{
PTHREAD_CONTEXT CurrentThreadContext;
+#ifdef __REACTOS__
+ ULONG_PTR StackTop;
+ ULONG_PTR StackBottom;
+#endif
PAGED_CODE();
// If this is not a valid Cdfs context then use the input thread
// context and store it in the top level context.
//
+
+#ifdef __REACTOS__
+ IoGetStackLimits( &StackTop, &StackBottom);
+#endif
+
+#ifdef _MSC_VER
#pragma warning(suppress: 6011) // Bug in PREFast around bitflag operations
+#endif
if (FlagOn( IrpContext->Flags, IRP_CONTEXT_FLAG_TOP_LEVEL ) ||
+#ifndef __REACTOS__
(!IoWithinStackLimits( (ULONG_PTR)CurrentThreadContext, sizeof( THREAD_CONTEXT ) ) ||
+#else
+ (((ULONG_PTR) CurrentThreadContext > StackBottom - sizeof( THREAD_CONTEXT )) ||
+ ((ULONG_PTR) CurrentThreadContext <= StackTop) ||
+#endif
FlagOn( (ULONG_PTR) CurrentThreadContext, 0x3 ) ||
(CurrentThreadContext->Cdfs != 0x53464443))) {
_IRQL_requires_same_
_Success_(return != FALSE)
BOOLEAN
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdFastIoCheckIfPossible (
_In_ PFILE_OBJECT FileObject,
_In_ PLARGE_INTEGER FileOffset,
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
DRIVER_INITIALIZE DriverEntry;
NTSTATUS
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
DriverEntry(
_In_ PDRIVER_OBJECT DriverObject,
_In_ PUNICODE_STRING RegistryPath
DRIVER_UNLOAD CdUnload;
VOID
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdUnload(
_In_ PDRIVER_OBJECT DriverObject
);
CdInitializeGlobalData (
_In_ PDRIVER_OBJECT DriverObject,
_In_ PDEVICE_OBJECT FileSystemDeviceObject
+#ifdef __REACTOS__
+ ,
+ IN PDEVICE_OBJECT HddFileSystemDeviceObject
+#endif
);
#ifdef ALLOC_PRAGMA
//
NTSTATUS
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
DriverEntry(
_In_ PDRIVER_OBJECT DriverObject,
_In_ PUNICODE_STRING RegistryPath
UNICODE_STRING UnicodeString;
PDEVICE_OBJECT CdfsFileSystemDeviceObject;
FS_FILTER_CALLBACKS FilterCallbacks;
+#ifdef __REACTOS__
+ PDEVICE_OBJECT HddFileSystemDeviceObject;
+#endif
UNREFERENCED_PARAMETER( RegistryPath );
return Status;
}
+#ifdef __REACTOS__
+ //
+ // Create the HDD device object.
+ //
+
+ RtlInitUnicodeString( &UnicodeString, L"\\CdfsHdd" );
+
+ Status = IoCreateDevice( DriverObject,
+ 0,
+ &UnicodeString,
+ FILE_DEVICE_DISK_FILE_SYSTEM,
+ 0,
+ FALSE,
+ &HddFileSystemDeviceObject );
+
+ if (!NT_SUCCESS( Status )) {
+ IoDeleteDevice (CdfsFileSystemDeviceObject);
+ return Status;
+ }
+#endif
+
+#ifdef _MSC_VER
#pragma prefast(push)
#pragma prefast(disable: 28155, "the dispatch routine has the correct type, prefast is just being paranoid.")
#pragma prefast(disable: 28168, "the dispatch routine has the correct type, prefast is just being paranoid.")
#pragma prefast(disable: 28169, "the dispatch routine has the correct type, prefast is just being paranoid.")
#pragma prefast(disable: 28175, "we're allowed to change these.")
+#endif
DriverObject->DriverUnload = CdUnload;
DriverObject->MajorFunction[IRP_MJ_CLEANUP] =
DriverObject->MajorFunction[IRP_MJ_PNP] =
DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = (PDRIVER_DISPATCH) CdFsdDispatch;
+#ifdef _MSC_VER
#pragma prefast(pop)
#pragma prefast(suppress: 28175, "this is a file system driver, we're allowed to touch FastIoDispatch.")
+#endif
DriverObject->FastIoDispatch = &CdFastIoDispatch;
//
if (!NT_SUCCESS( Status )) {
IoDeleteDevice( CdfsFileSystemDeviceObject );
+#ifdef __REACTOS__
+ IoDeleteDevice (HddFileSystemDeviceObject);
+#endif
return Status;
}
// Initialize the global data structures
//
+#ifndef __REACTOS__
Status = CdInitializeGlobalData( DriverObject, CdfsFileSystemDeviceObject );
+#else
+ Status = CdInitializeGlobalData( DriverObject, CdfsFileSystemDeviceObject, HddFileSystemDeviceObject );
+#endif
if (!NT_SUCCESS (Status)) {
IoDeleteDevice (CdfsFileSystemDeviceObject);
+#ifdef __REACTOS__
+ IoDeleteDevice (HddFileSystemDeviceObject);
+#endif
return Status;
}
//
CdfsFileSystemDeviceObject->Flags |= DO_LOW_PRIORITY_FILESYSTEM;
+#ifdef __REACTOS__
+ HddFileSystemDeviceObject->Flags |= DO_LOW_PRIORITY_FILESYSTEM;
+#endif
IoRegisterFileSystem( CdfsFileSystemDeviceObject );
ObReferenceObject (CdfsFileSystemDeviceObject);
+#ifdef __REACTOS__
+ IoRegisterFileSystem( HddFileSystemDeviceObject );
+ ObReferenceObject (HddFileSystemDeviceObject);
+#endif
#ifdef CDFS_TELEMETRY_DATA
//
VOID
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdUnload(
_In_ PDRIVER_OBJECT DriverObject
)
IoFreeWorkItem (CdData.CloseItem);
ExDeleteResourceLite( &CdData.DataResource );
ObDereferenceObject (CdData.FileSystemDeviceObject);
+#ifdef __REACTOS__
+ ObDereferenceObject (CdData.HddFileSystemDeviceObject);
+#endif
}
\f
//
CdInitializeGlobalData (
_In_ PDRIVER_OBJECT DriverObject,
_In_ PDEVICE_OBJECT FileSystemDeviceObject
+#ifdef __REACTOS__
+ ,
+ IN PDEVICE_OBJECT HddFileSystemDeviceObject
+#endif
)
/*++
CdFastIoDispatch.SizeOfFastIoDispatch = sizeof(FAST_IO_DISPATCH);
+#ifdef _MSC_VER
#pragma prefast(push)
#pragma prefast(disable:28155, "these are all correct")
+#endif
CdFastIoDispatch.FastIoCheckIfPossible = CdFastIoCheckIfPossible; // CheckForFastIo
CdFastIoDispatch.FastIoRead = FsRtlCopyRead; // Read
CdFastIoDispatch.FastIoUnlockSingle = CdFastUnlockSingle; // UnlockSingle
CdFastIoDispatch.FastIoUnlockAll = CdFastUnlockAll; // UnlockAll
CdFastIoDispatch.FastIoUnlockAllByKey = CdFastUnlockAllByKey; // UnlockAllByKey
-
//
// This callback has been replaced by CdFilterCallbackAcquireForCreateSection.
//
CdFastIoDispatch.PrepareMdlWrite = FsRtlPrepareMdlWriteDev;
CdFastIoDispatch.MdlWriteComplete = FsRtlMdlWriteCompleteDev;
+#ifdef _MSC_VER
#pragma prefast(pop)
+#endif
//
// Initialize the CdData structure.
CdData.DriverObject = DriverObject;
CdData.FileSystemDeviceObject = FileSystemDeviceObject;
+#ifdef __REACTOS__
+ CdData.HddFileSystemDeviceObject = HddFileSystemDeviceObject;
+#endif
InitializeListHead( &CdData.VcbQueue );
// Initialize the cache manager callback routines
//
- CdData.CacheManagerCallbacks.AcquireForLazyWrite = &CdAcquireForCache;
- CdData.CacheManagerCallbacks.ReleaseFromLazyWrite = &CdReleaseFromCache;
- CdData.CacheManagerCallbacks.AcquireForReadAhead = &CdAcquireForCache;
- CdData.CacheManagerCallbacks.ReleaseFromReadAhead = &CdReleaseFromCache;
+ CdData.CacheManagerCallbacks.AcquireForLazyWrite = (PVOID)&CdAcquireForCache;/* ReactOS Change: GCC "assignment from incompatible pointer type" */
+ CdData.CacheManagerCallbacks.ReleaseFromLazyWrite = (PVOID)&CdReleaseFromCache;/* ReactOS Change: GCC "assignment from incompatible pointer type" */
+ CdData.CacheManagerCallbacks.AcquireForReadAhead = (PVOID)&CdAcquireForCache;/* ReactOS Change: GCC "assignment from incompatible pointer type" */
+ CdData.CacheManagerCallbacks.ReleaseFromReadAhead = (PVOID)&CdReleaseFromCache;/* ReactOS Change: GCC "assignment from incompatible pointer type" */
CdData.CacheManagerVolumeCallbacks.AcquireForLazyWrite = &CdNoopAcquire;
CdData.CacheManagerVolumeCallbacks.ReleaseFromLazyWrite = &CdNoopRelease;
#ifndef _CDPROCS_
#define _CDPROCS_
+#ifdef _MSC_VER
#pragma warning( disable: 4127 ) // conditional expression is constant
#pragma warning( push )
#pragma warning( disable: 4201 ) // nonstandard extension used : nameless struct/union
#pragma warning( disable: 4214 ) // nonstandard extension used : bit field types
+#endif
#include <ntifs.h>
#include <ntddcdrm.h>
#include <ntdddisk.h>
#include <ntddscsi.h>
+#ifdef __REACTOS__
+#include <pseh/pseh2.h>
+#endif
#ifndef INLINE
#define INLINE __inline
#endif
#include "nodetype.h"
-#include "Cd.h"
-#include "CdStruc.h"
-#include "CdData.h"
+#include "cd.h"
+#include "cdstruc.h"
+#include "cddata.h"
#ifdef CDFS_TELEMETRY_DATA
#endif // CDFS_TELEMETRY_DATA
+#ifdef _MSC_VER
#pragma warning( pop )
+#endif
//**** x86 compiler bug ****
_In_ BOOLEAN DismountUnderway
);
+static /* ReactOS Change: GCC "multiple definition" */
+INLINE /* GCC only accepts __inline as the first modifier */
VOID
-INLINE
CdVerifyOrCreateDirStreamFile (
_In_ PIRP_CONTEXT IrpContext,
_In_ PFCB Fcb
// );
//
+#ifndef __REACTOS__
#define CdMapUserBuffer(IC, UB) { \
*(UB) = (PVOID) ( ((IC)->Irp->MdlAddress == NULL) ? \
(IC)->Irp->UserBuffer : \
} \
}
+#else
+#define CdMapUserBuffer(IC, UB) { \
+ *(UB) = (PVOID) ( ((IC)->Irp->MdlAddress == NULL) ? \
+ (IC)->Irp->UserBuffer : \
+ (MmGetSystemAddressForMdlSafe( (IC)->Irp->MdlAddress, NormalPagePriority))); \
+ if (NULL == *(UB)) { \
+ CdRaiseStatus( (IC), STATUS_INSUFFICIENT_RESOURCES); \
+ } \
+ }
+
+#endif
+
#define CdLockUserBuffer(IC,BL,OP) { \
if ((IC)->Irp->MdlAddress == NULL) { \
#endif
BOOLEAN
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdNoopAcquire (
_In_ PVOID Fcb,
_In_ BOOLEAN Wait
);
VOID
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdNoopRelease (
_In_ PVOID Fcb
);
_Requires_lock_held_(_Global_critical_region_)
_When_(return!=0, _Acquires_shared_lock_(*Fcb->Resource))
BOOLEAN
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdAcquireForCache (
_Inout_ PFCB Fcb,
_In_ BOOLEAN Wait
_Requires_lock_held_(_Global_critical_region_)
_Releases_lock_(*Fcb->Resource)
VOID
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdReleaseFromCache (
_Inout_ PFCB Fcb
);
_Requires_lock_held_(_Global_critical_region_)
NTSTATUS
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdFilterCallbackAcquireForCreateSection (
_In_ PFS_FILTER_CALLBACK_DATA CallbackData,
_Unreferenced_parameter_ PVOID *CompletionContext
_Function_class_(FAST_IO_RELEASE_FILE)
_Requires_lock_held_(_Global_critical_region_)
VOID
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdReleaseForCreateSection (
_In_ PFILE_OBJECT FileObject
);
sizeof( CD_IO_CONTEXT ), \
TAG_IO_CONTEXT )
-#define CdFreeIoContext(IO) CdFreePool( &(IO) )
+#define CdFreeIoContext(IO) CdFreePool( (PVOID) &(IO) ) /* ReactOS Change: GCC "passing argument 1 from incompatible pointer type" */
PFCB
CdLookupFcbTable (
//
#define CdPagedPool PagedPool
+#ifndef __REACTOS__
#define CdNonPagedPool NonPagedPoolNx
#define CdNonPagedPoolCacheAligned NonPagedPoolNxCacheAligned
+#else
+#define CdNonPagedPool NonPagedPool
+#define CdNonPagedPoolCacheAligned NonPagedPoolCacheAligned
+#endif
//
// Verification support routines. Contained in verfysup.c
//
-
+static /* ReactOS Change: GCC "multiple definition" */
INLINE
BOOLEAN
CdOperationIsDasdOpen (
_Requires_lock_held_(_Global_critical_region_)
VOID
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdPrePostIrp (
_Inout_ PIRP_CONTEXT IrpContext,
_Inout_ PIRP Irp
_Requires_lock_held_(_Global_critical_region_)
VOID
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdOplockComplete (
_Inout_ PIRP_CONTEXT IrpContext,
_Inout_ PIRP Irp
// otherwise
//
+/* GCC complains about multi-line comments.
//#ifndef BooleanFlagOn
//#define BooleanFlagOn(F,SF) ( \
// (BOOLEAN)(((F) & (SF)) != 0) \
// (Flags) &= ~(SingleFlag); \
//}
//#endif
+*/
//
// CAST
((ULONG) (L)) >> SECTOR_SHIFT \
)
+static /* ReactOS Change: GCC "multiple definition" */
INLINE
ULONG
SectorsFromLlBytes(
// #define try_return(S) { S; goto try_exit; }
//
+#ifndef __REACTOS__
#define try_return(S) { S; goto try_exit; }
#define try_leave(S) { S; leave; }
+#else
+#define try_return(S) { S; goto try_exit; }
+#define try_leave(S) { S; _SEH2_LEAVE; }
+#endif
//
// Encapsulate safe pool freeing
//
+/* ReactOS Change: GCC "passing argument 1 of CdFreePool from incompatible pointer type" */
+#define CdFreePool(x) _CdFreePool((PVOID*)(x))
+static /* ReactOS Change: GCC "multiple definition" */
INLINE
VOID
-CdFreePool(
+_CdFreePool(
_Inout_ _At_(*Pool, __drv_freesMem(Mem) _Post_null_) PVOID *Pool
)
{
#define BYTE_COUNT_EMBEDDED_NAME (32)
+#ifdef __REACTOS__
+#define __volatile
+#define _Unreferenced_parameter_
+#define __field_range(a,b)
+#define __analysis_assert(x)
+#endif
\f
//
// The CD_MCB is used to store the mapping of logical file offset to
PDEVICE_OBJECT FileSystemDeviceObject;
+#ifdef __REACTOS__
+ PDEVICE_OBJECT HddFileSystemDeviceObject;
+#endif
+
//
// Following are used to manage the async and delayed close queue.
//
//
ULONG VcbCleanup;
- __volatile ULONG VcbReference;
- __volatile ULONG VcbUserReference;
+ __volatile LONG VcbReference; /* ReactOS Change: GCC 'pointer targets in passing argument 1 of 'InterlockedXxx' differ in signedness */
+ __volatile LONG VcbUserReference; /* ReactOS Change: GCC 'pointer targets in passing argument 1 of 'InterlockedXxx' differ in signedness */
//
// Fcb for the Volume Dasd file, root directory and the Path Table.
// executed later.
//
- __volatile ULONG PostedRequestCount;
+ __volatile LONG PostedRequestCount; /* ReactOS Change: GCC "pointer targets in passing argument 1 of 'InterlockedDecrement' differ in signedness" */
//
// The following field indicates the number of IRP's waiting
//
ULONG FcbCleanup;
- __volatile ULONG FcbReference;
+ __volatile LONG FcbReference; /* ReactOS Change: GCC 'pointer targets in passing argument 1 of 'InterlockedXxx' differ in signedness */
ULONG FcbUserReference;
//
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
// Use a try-finally to facilitate cleanup.
//
- try {
+ _SEH2_TRY {
//
// Case on the type of open that we are trying to cleanup.
default :
+#ifdef _MSC_VER
#pragma prefast( suppress:__WARNING_USE_OTHER_FUNCTION, "argument bogus" )
+#endif
CdBugCheck( TypeOfOpen, 0, 0 );
}
IoRemoveShareAccess( FileObject, &Fcb->ShareAccess );
- } finally {
+ } _SEH2_FINALLY {
- CdReleaseFcb( IrpContext, Fcb );
+ CdReleaseFcb( IrpContext, Fcb );
if (SendUnlockNotification) {
FsRtlNotifyVolumeEvent( FileObject, FSRTL_VOLUME_UNLOCK );
}
- }
+ } _SEH2_END;
//
// If appropriate, try to spark teardown by purging the volume. Should
CdAcquireCdData( IrpContext);
- try {
+ _SEH2_TRY {
CdAcquireVcbExclusive( IrpContext, Vcb, FALSE );
VcbAcquired = TRUE;
CdPurgeVolume( IrpContext, Vcb, FALSE );
- } finally {
+ } _SEH2_FINALLY {
if (VcbAcquired) { CdReleaseVcb( IrpContext, Vcb ); }
CdReleaseCdData( IrpContext);
- }
+ } _SEH2_END;
}
//
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
IO_WORKITEM_ROUTINE CdCloseWorker;
VOID
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdCloseWorker (
_In_ PDEVICE_OBJECT DeviceObject,
_In_opt_ PVOID Context
// Free the IrpContextLite.
//
- CdFreeIrpContextLite( (PIRP_CONTEXT_LITE) IrpContext );
+ CdFreeIrpContextLite( *(PVOID*)&IrpContext ); /* ReactOS Change: GCC "error: invalid lvalue in unary '&'" */
//
// Remember we have the IrpContext from the stack.
}
+#ifdef _MSC_VER
#pragma prefast(suppress:26165, "Esp:1153")
+#endif
FsRtlExitFileSystem();
}
}
VOID
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdCloseWorker (
_In_ PDEVICE_OBJECT DeviceObject,
_In_opt_ PVOID Context
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
\f
_Requires_lock_held_(_Global_critical_region_)
NTSTATUS
+#ifdef _MSC_VER
#pragma prefast(suppress:26165, "Esp:1153")
+#endif
CdCommonCreate (
_Inout_ PIRP_CONTEXT IrpContext,
_Inout_ PIRP Irp
PFILE_OBJECT FileObject;
- COMPOUND_PATH_ENTRY CompoundPathEntry = {0};
+ COMPOUND_PATH_ENTRY CompoundPathEntry = {{0}};/* ReactOS Change: GCC "missing braces around initializer" */
BOOLEAN CleanupCompoundPathEntry = FALSE;
FILE_ENUM_CONTEXT FileContext = {0};
PUNICODE_STRING FileName;
PUNICODE_STRING RelatedFileName = NULL;
- CD_NAME RemainingName = {0};
+ CD_NAME RemainingName = {{0}};/* ReactOS Change: GCC "missing braces around initializer" */
CD_NAME FinalName;
PCD_NAME MatchingName = NULL;
// Use a try-finally to facilitate cleanup.
//
- try {
+ _SEH2_TRY {
//
// Verify that the Vcb is not in an unusable condition. This routine
RelatedCcb ));
try_exit: NOTHING;
- } finally {
+ } _SEH2_FINALLY {
//
// Cleanup the PathEntry if initialized.
// condition.
//
- if (AbnormalTermination()) {
+ if (_SEH2_AbnormalTermination()) {
//
//
CdCompleteRequest( IrpContext, Irp, Status );
- }
+ } _SEH2_END;
return Status;
}
//
// Do a quick check to make sure there are no wildcards.
//
+#ifdef _MSC_VER
#pragma prefast(push)
#pragma prefast(suppress:26000, "RemainingName->FileName.Buffer = FileName.Buffer + (RelatedNameLength + SeparatorLength); FileName.MaximumLength < (RelatedNameLength + SeparatorLength + RemainingNameLength).")
+#endif
if (FsRtlDoesNameContainWildCards( &RemainingName->FileName )) {
+#ifdef _MSC_VER
#pragma prefast(pop)
+#endif
return STATUS_OBJECT_NAME_INVALID;
}
}
}
+#ifdef _MSC_VER
#pragma prefast(push)
#pragma prefast(suppress:26030, "RemainingName->FileName.Buffer = FileName.Buffer + (RelatedNameLength + SeparatorLength); FileName.MaximumLength < (RelatedNameLength + SeparatorLength + RemainingNameLength).")
+#endif
return STATUS_SUCCESS;
+#ifdef _MSC_VER
#pragma prefast(pop)
+#endif
}
\f
FILE_ENUM_CONTEXT FileContext;
BOOLEAN CleanupFileContext = FALSE;
- COMPOUND_PATH_ENTRY CompoundPathEntry = {0};
+ COMPOUND_PATH_ENTRY CompoundPathEntry = {{0}};/* ReactOS Change: GCC "missing braces around initializer" */
BOOLEAN CleanupCompoundPathEntry = FALSE;
FILE_ID FileId;
// Use a try-finally to facilitate cleanup.
//
- try {
+ _SEH2_TRY {
//
// Go ahead and figure out the TypeOfOpen and NodeType. We can
}
try_exit: NOTHING;
- } finally {
+ } _SEH2_FINALLY {
if (UnlockVcb) {
CdCleanupCompoundPathEntry( IrpContext, &CompoundPathEntry );
}
- }
+ } _SEH2_END;
return Status;
}
// Use a try-finally to facilitate cleanup.
//
- try {
+ _SEH2_TRY {
//
// Check the related Ccb to see if this was an OpenByFileId.
IrpSp->Parameters.Create.SecurityContext->DesiredAccess );
}
- } finally {
+ } _SEH2_FINALLY {
//
// Unlock the Vcb if held.
CdReleaseFcb( IrpContext, ParentFcb );
}
- }
+ } _SEH2_END;
return Status;
}
// Use a try-finally to facilitate cleanup.
//
- try {
+ _SEH2_TRY {
//
// Check if a version number was used to open this file.
CcbFlags,
IrpSp->Parameters.Create.SecurityContext->DesiredAccess );
- } finally {
+ } _SEH2_FINALLY {
//
// Unlock the Vcb if held.
CdReleaseFcb( IrpContext, ParentFcb );
}
- }
+ } _SEH2_END;
return Status;
}
OplockStatus = FsRtlCheckOplock( CdGetFcbOplock(Fcb),
IrpContext->Irp,
IrpContext,
- CdOplockComplete,
- CdPrePostIrp );
+ (PVOID)CdOplockComplete, /* ReactOS Change: GCC "assignment from incompatible pointer type" */
+ (PVOID)CdPrePostIrp ); /* ReactOS Change: GCC "assignment from incompatible pointer type" */
if (OplockStatus == STATUS_PENDING) {
OplockStatus = FsRtlCheckOplock( CdGetFcbOplock(Fcb),
IrpContext->Irp,
IrpContext,
- CdOplockComplete,
- CdPrePostIrp );
+ (PVOID)CdOplockComplete,/* ReactOS Change: GCC "assignment from incompatible pointer type" */
+ (PVOID)CdPrePostIrp );/* ReactOS Change: GCC "assignment from incompatible pointer type" */
if (OplockStatus == STATUS_PENDING) {
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
IO_COMPLETION_ROUTINE CdDevCtrlCompletionRoutine;
NTSTATUS
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdDevCtrlCompletionRoutine (
_In_ PDEVICE_OBJECT DeviceObject,
_In_ PIRP Irp,
//
NTSTATUS
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdDevCtrlCompletionRoutine (
_In_ PDEVICE_OBJECT DeviceObject,
_In_ PIRP Irp,
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
// Use a try-finally to perform the final cleanup.
//
- try {
+ _SEH2_TRY {
//
// Loop while there are more bytes to transfer.
}
try_exit: NOTHING;
- } finally {
+ } _SEH2_FINALLY {
//
// Perform final cleanup on the IoRuns if necessary.
CdFinishBuffers( IrpContext, IoRuns, CleanupRunCount, TRUE, FALSE );
}
- }
+ } _SEH2_END;
return Status;
}
// Use a try-finally to perform the final cleanup.
//
- try {
+ _SEH2_TRY {
//
// If the initial offset lies within the RIFF header then copy the
KeFlushIoBuffers( IrpContext->Irp->MdlAddress, TRUE, FALSE );
try_exit: NOTHING;
- } finally {
+ } _SEH2_FINALLY {
//
// Perform final cleanup on the IoRuns if necessary.
CdFinishBuffers( IrpContext, IoRuns, CleanupRunCount, TRUE, FALSE );
}
- }
+ } _SEH2_END;
return Status;
}
// deallocate the Mdl and return the appropriate "expected" status.
//
- try {
+ _SEH2_TRY {
MmProbeAndLockPages( Mdl, IrpContext->Irp->RequestorMode, IoWriteAccess );
Status = STATUS_SUCCESS;
+#ifdef _MSC_VER
#pragma warning(suppress: 6320)
- } except(EXCEPTION_EXECUTE_HANDLER) {
+#endif
+ } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
- Status = GetExceptionCode();
+ Status = _SEH2_GetExceptionCode();
IoFreeMdl( Mdl );
IrpContext->Irp->MdlAddress = NULL;
Status = STATUS_INVALID_USER_BUFFER;
}
- }
+ } _SEH2_END;
}
//
CurrentRawOffset = (LONGLONG) ((ULONG) CurrentRawOffset / RAW_SECTOR_SIZE);
+#ifdef _MSC_VER
#pragma prefast( suppress: __WARNING_RESULTOFSHIFTCASTTOLARGERSIZE, "This is fine beacuse raw sector size > sector shift" )
+#endif
CurrentCookedOffset = (LONGLONG) ((ULONG) CurrentRawOffset << SECTOR_SHIFT );
CurrentRawOffset = (LONGLONG) ((ULONG) CurrentRawOffset * RAW_SECTOR_SIZE);
IO_COMPLETION_ROUTINE CdSyncCompletionRoutine;
NTSTATUS
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdSyncCompletionRoutine (
PDEVICE_OBJECT DeviceObject,
PIRP Irp,
CdAcquireCacheForRead( IrpContext);
- try {
+ _SEH2_TRY {
//
// Check the cache hasn't gone away due to volume verify failure (which
// pages and update the MDL with physical page information.
//
- try {
+ _SEH2_TRY {
MmProbeAndLockPages( Vcb->SectorCacheIrp->MdlAddress,
KernelMode,
(LOCK_OPERATION) IoWriteAccess );
}
+#ifdef _MSC_VER
#pragma warning(suppress: 6320)
- except(EXCEPTION_EXECUTE_HANDLER) {
+#endif
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
IoFreeMdl( Vcb->SectorCacheIrp->MdlAddress );
Vcb->SectorCacheIrp->MdlAddress = NULL;
- }
+ } _SEH2_END;
if (NULL == Vcb->SectorCacheIrp->MdlAddress) {
Result = TRUE;
}
- finally {
+ _SEH2_FINALLY {
CdReleaseCache( IrpContext);
- }
+ } _SEH2_END;
return Result;
}
//
NTSTATUS
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdMultiSyncCompletionRoutine (
PDEVICE_OBJECT DeviceObject,
PIRP Irp,
//
NTSTATUS
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdMultiAsyncCompletionRoutine (
PDEVICE_OBJECT DeviceObject,
PIRP Irp,
//
NTSTATUS
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdSingleSyncCompletionRoutine (
PDEVICE_OBJECT DeviceObject,
PIRP Irp,
//
NTSTATUS
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdSingleAsyncCompletionRoutine (
PDEVICE_OBJECT DeviceObject,
PIRP Irp,
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
// Use a try-finally to facilitate cleanup.
//
- try {
+ _SEH2_TRY {
//
// Verify the Fcb is still good.
// such trickery.
//
- try {
+ _SEH2_TRY {
//
// Zero and initialize the base part of the current entry.
NamesInfo->FileNameLength = FileNameBytes + SeparatorBytes + VersionStringBytes;
break;
+
+ /* ReactOS Change: GCC "enumeration value not handled in switch" */
+ default: break;
}
//
LastEntry = NextEntry;
NextEntry = QuadAlign( Information );
+#ifdef _MSC_VER
#pragma warning(suppress: 6320)
- } except (EXCEPTION_EXECUTE_HANDLER) {
+#endif
+ } _SEH2_EXCEPT (EXCEPTION_EXECUTE_HANDLER) {
//
// We had a problem filling in the user's buffer, so stop and
//
Information = 0;
- try_leave( Status = GetExceptionCode());
- }
+ try_leave( Status = _SEH2_GetExceptionCode());
+ } _SEH2_END;
}
DoCcbUpdate = TRUE;
- } finally {
+ } _SEH2_FINALLY {
//
// Cleanup our search context - *before* aquiring the FCB mutex exclusive,
//
CdReleaseFile( IrpContext, Fcb );
- }
+ } _SEH2_END;
//
// Complete the request here.
// Use a try-finally to facilitate cleanup.
//
- try {
+ _SEH2_TRY {
//
// Verify the Vcb.
NULL,
NULL );
- } finally {
+ } _SEH2_FINALLY {
//
// Release the Vcb.
//
CdReleaseVcb( IrpContext, IrpContext->Vcb );
- }
+ } _SEH2_END;
//
// Cleanup the IrpContext.
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
-#include "CdProcs.h"
+#include "cdprocs.h"
#include <stdio.h>
#define doit(a,b) { printf("%s %04lx %4lx %s\n", #a, FIELD_OFFSET(a,b), sizeof(d.b), #b); }
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
// Use a try-finally to facilitate cleanup.
//
- try {
+ _SEH2_TRY {
//
// We only support query on file and directory handles.
Irp->IoStatus.Information = IrpSp->Parameters.QueryFile.Length - Length;
- } finally {
+ } _SEH2_FINALLY {
//
// Release the file.
CdReleaseFile( IrpContext, Fcb );
}
- }
+ } _SEH2_END;
//
// Complete the request if we didn't raise.
CdAcquireFileShared( IrpContext, Fcb );
- try {
+ _SEH2_TRY {
//
// Make sure the Fcb is in a usable condition. This
Status = STATUS_SUCCESS;
try_exit: NOTHING;
- } finally {
+ } _SEH2_FINALLY {
CdReleaseFile( IrpContext, Fcb );
- }
+ } _SEH2_END;
//
// Complete the request if there was no raise.
_IRQL_requires_same_\f
_Success_(return != FALSE)
BOOLEAN
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdFastQueryBasicInfo (
_In_ PFILE_OBJECT FileObject,
_In_ BOOLEAN Wait,
// Use a try-finally to facilitate cleanup.
//
- try {
+ _SEH2_TRY {
//
// Only deal with 'good' Fcb's.
Result = TRUE;
}
- } finally {
+ } _SEH2_FINALLY {
ExReleaseResourceLite( Fcb->Resource );
FsRtlExitFileSystem();
- }
+ } _SEH2_END;
return Result;
}
_IRQL_requires_same_
_Success_(return != FALSE)
BOOLEAN
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdFastQueryStdInfo (
_In_ PFILE_OBJECT FileObject,
_In_ BOOLEAN Wait,
// Use a try-finally to facilitate cleanup.
//
- try {
+ _SEH2_TRY {
//
// Only deal with 'good' Fcb's.
Result = TRUE;
}
- } finally {
+ } _SEH2_FINALLY {
ExReleaseResourceLite( Fcb->Resource );
FsRtlExitFileSystem();
- }
+ } _SEH2_END;
return Result;
}
_IRQL_requires_same_
_Success_(return != FALSE)
BOOLEAN
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdFastQueryNetworkInfo (
_In_ PFILE_OBJECT FileObject,
_In_ BOOLEAN Wait,
// Use a try-finally to facilitate cleanup.
//
- try {
+ _SEH2_TRY {
//
// Only deal with 'good' Fcb's.
Result = TRUE;
}
- } finally {
+ } _SEH2_FINALLY {
ExReleaseResourceLite( Fcb->Resource );
FsRtlExitFileSystem();
- }
+ } _SEH2_END;
return Result;
}
PUNICODE_STRING NameToUse;
ULONG DirentOffset;
- COMPOUND_PATH_ENTRY CompoundPathEntry = {0};
+ COMPOUND_PATH_ENTRY CompoundPathEntry = {{0}};/* ReactOS Change: GCC "missing braces around initializer" */
FILE_ENUM_CONTEXT FileContext;
PFCB ParentFcb = NULL;
// Use a try-finally to cleanup the structures.
//
- try {
+ _SEH2_TRY {
ParentFcb = Fcb->ParentFcb;
CdAcquireFileShared( IrpContext, ParentFcb );
RtlCopyMemory( Buffer->FileName, ShortNameBuffer, Buffer->FileNameLength );
try_exit: NOTHING;
- } finally {
+ } _SEH2_FINALLY {
if (CleanupFileLookup) {
CdCleanupDirContext( IrpContext, &DirContext );
- CdCleanupDirent( IrpContext, &Dirent );
+ CdCleanupDirent( IrpContext, &Dirent );/* ReactOS Change: GCC "passing argument 1 from incompatible pointer type" */
} else if (CleanupDirectoryLookup) {
CdReleaseFile( IrpContext, ParentFcb );
}
- }
+ } _SEH2_END;
//
// Reduce the available bytes by the amount stored into this buffer.
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
FileObject->FsContext = Fcb;
FileObject->FsContext2 = Ccb;
+#ifdef _MSC_VER
#pragma warning( suppress: 4213 )
- SetFlag( ((ULONG_PTR) FileObject->FsContext2), TypeOfOpen );
+#endif
+ SetFlag( (*(PULONG_PTR)&FileObject->FsContext2), TypeOfOpen ); /* ReactOS Change: GCC "invalid lvalue in assignment" */
//
// Set the Vpb field in the file object.
*Fcb = FileObject->FsContext;
*Ccb = FileObject->FsContext2;
+#ifdef _MSC_VER
#pragma warning( suppress: 4213 )
- ClearFlag( (ULONG_PTR) *Ccb, TYPE_OF_OPEN_MASK );
+#endif
+ ClearFlag( (*(PULONG_PTR)Ccb), TYPE_OF_OPEN_MASK ); /* ReactOS Change: GCC "invalid lvalue in assignment" */
}
//
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
IoAcquireVpbSpinLock( &SavedIrql );
+#ifdef _MSC_VER
#pragma prefast(suppress: 28175, "this is a filesystem driver, touching the vpb is allowed")
+#endif
NewVcb->Vpb->RealDevice->Vpb = OldVcb->Vpb;
OldVcb->Vpb->RealDevice = NewVcb->Vpb->RealDevice;
ULONG TocDiskFlags = 0;
ULONG MediaChangeCount = 0;
+#ifdef __REACTOS__
+ DEVICE_TYPE FilesystemDeviceType;
+#endif
+
#ifdef CDFS_TELEMETRY_DATA
GUID VolumeGuid;
GUID VolumeCorrelationId = { 0 };
// always be waitable.
//
+#ifdef __REACTOS__
+ if (IrpSp->DeviceObject == CdData.HddFileSystemDeviceObject) {
+ FilesystemDeviceType = FILE_DEVICE_DISK_FILE_SYSTEM;
+ } else {
+#endif
NT_ASSERT( Vpb->RealDevice->DeviceType == FILE_DEVICE_CD_ROM );
+#ifdef __REACTOS__
+ FilesystemDeviceType = FILE_DEVICE_CD_ROM_FILE_SYSTEM;
+ }
+#endif
NT_ASSERT( FlagOn( IrpContext->Flags, IRP_CONTEXT_FLAG_WAIT ));
#ifdef CDFS_TELEMETRY_DATA
//
Status = CdPerformDevIoCtrl( IrpContext,
+#ifndef __REACTOS__
IOCTL_CDROM_CHECK_VERIFY,
+#else
+ (FilesystemDeviceType == FILE_DEVICE_DISK_FILE_SYSTEM ? IOCTL_DISK_CHECK_VERIFY : IOCTL_CDROM_CHECK_VERIFY),
+#endif
DeviceObjectWeTalkTo,
&MediaChangeCount,
sizeof(ULONG),
//
Status = CdPerformDevIoCtrl( IrpContext,
+#ifndef __REACTOS__
IOCTL_CDROM_GET_DRIVE_GEOMETRY,
+#else
+ (FilesystemDeviceType == FILE_DEVICE_DISK_FILE_SYSTEM ? IOCTL_DISK_GET_DRIVE_GEOMETRY : IOCTL_CDROM_GET_DRIVE_GEOMETRY),
+#endif
DeviceObjectWeTalkTo,
&DiskGeometry,
sizeof( DISK_GEOMETRY ),
// Use a try-finally to facilitate cleanup.
//
- try {
+ _SEH2_TRY {
//
// Allocate a buffer to query the TOC.
Status = IoCreateDevice( CdData.DriverObject,
sizeof( VOLUME_DEVICE_OBJECT ) - sizeof( DEVICE_OBJECT ),
NULL,
+#ifndef __REACTOS__
FILE_DEVICE_CD_ROM_FILE_SYSTEM,
+#else
+ FilesystemDeviceType,
+#endif
0,
FALSE,
(PDEVICE_OBJECT *) &VolDo );
if (Status != STATUS_SUCCESS) {
+#ifdef __REACTOS__
+
+ //
+ // Don't bail out if that was a disk based ISO image, it is legit
+ //
+
+ if (FilesystemDeviceType == FILE_DEVICE_DISK_FILE_SYSTEM) {
+ CdFreePool( &CdromToc );
+ Status = STATUS_SUCCESS;
+ } else {
+#endif
try_leave( Status );
+#ifdef __REACTOS__
+ }
+#endif
}
//
Status = STATUS_SUCCESS;
- } finally {
+ } _SEH2_FINALLY {
//
// Free the TOC buffer if not in the Vcb.
// If we are not mounting the device, then set the verify bit again.
//
- if ((AbnormalTermination() || (Status != STATUS_SUCCESS)) &&
+ if ((_SEH2_AbnormalTermination() || (Status != STATUS_SUCCESS)) &&
SetDoVerifyOnFail) {
CdMarkRealDevForVerify( IrpContext->RealDevice);
//
CdReleaseCdData( IrpContext );
- }
+ } _SEH2_END;
//
// Now send mount notification.
CdAcquireCdData( IrpContext );
- try {
+ _SEH2_TRY {
CdAcquireVcbExclusive( IrpContext, Vcb, FALSE );
ReleaseVcb = TRUE;
}
}
- }
- finally {
+ } _SEH2_FINALLY {
//
// Free the TOC buffer if allocated.
}
CdReleaseCdData( IrpContext );
- }
+ } _SEH2_END;
//
// Now send mount notification.
// Use a try finally to free the Fcb.
//
- try {
+ _SEH2_TRY {
//
// Verify the Fcb.
Irp = NULL;
- } finally {
+ } _SEH2_FINALLY {
//
// Release all of our resources
//
CdReleaseFcb( IrpContext, Fcb );
- }
+ } _SEH2_END;
//
// Complete the request if there was no exception.
Vcb = Fcb->Vcb;
CdAcquireVcbExclusive( IrpContext, Vcb, FALSE );
- try {
+ _SEH2_TRY {
//
// Verify the Vcb.
Status = CdLockVolumeInternal( IrpContext, Vcb, IrpSp->FileObject );
- } finally {
+ } _SEH2_FINALLY {
//
// Release the Vcb.
CdReleaseVcb( IrpContext, Vcb );
- if (AbnormalTermination() || !NT_SUCCESS( Status )) {
+ if (_SEH2_AbnormalTermination() || !NT_SUCCESS( Status )) {
FsRtlNotifyVolumeEvent( IrpSp->FileObject, FSRTL_VOLUME_LOCK_FAILED );
}
- }
+ } _SEH2_END;
//
// Complete the request if there haven't been any exceptions.
// We only allow the invalidate call to come in on our file system devices.
//
+#ifndef __REACTOS__
if (IrpSp->DeviceObject != CdData.FileSystemDeviceObject) {
+#else
+ if (IrpSp->DeviceObject != CdData.FileSystemDeviceObject &&
+ IrpSp->DeviceObject != CdData.HddFileSystemDeviceObject) {
+#endif
CdCompleteRequest( IrpContext, Irp, STATUS_INVALID_DEVICE_REQUEST );
0,
*IoFileObjectType,
KernelMode,
- &FileToMarkBad,
+ (PVOID*)&FileToMarkBad, /* ReactOS Change: GCC "passing argument 5 of 'ObReferenceObjectByHandle' from incompatible pointer type" */
NULL );
if (!NT_SUCCESS(Status)) {
IoAcquireVpbSpinLock( &SavedIrql );
+#ifdef _MSC_VER
#pragma prefast(suppress: 28175, "this is a filesystem driver, touching the vpb is allowed")
+#endif
if (DeviceToMarkBad->Vpb == Vcb->Vpb) {
PVPB NewVpb = Vcb->SwapVpb;
NewVpb->Size = sizeof( VPB );
NewVpb->RealDevice = DeviceToMarkBad;
+#ifdef _MSC_VER
#pragma prefast(push)
#pragma prefast(disable: 28175, "this is a filesystem driver, touching the vpb is allowed")
+#endif
NewVpb->Flags = FlagOn( DeviceToMarkBad->Vpb->Flags, VPB_REMOVE_PENDING );
DeviceToMarkBad->Vpb = NewVpb;
+#ifdef _MSC_VER
#pragma prefast(pop)
+#endif
Vcb->SwapVpb = NULL;
}
// Check for whether this device supports XA and multi-session.
//
- try {
+ _SEH2_TRY {
//
// Allocate a buffer for the last session information.
ThisPass += 1;
}
- } finally {
+ } _SEH2_FINALLY {
if (CdromToc != NULL) { CdFreePool( &CdromToc ); }
- }
+ } _SEH2_END;
}
//
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
\f
VOID
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdFspDispatch (
_In_ PVOID Context
)
while (TRUE) {
- try {
+ _SEH2_TRY {
//
// Reinitialize for the next try at completing this
CdCompleteRequest( IrpContext, Irp, Status );
}
- } except( CdExceptionFilter( IrpContext, GetExceptionInformation() )) {
+ } _SEH2_EXCEPT( CdExceptionFilter( IrpContext, _SEH2_GetExceptionInformation() )) {
- Status = CdProcessException( IrpContext, Irp, GetExceptionCode() );
- }
+ Status = CdProcessException( IrpContext, Irp, _SEH2_GetExceptionCode() );
+ } _SEH2_END;
//
// Break out of the loop if we didn't get CANT_WAIT.
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
Status = FsRtlCheckOplock( CdGetFcbOplock(Fcb),
Irp,
IrpContext,
- CdOplockComplete,
+ (PVOID)CdOplockComplete,/* ReactOS Change: GCC "assignment from incompatible pointer type" */
NULL );
//
\f
BOOLEAN
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdFastLock (
_In_ PFILE_OBJECT FileObject,
_In_ PLARGE_INTEGER FileOffset,
// Use a try-finally to facilitate cleanup.
//
- try {
+ _SEH2_TRY {
//
// We check whether we can proceed based on the state of the file oplocks.
// Now call the FsRtl routine to perform the lock request.
//
+#ifdef _MSC_VER
#pragma prefast(suppress: 28159, "prefast thinks this is an obsolete routine, but it is ok for CDFS to use it")
+#endif
if ((Results = FsRtlFastLock( Fcb->FileLock,
FileObject,
FileOffset,
}
try_exit: NOTHING;
- } finally {
+ } _SEH2_FINALLY {
FsRtlExitFileSystem();
- }
+ } _SEH2_END;
return Results;
}
\f
BOOLEAN
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdFastUnlockSingle (
_In_ PFILE_OBJECT FileObject,
_In_ PLARGE_INTEGER FileOffset,
FsRtlEnterFileSystem();
- try {
+ _SEH2_TRY {
//
// We check whether we can proceed based on the state of the file oplocks.
}
try_exit: NOTHING;
- } finally {
+ } _SEH2_FINALLY {
FsRtlExitFileSystem();
- }
+ } _SEH2_END;
return Results;
}
\f
BOOLEAN
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdFastUnlockAll (
_In_ PFILE_OBJECT FileObject,
_In_ PEPROCESS ProcessId,
FsRtlEnterFileSystem();
- try {
+ _SEH2_TRY {
//
// We check whether we can proceed based on the state of the file oplocks.
CdUnlockFcb( IrpContext, Fcb );
try_exit: NOTHING;
- } finally {
+ } _SEH2_FINALLY {
FsRtlExitFileSystem();
- }
+ } _SEH2_END;
return Results;
}
\f
BOOLEAN
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdFastUnlockAllByKey (
_In_ PFILE_OBJECT FileObject,
_In_ PVOID ProcessId,
FsRtlEnterFileSystem();
- try {
+ _SEH2_TRY {
//
// We check whether we can proceed based on the state of the file oplocks.
CdUnlockFcb( IrpContext, Fcb );
try_exit: NOTHING;
- } finally {
+ } _SEH2_FINALLY {
FsRtlExitFileSystem();
- }
+ } _SEH2_END;
return Results;
}
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
while (RemainingByteCount != 0) {
+#ifdef _MSC_VER
#pragma prefast(push)
#pragma prefast(suppress:26014, "RemainingByteCount is even")
+#endif
*Destination = *Source;
+#ifdef _MSC_VER
#pragma prefast(pop)
+#endif
Source += 2;
Destination += 2;
// copy the data.
//
+#ifdef _MSC_VER
#pragma prefast( suppress:26015, "CD_NAME structures have two UNICODE_STRING structures pointing to the same allocation. there is no way to tell prefast this is the case and that the allocation is always big enough.");
+#endif
*(UpcaseName->VersionString.Buffer) = L';';
UpcaseName->VersionString.Buffer += 1;
// may use 2 bytes as DBCS characters.
//
+#ifdef _MSC_VER
#pragma prefast(push)
#pragma prefast(suppress:26014, "OemNameOffset <= BaseNameOffset throughout this loop; OemName buffer previously allocated based on ShortName's length.")
+#endif
if (FsRtlIsLeadDbcsCharacter(OemName.Buffer[OemNameOffset])) {
+#ifdef _MSC_VER
#pragma prefast(pop)
+#endif
OemNameOffset += 2;
// Now copy the dirent string into the biased name buffer.
//
+#ifdef _MSC_VER
#pragma prefast(push)
+#endif
RtlCopyMemory( NextWchar,
BiasedShortName.Buffer,
BiasedShortName.Length );
+#ifdef _MSC_VER
#pragma prefast(pop)
+#endif
Length += BiasedShortName.Length;
NextWchar += (BiasedShortName.Length / sizeof( WCHAR ));
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
IO_COMPLETION_ROUTINE CdPnpCompletionRoutine;
NTSTATUS
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdPnpCompletionRoutine (
_In_ PDEVICE_OBJECT DeviceObject,
_In_ PIRP Irp,
// field that takes us past the end of an ordinary device object.
//
+#ifdef _MSC_VER
#pragma prefast(suppress: 28175, "this is a filesystem driver, touching the size member is allowed")
+#endif
if (OurDeviceObject->DeviceObject.Size != sizeof(VOLUME_DEVICE_OBJECT) ||
NodeType( &OurDeviceObject->Vcb ) != CDFS_NTC_VCB) {
//
NTSTATUS
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdPnpCompletionRoutine (
_In_ PDEVICE_OBJECT DeviceObject,
_In_ PIRP Irp,
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
// This macro just puts a nice little try-except around RtlZeroMemory
//
+#ifndef __REACTOS__
#define SafeZeroMemory(IC,AT,BYTE_COUNT) { \
- try { \
+ _SEH2_TRY { \
RtlZeroMemory( (AT), (BYTE_COUNT) ); \
__pragma(warning(suppress: 6320)) \
- } except( EXCEPTION_EXECUTE_HANDLER ) { \
+ } _SEH2_EXCEPT( EXCEPTION_EXECUTE_HANDLER ) { \
CdRaiseStatus( IC, STATUS_INVALID_USER_BUFFER ); \
- } \
+ } _SEH2_END; \
}
+#else
+#define SafeZeroMemory(IC,AT,BYTE_COUNT) { \
+ _SEH2_TRY { \
+ RtlZeroMemory( (AT), (BYTE_COUNT) ); \
+ } _SEH2_EXCEPT( EXCEPTION_EXECUTE_HANDLER ) { \
+ CdRaiseStatus( IC, STATUS_INVALID_USER_BUFFER ); \
+ } _SEH2_END; \
+}
+#endif
//
// Read ahead amount used for normal data files
// Use a try-finally to facilitate cleanup.
//
- try {
+ _SEH2_TRY {
//
// Verify the Fcb. Allow reads if this is a DASD handle that is
Status = FsRtlCheckOplock( CdGetFcbOplock(Fcb),
Irp,
IrpContext,
- CdOplockComplete,
- CdPrePostIrp );
+ (PVOID)CdOplockComplete,/* ReactOS Change: GCC "assignment from incompatible pointer type" */
+ (PVOID)CdPrePostIrp );/* ReactOS Change: GCC "assignment from incompatible pointer type" */
//
// If the result is not STATUS_SUCCESS then the Irp was completed
}
try_exit: NOTHING;
- } finally {
+ } _SEH2_FINALLY {
//
// Release the Fcb.
CdReleaseFile( IrpContext, Fcb );
}
- }
+ } _SEH2_END;
//
// Post the request if we got CANT_WAIT.
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
switch (Type) {
case AcquireExclusive:
+#ifdef _MSC_VER
#pragma prefast( suppress:28137, "prefast believes Wait should be a constant, but this is ok for CDFS" )
+#endif
Acquired = ExAcquireResourceExclusiveLite( Resource, Wait );
break;
_Requires_lock_held_(_Global_critical_region_)
_When_(return!=0, _Acquires_shared_lock_(*Fcb->Resource))
BOOLEAN
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdAcquireForCache (
_Inout_ PFCB Fcb,
_In_ BOOLEAN Wait
_Requires_lock_held_(_Global_critical_region_)
_Releases_lock_(*Fcb->Resource)
VOID
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdReleaseFromCache (
_Inout_ PFCB Fcb
)
\f
BOOLEAN
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdNoopAcquire (
_In_ PVOID Fcb,
_In_ BOOLEAN Wait
\f
VOID
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdNoopRelease (
_In_ PVOID Fcb
)
UNREFERENCED_PARAMETER( Fcb );
}
-\f
_Requires_lock_held_(_Global_critical_region_)
NTSTATUS
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdFilterCallbackAcquireForCreateSection (
_In_ PFS_FILTER_CALLBACK_DATA CallbackData,
_Unreferenced_parameter_ PVOID *CompletionContext
_Function_class_(FAST_IO_RELEASE_FILE)
_Requires_lock_held_(_Global_critical_region_)
VOID
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdReleaseForCreateSection (
_In_ PFILE_OBJECT FileObject
)
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
RTL_GENERIC_COMPARE_ROUTINE CdFcbTableCompare;
RTL_GENERIC_COMPARE_RESULTS
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdFcbTableCompare (
_In_ PRTL_GENERIC_TABLE FcbTable,
_In_ PVOID Fid1,
RTL_GENERIC_ALLOCATE_ROUTINE CdAllocateFcbTable;
PVOID
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdAllocateFcbTable (
_In_ PRTL_GENERIC_TABLE FcbTable,
_In_ CLONG ByteSize
RTL_GENERIC_FREE_ROUTINE CdDeallocateFcbTable;
VOID
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdDeallocateFcbTable (
_In_ PRTL_GENERIC_TABLE FcbTable,
_In_ __drv_freesMem(Mem) _Post_invalid_ PVOID Buffer
// uninitialize the notify structures before returning.
//
- try {
+ _SEH2_TRY {
Vcb->SwapVpb = FsRtlAllocatePoolWithTag( CdNonPagedPool,
sizeof( VPB ),
TAG_VPB );
}
- finally {
+ _SEH2_FINALLY {
- if (AbnormalTermination()) {
+ if (_SEH2_AbnormalTermination()) {
FsRtlNotifyUninitializeSync( &Vcb->NotifySync );
}
- }
+ } _SEH2_END;
//
// Nothing beyond this point should raise.
// Use a try-finally to facilitate cleanup.
//
- try {
+ _SEH2_TRY {
//
// Copy the block size and compute the various block masks.
SetFlag( Vcb->VcbState, VCB_STATE_ISO );
}
- } finally {
+ } _SEH2_FINALLY {
if (UnlockVcb) { CdUnlockVcb( IrpContext, Vcb ); }
- }
+ } _SEH2_END;
}
\f
//
// Now delete the volume device object.
//
+#ifdef _MSC_VER
#pragma prefast( suppress: __WARNING_BUFFER_UNDERFLOW, "This is ok, the Vcb is embedded in our volume device object, and that is what we are really deleting." )
+#endif
IoDeleteDevice( (PDEVICE_OBJECT) CONTAINING_RECORD( Vcb,
VOLUME_DEVICE_OBJECT,
Vcb ));
default:
+#ifdef _MSC_VER
#pragma prefast( suppress: __WARNING_USE_OTHER_FUNCTION, "This is a bug." )
+#endif
CdBugCheck( 0, 0, 0 );
}
CdLockFcb( IrpContext, Fcb );
- try {
+ _SEH2_TRY {
//
// Initialize the common header in the Fcb. The node type is already
CdInsertFcbTable( IrpContext, Fcb );
SetFlag( Fcb->FcbState, FCB_STATE_IN_FCB_TABLE );
- } finally {
+ } _SEH2_FINALLY {
CdUnlockFcb( IrpContext, Fcb );
- }
+ } _SEH2_END;
return;
}
// occur in the context of fileobjects (i.e., mount).
//
+#ifndef __REACTOS__
if (IrpSp->DeviceObject == CdData.FileSystemDeviceObject) {
+#else
+ if (IrpSp->DeviceObject == CdData.FileSystemDeviceObject ||
+ IrpSp->DeviceObject == CdData.HddFileSystemDeviceObject) {
+#endif
if (IrpSp->FileObject != NULL &&
IrpSp->MajorFunction != IRP_MJ_CREATE &&
// the Vcb field.
//
+#ifndef __REACTOS__
if (IrpSp->DeviceObject != CdData.FileSystemDeviceObject) {
+#else
+ if (IrpSp->DeviceObject != CdData.FileSystemDeviceObject &&
+ IrpSp->DeviceObject != CdData.HddFileSystemDeviceObject) {
+#endif
NewIrpContext->Vcb = &((PVOLUME_DEVICE_OBJECT) IrpSp->DeviceObject)->Vcb;
// Use a try-finally to safely clear the top-level field.
//
- try {
+ _SEH2_TRY {
//
// Loop until we find an Fcb we can't remove.
} while (CurrentFcb != NULL);
- } finally {
+ } _SEH2_FINALLY {
//
// Release the current Fcb if we have acquired it.
//
ClearFlag( IrpContext->TopLevel->Flags, IRP_CONTEXT_FLAG_IN_TEARDOWN );
- }
+ } _SEH2_END;
*RemovedStartingFcb = (CurrentFcb != StartingFcb);
return;
Vcb->PathTableFcb = NULL;
}
- CdDeallocateFcbIndex( IrpContext, Fcb );
+ CdDeallocateFcbIndex( IrpContext, *(PVOID*)&Fcb );/* ReactOS Change: GCC "passing argument 1 from incompatible pointer type" */
break;
case CDFS_NTC_FCB_DATA :
Vcb->VolumeDasdFcb = NULL;
}
- CdDeallocateFcbData( IrpContext, Fcb );
+ CdDeallocateFcbData( IrpContext, *(PVOID*)&Fcb );/* ReactOS Change: GCC "passing argument 1 from incompatible pointer type" */
}
//
ExDeleteResourceLite( &FcbNonpaged->FcbResource );
- CdDeallocateFcbNonpaged( IrpContext, FcbNonpaged );
+ CdDeallocateFcbNonpaged( IrpContext, *(PVOID*)&FcbNonpaged );/* ReactOS Change: GCC "passing argument 1 from incompatible pointer type" */
return;
}
//
RTL_GENERIC_COMPARE_RESULTS
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdFcbTableCompare (
_In_ PRTL_GENERIC_TABLE FcbTable,
_In_ PVOID Fid1,
//
PVOID
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdAllocateFcbTable (
_In_ PRTL_GENERIC_TABLE FcbTable,
_In_ CLONG ByteSize
// Local support routine
//
VOID
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdDeallocateFcbTable (
_In_ PRTL_GENERIC_TABLE FcbTable,
_In_ __drv_freesMem(Mem) _Post_invalid_ PVOID Buffer
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
Vcb = &CONTAINING_RECORD( IrpSp->DeviceObject,
VOLUME_DEVICE_OBJECT,
DeviceObject )->Vcb;
- try {
+ _SEH2_TRY {
//
// Send down the verify FSCTL. Note that this is sent to the
Status = CdFsdPostRequest( IrpContext, Irp );
}
- } except(CdExceptionFilter( IrpContext, GetExceptionInformation() )) {
+ } _SEH2_EXCEPT(CdExceptionFilter( IrpContext, _SEH2_GetExceptionInformation() )) {
//
// We had some trouble trying to perform the verify or raised
// the error status that we get back from the execption code.
//
- Status = CdProcessException( IrpContext, Irp, GetExceptionCode() );
- }
+ Status = CdProcessException( IrpContext, Irp, _SEH2_GetExceptionCode() );
+ } _SEH2_END;
return Status;
}
IoAcquireVpbSpinLock( &SavedIrql );
+#ifdef _MSC_VER
#pragma prefast(suppress: 28175, "this is a filesystem driver, touching the vpb is allowed")
+#endif
if (Vcb->Vpb->RealDevice->Vpb == Vcb->Vpb) {
CdMarkRealDevForVerify( Vcb->Vpb->RealDevice);
CdRaiseStatus( IrpContext, STATUS_FILE_INVALID );
}
break;
+
+ /* ReactOS Change: GCC "enumeration value not handled in switch" */
+ default: break;
}
}
// mount request.
//
+#ifdef _MSC_VER
#pragma prefast(suppress: 28175, "this is a filesystem driver, touching the vpb is allowed")
+#endif
if (OldVpb->RealDevice->Vpb == OldVpb) {
//
Vcb->SwapVpb->Type = IO_TYPE_VPB;
Vcb->SwapVpb->Size = sizeof( VPB );
+#ifdef _MSC_VER
#pragma prefast(push)
#pragma prefast(disable: 28175, "this is a filesystem driver, touching the vpb is allowed")
+#endif
Vcb->SwapVpb->RealDevice = OldVpb->RealDevice;
Vcb->SwapVpb->RealDevice->Vpb = Vcb->SwapVpb;
+#ifdef _MSC_VER
#pragma prefast(pop)
+#endif
Vcb->SwapVpb->Flags = FlagOn( OldVpb->Flags, VPB_REMOVE_PENDING );
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
_Inout_ PULONG Length
);
+#ifdef __REACTOS__
+#define PFILE_FS_SECTOR_SIZE_INFORMATION PVOID
+#endif
+
NTSTATUS
CdQueryFsSectorSizeInfo (
_In_ PIRP_CONTEXT IrpContext,
// Use a try-finally to facilitate cleanup.
//
- try {
+ _SEH2_TRY {
//
// Verify the Vcb.
Status = CdQueryFsSectorSizeInfo( IrpContext, Fcb->Vcb, Irp->AssociatedIrp.SystemBuffer, &Length );
break;
#endif
+
+ /* ReactOS Change: GCC "enumeration value not handled in switch" */
+ default: break;
}
//
Irp->IoStatus.Information = IrpSp->Parameters.QueryVolume.Length - Length;
- } finally {
+ } _SEH2_FINALLY {
//
// Release the Vcb.
//
CdReleaseVcb( IrpContext, Fcb->Vcb );
- }
+ } _SEH2_END;
//
// Complete the request if we didn't raise.
+++ /dev/null
-Index: drivers/filesystems/cdfs_new/deviosup.c
-===================================================================
---- drivers/filesystems/cdfs_new/deviosup.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/deviosup.c (working copy)
-@@ -165,6 +165,7 @@
- );
-
- NTSTATUS
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdMultiSyncCompletionRoutine (
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
-@@ -172,6 +173,7 @@
- );
-
- NTSTATUS
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdMultiAsyncCompletionRoutine (
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
-@@ -179,6 +181,7 @@
- );
-
- NTSTATUS
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdSingleSyncCompletionRoutine (
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
-@@ -186,6 +189,7 @@
- );
-
- NTSTATUS
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdSingleAsyncCompletionRoutine (
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
-@@ -2943,6 +2947,7 @@
- //
-
- NTSTATUS
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdMultiSyncCompletionRoutine (
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
-@@ -3029,6 +3034,7 @@
- //
-
- NTSTATUS
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdMultiAsyncCompletionRoutine (
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
-@@ -3066,7 +3072,8 @@
-
- {
- PCD_IO_CONTEXT IoContext = Context;
-- PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation( Irp );
-+ /* ReactOS Change: GCC Unused Variable */
-+ //PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation( Irp );
-
- AssertVerifyDeviceIrp( Irp );
-
-@@ -3148,6 +3155,7 @@
- //
-
- NTSTATUS
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdSingleSyncCompletionRoutine (
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
-@@ -3207,6 +3215,7 @@
- //
-
- NTSTATUS
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdSingleAsyncCompletionRoutine (
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
-@@ -3267,7 +3276,7 @@
- // and finally, free the context record.
- //
-
-- CdFreeIoContext( (PCD_IO_CONTEXT) Context );
-+ CdFreeIoContext( Context ); /* ReactOS Change: GCC "error: invalid lvalue in unary '&'" */
- return STATUS_SUCCESS;
-
- UNREFERENCED_PARAMETER( DeviceObject );
-Index: drivers/filesystems/cdfs_new/dirctrl.c
-===================================================================
---- drivers/filesystems/cdfs_new/dirctrl.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/dirctrl.c (working copy)
-@@ -209,7 +209,7 @@
-
- ULONG BaseLength;
-
-- PFILE_BOTH_DIR_INFORMATION DirInfo;
-+ PFILE_BOTH_DIR_INFORMATION DirInfo = NULL; /* ReactOS Change: GCC Uninit var */
- PFILE_NAMES_INFORMATION NamesInfo;
- PFILE_ID_FULL_DIR_INFORMATION IdFullDirInfo;
- PFILE_ID_BOTH_DIR_INFORMATION IdBothDirInfo;
-@@ -579,6 +579,9 @@
- NamesInfo->FileNameLength = FileNameBytes + SeparatorBytes + VersionStringBytes;
-
- break;
-+
-+ /* ReactOS Change: GCC "enumeration value not handled in switch" */
-+ default: break;
- }
-
- //
-Index: drivers/filesystems/cdfs_new/create.c
-===================================================================
---- drivers/filesystems/cdfs_new/create.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/create.c (working copy)
-@@ -2106,7 +2106,7 @@
- PFCB NextFcb;
- PFCB ParentFcb = NULL;
-
-- NTSTATUS Status;
-+ NTSTATUS Status = STATUS_SUCCESS; /* ReactOS Change: GCC uninitialized variable */
-
- PAGED_CODE();
-
-@@ -2757,8 +2757,8 @@
- OplockStatus = FsRtlCheckOplock( &Fcb->Oplock,
- IrpContext->Irp,
- IrpContext,
-- CdOplockComplete,
-- CdPrePostIrp );
-+ (PVOID)CdOplockComplete, /* ReactOS Change: GCC "assignment from incompatible pointer type" */
-+ (PVOID)CdPrePostIrp ); /* ReactOS Change: GCC "assignment from incompatible pointer type" */
-
- if (OplockStatus == STATUS_PENDING) {
-
-@@ -2789,8 +2789,8 @@
- OplockStatus = FsRtlCheckOplock( &Fcb->Oplock,
- IrpContext->Irp,
- IrpContext,
-- CdOplockComplete,
-- CdPrePostIrp );
-+ (PVOID)CdOplockComplete,/* ReactOS Change: GCC "assignment from incompatible pointer type" */
-+ (PVOID)CdPrePostIrp );/* ReactOS Change: GCC "assignment from incompatible pointer type" */
-
- if (OplockStatus == STATUS_PENDING) {
-
-Index: drivers/filesystems/cdfs_new/devctrl.c
-===================================================================
---- drivers/filesystems/cdfs_new/devctrl.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/devctrl.c (working copy)
-@@ -27,6 +27,7 @@
- //
-
- NTSTATUS
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdDevCtrlCompletionRoutine (
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
-@@ -64,7 +64,7 @@
- PIO_STACK_LOCATION IrpSp;
- PIO_STACK_LOCATION NextIrpSp;
-
-- PVOID TargetBuffer = NULL;
-+// PVOID TargetBuffer = NULL; /* ReactOS Change: GCC unused variable */
-
- PAGED_CODE();
-
-@@ -171,6 +172,7 @@
- //
-
- NTSTATUS
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdDevCtrlCompletionRoutine (
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
-Index: drivers/filesystems/cdfs_new/close.c
-===================================================================
---- drivers/filesystems/cdfs_new/close.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/close.c (working copy)
-@@ -77,6 +77,7 @@
- );
-
- VOID
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdCloseWorker (
- IN PDEVICE_OBJECT DeviceObject,
- IN PVOID Context
-@@ -136,9 +137,9 @@
- //
- // Continue processing until there are no more closes to process.
- //
-+ /* ReactOS Change: "GCC suggest parentheses around assignment used as truth value" */
-+ while ((IrpContext = CdRemoveClose( Vcb ))) {
-
-- while (IrpContext = CdRemoveClose( Vcb )) {
--
- //
- // If we don't have an IrpContext then use the one on the stack.
- // Initialize it for this request.
-@@ -165,7 +166,7 @@
- // Free the IrpContextLite.
- //
-
-- CdFreeIrpContextLite( (PIRP_CONTEXT_LITE) IrpContext );
-+ CdFreeIrpContextLite( IrpContext ); /* ReactOS Change: GCC "error: invalid lvalue in unary '&'" */
-
- //
- // Remember we have the IrpContext from the stack.
-@@ -662,6 +663,7 @@
- }
-
- VOID
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdCloseWorker (
- IN PDEVICE_OBJECT DeviceObject,
- IN PVOID Context
-Index: drivers/filesystems/cdfs_new/dirsup.c
-===================================================================
---- drivers/filesystems/cdfs_new/dirsup.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/dirsup.c (working copy)
-@@ -465,7 +465,7 @@
- // Save a pointer to the time stamps.
- //
-
-- Dirent->CdTime = RawDirent->RecordTime;
-+ Dirent->CdTime = (PCHAR)RawDirent->RecordTime; /* ReactOS change: GCC "pointer targets in assignment differ in signedness" */
-
- //
- // Copy the dirent flags.
-@@ -501,7 +501,7 @@
- }
-
- Dirent->FileNameLen = RawDirent->FileIdLen;
-- Dirent->FileName = RawDirent->FileId;
-+ Dirent->FileName = (PCHAR)RawDirent->FileId; /* ReactOS change: GCC "pointer targets in assignment differ in signedness" */
-
- //
- // If there are any remaining bytes at the end of the dirent then
-@@ -1457,7 +1457,7 @@
- --*/
-
- {
-- XA_EXTENT_TYPE ExtentType;
-+ XA_EXTENT_TYPE ExtentType = 0; /* ReactOS Change: GCC Uninit var */
- PCOMPOUND_DIRENT CurrentCompoundDirent;
- PDIRENT CurrentDirent;
-
-Index: drivers/filesystems/cdfs_new/read.c
-===================================================================
---- drivers/filesystems/cdfs_new/read.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/read.c (working copy)
-@@ -79,7 +79,7 @@
- --*/
-
- {
-- NTSTATUS Status;
-+ NTSTATUS Status = STATUS_SUCCESS; /* ReactOS Change: GCC Uninit var */
- PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation( Irp );
-
- TYPE_OF_OPEN TypeOfOpen;
-@@ -225,8 +225,8 @@
- Status = FsRtlCheckOplock( &Fcb->Oplock,
- Irp,
- IrpContext,
-- CdOplockComplete,
-- CdPrePostIrp );
-+ (PVOID)CdOplockComplete,/* ReactOS Change: GCC "assignment from incompatible pointer type" */
-+ (PVOID)CdPrePostIrp );/* ReactOS Change: GCC "assignment from incompatible pointer type" */
-
- //
- // If the result is not STATUS_SUCCESS then the Irp was completed
-Index: drivers/filesystems/cdfs_new/volinfo.c
-===================================================================
---- drivers/filesystems/cdfs_new/volinfo.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/volinfo.c (working copy)
-@@ -166,8 +166,11 @@
-
- Status = CdQueryFsAttributeInfo( IrpContext, Fcb->Vcb, Irp->AssociatedIrp.SystemBuffer, &Length );
- break;
-+
-+ /* ReactOS Change: GCC "enumeration value not handled in switch" */
-+ default: break;
- }
--
-+
- //
- // Set the information field to the number of bytes actually filled in
- //
-Index: drivers/filesystems/cdfs_new/cddata.c
-===================================================================
---- drivers/filesystems/cdfs_new/cddata.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/cddata.c (working copy)
-@@ -417,7 +417,6 @@
- return Status;
- }
-
--
- #ifdef CD_SANITY
-
- VOID
-@@ -481,7 +480,6 @@
-
- #endif
-
--
- LONG
- CdExceptionFilter (
- IN PIRP_CONTEXT IrpContext,
-@@ -1006,6 +1004,7 @@
-
- \f
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdFastIoCheckIfPossible (
- IN PFILE_OBJECT FileObject,
- IN PLARGE_INTEGER FileOffset,
-Index: drivers/filesystems/cdfs_new/allocsup.c
-===================================================================
---- drivers/filesystems/cdfs_new/allocsup.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/allocsup.c (working copy)
-@@ -128,7 +128,7 @@
- {
- BOOLEAN FirstPass = TRUE;
- ULONG McbEntryOffset;
-- PFCB ParentFcb;
-+ PFCB ParentFcb = NULL; /* ReactOS Change: GCC uninitialized variable bug */
- BOOLEAN CleanupParent = FALSE;
-
- BOOLEAN UnlockFcb = FALSE;
-Index: drivers/filesystems/cdfs_new/verfysup.c
-===================================================================
---- drivers/filesystems/cdfs_new/verfysup.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/verfysup.c (working copy)
-@@ -431,7 +431,7 @@
- ULONG MediaChangeCount = 0;
- BOOLEAN ForceVerify = FALSE;
- BOOLEAN DevMarkedForVerify;
-- KIRQL SavedIrql;
-+ //KIRQL SavedIrql; /* ReactOS Change: GCC Unused variable */
-
- PAGED_CODE();
-
-@@ -581,6 +581,9 @@
-
- CdRaiseStatus( IrpContext, STATUS_FILE_INVALID );
- break;
-+
-+ /* ReactOS Change: GCC "enumeration value not handled in switch" */
-+ default: break;
- }
- }
-
-@@ -613,7 +616,7 @@
- --*/
-
- {
-- NTSTATUS Status = STATUS_SUCCESS;
-+ //NTSTATUS Status = STATUS_SUCCESS; /* ReactOS Change: GCC Unused variable */
- PVCB Vcb = Fcb->Vcb;
- PDEVICE_OBJECT RealDevice = Vcb->Vpb->RealDevice;
- PIRP Irp;
-Index: drivers/filesystems/cdfs_new/filobsup.c
-===================================================================
---- drivers/filesystems/cdfs_new/filobsup.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/filobsup.c (working copy)
-@@ -105,7 +105,7 @@
- FileObject->FsContext = Fcb;
- FileObject->FsContext2 = Ccb;
-
-- SetFlag( ((ULONG_PTR) FileObject->FsContext2), TypeOfOpen );
-+ SetFlag( (*(PULONG_PTR)&FileObject->FsContext2), TypeOfOpen ); /* ReactOS Change: GCC "invalid lvalue in assignment" */
-
- //
- // Set the Vpb field in the file object.
-@@ -176,7 +176,7 @@
- *Fcb = FileObject->FsContext;
- *Ccb = FileObject->FsContext2;
-
-- ClearFlag( (ULONG_PTR) *Ccb, TYPE_OF_OPEN_MASK );
-+ ClearFlag( (*(PULONG_PTR)Ccb), TYPE_OF_OPEN_MASK ); /* ReactOS Change: GCC "invalid lvalue in assignment" */
- }
-
- //
-Index: drivers/filesystems/cdfs_new/pathsup.c
-===================================================================
---- drivers/filesystems/cdfs_new/pathsup.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/pathsup.c (working copy)
-@@ -764,7 +764,7 @@
-
- PathEntry->PathEntryLength = WordAlign( PathEntry->PathEntryLength );
-
-- PathEntry->DirName = RawPathEntry->DirId;
-+ PathEntry->DirName = (PCHAR)RawPathEntry->DirId; /* ReactOS Change: GCC "assignment makes pointer from integer without a cast" */
-
- return TRUE;
- }
-Index: drivers/filesystems/cdfs_new/cdprocs.h
-===================================================================
---- drivers/filesystems/cdfs_new/cdprocs.h (revision 34615)
-+++ drivers/filesystems/cdfs_new/cdprocs.h (working copy)
-@@ -902,33 +904,39 @@
- }
-
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdNoopAcquire (
- IN PVOID Fcb,
- IN BOOLEAN Wait
- );
-
- VOID
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdNoopRelease (
- IN PVOID Fcb
- );
-
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdAcquireForCache (
- IN PFCB Fcb,
- IN BOOLEAN Wait
- );
-
- VOID
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdReleaseFromCache (
- IN PFCB Fcb
- );
-
- VOID
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdAcquireForCreateSection (
- IN PFILE_OBJECT FileObject
- );
-
- VOID
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdReleaseForCreateSection (
- IN PFILE_OBJECT FileObject
- );
-@@ -1184,8 +1192,8 @@
- // Verification support routines. Contained in verfysup.c
- //
-
--
--INLINE
-+/* ReactOS Change: "LD multiple definition of `_CdOperationIsDasdOpen'" */
-+static inline
- BOOLEAN
- CdOperationIsDasdOpen(
- IN PIRP_CONTEXT IrpContext
-@@ -1272,12 +1280,14 @@
- );
-
- VOID
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdPrePostIrp (
- IN PIRP_CONTEXT IrpContext,
- IN PIRP Irp
- );
-
- VOID
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdOplockComplete (
- IN PIRP_CONTEXT IrpContext,
- IN PIRP Irp
-@@ -1293,7 +1303,9 @@
- // otherwise
- //
-
--//#ifndef BooleanFlagOn
-+/* ReactOS Change: GCC doesn't understand the comment style */
-+/*
-+ //#ifndef BooleanFlagOn
- //#define BooleanFlagOn(F,SF) ( \
- // (BOOLEAN)(((F) & (SF)) != 0) \
- //)
-@@ -1310,6 +1322,7 @@
- // (Flags) &= ~(SingleFlag); \
- //}
- //#endif
-+*/
-
- //
- // CAST
-@@ -1598,6 +1611,7 @@
- //
-
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdFastQueryBasicInfo (
- IN PFILE_OBJECT FileObject,
- IN BOOLEAN Wait,
-@@ -1607,6 +1621,7 @@
- );
-
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdFastQueryStdInfo (
- IN PFILE_OBJECT FileObject,
- IN BOOLEAN Wait,
-@@ -1616,6 +1631,7 @@
- );
-
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdFastLock (
- IN PFILE_OBJECT FileObject,
- IN PLARGE_INTEGER FileOffset,
-@@ -1629,6 +1645,7 @@
- );
-
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdFastUnlockSingle (
- IN PFILE_OBJECT FileObject,
- IN PLARGE_INTEGER FileOffset,
-@@ -1640,6 +1657,7 @@
- );
-
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdFastUnlockAll (
- IN PFILE_OBJECT FileObject,
- PEPROCESS ProcessId,
-@@ -1648,6 +1666,7 @@
- );
-
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdFastUnlockAllByKey (
- IN PFILE_OBJECT FileObject,
- PVOID ProcessId,
-@@ -1657,6 +1676,7 @@
- );
-
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdFastIoCheckIfPossible (
- IN PFILE_OBJECT FileObject,
- IN PLARGE_INTEGER FileOffset,
-@@ -1669,6 +1689,7 @@
- );
-
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdFastQueryNetworkInfo (
- IN PFILE_OBJECT FileObject,
- IN BOOLEAN Wait,
-@@ -1862,17 +1883,26 @@
- //
- // #define try_return(S) { S; goto try_exit; }
- //
-+/* ReactOS Change: Remove SEH */
-+#define try
-+#define leave goto exitLabel;
-+#define finally if (0) goto exitLabel; exitLabel:
-+#define except(x) while (0)
-+#define GetExceptionCode() 0
-+#define AbnormalTermination() 0
-
- #define try_return(S) { S; goto try_exit; }
- #define try_leave(S) { S; leave; }
-
-+
- //
- // Encapsulate safe pool freeing
- //
-+/* ReactOS Change: GCC "passing argument 1 of CdFreePool from incompatible pointer type" */
-+#define CdFreePool(x) _CdFreePool((PVOID*)(x))
-
--INLINE
--VOID
--CdFreePool(
-+/* ReactOS Change: "LD multiple definition of `_CdOperationIsDasdOpen'" */
-+static inline void _CdFreePool(
- IN PVOID *Pool
- )
- {
-Index: drivers/filesystems/cdfs_new/resrcsup.c
-===================================================================
---- drivers/filesystems/cdfs_new/resrcsup.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/resrcsup.c (working copy)
-@@ -123,6 +123,7 @@
-
- \f
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdAcquireForCache (
- IN PFCB Fcb,
- IN BOOLEAN Wait
-@@ -159,6 +160,7 @@
-
- \f
- VOID
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdReleaseFromCache (
- IN PFCB Fcb
- )
-@@ -193,6 +195,7 @@
-
- \f
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdNoopAcquire (
- IN PVOID Fcb,
- IN BOOLEAN Wait
-@@ -224,6 +227,7 @@
-
- \f
- VOID
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdNoopRelease (
- IN PVOID Fcb
- )
-@@ -251,6 +255,7 @@
-
- \f
- VOID
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdAcquireForCreateSection (
- IN PFILE_OBJECT FileObject
- )
-@@ -298,6 +303,7 @@
-
- \f
- VOID
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdReleaseForCreateSection (
- IN PFILE_OBJECT FileObject
- )
-Index: drivers/filesystems/cdfs_new/namesup.c
-===================================================================
---- drivers/filesystems/cdfs_new/namesup.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/namesup.c (working copy)
-@@ -206,7 +206,7 @@
-
- {
- NTSTATUS Status;
-- PVOID NewBuffer;
-+ //PVOID NewBuffer; /* ReactOS Change: GCC Uninitialized variable */
-
- PAGED_CODE();
-
-Index: drivers/filesystems/cdfs_new/cdinit.c
-===================================================================
---- drivers/filesystems/cdfs_new/cdinit.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/cdinit.c (working copy)
-@@ -22,12 +22,14 @@
- #define BugCheckFileId (CDFS_BUG_CHECK_CDINIT)
-
- NTSTATUS
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- DriverEntry(
- IN PDRIVER_OBJECT DriverObject,
- IN PUNICODE_STRING RegistryPath
- );
-
- VOID
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdUnload(
- IN PDRIVER_OBJECT DriverObject
- );
-@@ -39,6 +41,7 @@
- );
-
- NTSTATUS
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdShutdown (
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp
-@@ -57,6 +60,7 @@
- //
-
- NTSTATUS
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- DriverEntry(
- IN PDRIVER_OBJECT DriverObject,
- IN PUNICODE_STRING RegistryPath
-@@ -169,6 +173,7 @@
- }
-
- NTSTATUS
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdShutdown (
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp
-@@ -200,6 +205,7 @@
-
-
- VOID
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdUnload(
- IN PDRIVER_OBJECT DriverObject
- )
-@@ -310,10 +316,10 @@
- // Initialize the cache manager callback routines
- //
-
-- CdData.CacheManagerCallbacks.AcquireForLazyWrite = &CdAcquireForCache;
-- CdData.CacheManagerCallbacks.ReleaseFromLazyWrite = &CdReleaseFromCache;
-- CdData.CacheManagerCallbacks.AcquireForReadAhead = &CdAcquireForCache;
-- CdData.CacheManagerCallbacks.ReleaseFromReadAhead = &CdReleaseFromCache;
-+ CdData.CacheManagerCallbacks.AcquireForLazyWrite = (PVOID)&CdAcquireForCache;/* ReactOS Change: GCC "assignment from incompatible pointer type" */
-+ CdData.CacheManagerCallbacks.ReleaseFromLazyWrite = (PVOID)&CdReleaseFromCache;/* ReactOS Change: GCC "assignment from incompatible pointer type" */
-+ CdData.CacheManagerCallbacks.AcquireForReadAhead = (PVOID)&CdAcquireForCache;/* ReactOS Change: GCC "assignment from incompatible pointer type" */
-+ CdData.CacheManagerCallbacks.ReleaseFromReadAhead = (PVOID)&CdReleaseFromCache;/* ReactOS Change: GCC "assignment from incompatible pointer type" */
-
- CdData.CacheManagerVolumeCallbacks.AcquireForLazyWrite = &CdNoopAcquire;
- CdData.CacheManagerVolumeCallbacks.ReleaseFromLazyWrite = &CdNoopRelease;
-Index: drivers/filesystems/cdfs_new/cdstruc.h
-===================================================================
---- drivers/filesystems/cdfs_new/cdstruc.h (revision 34615)
-+++ drivers/filesystems/cdfs_new/cdstruc.h (working copy)
-@@ -504,8 +504,8 @@
- //
-
- ULONG VcbCleanup;
-- ULONG VcbReference;
-- ULONG VcbUserReference;
-+ LONG VcbReference; /* ReactOS Change: GCC 'pointer targets in passing argument 1 of 'InterlockedXxx' differ in signedness */
-+ LONG VcbUserReference; /* ReactOS Change: GCC 'pointer targets in passing argument 1 of 'InterlockedXxx' differ in signedness */
-
- //
- // Fcb for the Volume Dasd file, root directory and the Path Table.
-@@ -655,7 +655,7 @@
- // executed later.
- //
-
-- ULONG PostedRequestCount;
-+ LONG PostedRequestCount; /* ReactOS Change: GCC "pointer targets in passing argument 1 of 'InterlockedDecrement' differ in signedness" */
-
- //
- // The following field indicates the number of IRP's waiting
-@@ -878,7 +878,7 @@
- //
-
- ULONG FcbCleanup;
-- ULONG FcbReference;
-+ LONG FcbReference; /* ReactOS Change: GCC 'pointer targets in passing argument 1 of 'InterlockedXxx' differ in signedness */
- ULONG FcbUserReference;
-
- //
-Index: drivers/filesystems/cdfs_new/lockctrl.c
-===================================================================
---- drivers/filesystems/cdfs_new/lockctrl.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/lockctrl.c (working copy)
-@@ -89,7 +89,7 @@
- Status = FsRtlCheckOplock( &Fcb->Oplock,
- Irp,
- IrpContext,
-- CdOplockComplete,
-+ (PVOID)CdOplockComplete,/* ReactOS Change: GCC "assignment from incompatible pointer type" */
- NULL );
-
- //
-@@ -138,6 +138,7 @@
-
- \f
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdFastLock (
- IN PFILE_OBJECT FileObject,
- IN PLARGE_INTEGER FileOffset,
-@@ -246,8 +247,8 @@
- //
- // Now call the FsRtl routine to perform the lock request.
- //
--
-- if (Results = FsRtlFastLock( Fcb->FileLock,
-+ /* ReactOS Change: GCC "suggest parentheses around assignment used as truth value" */
-+ if ((Results = FsRtlFastLock( Fcb->FileLock,
- FileObject,
- FileOffset,
- Length,
-@@ -257,7 +258,7 @@
- ExclusiveLock,
- IoStatus,
- NULL,
-- FALSE )) {
-+ FALSE ))) {
-
- //
- // Set the flag indicating if Fast I/O is questionable. We
-@@ -284,6 +285,7 @@
-
- \f
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdFastUnlockSingle (
- IN PFILE_OBJECT FileObject,
- IN PLARGE_INTEGER FileOffset,
-@@ -424,6 +426,7 @@
-
- \f
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdFastUnlockAll (
- IN PFILE_OBJECT FileObject,
- PEPROCESS ProcessId,
-@@ -546,6 +549,7 @@
-
- \f
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdFastUnlockAllByKey (
- IN PFILE_OBJECT FileObject,
- PVOID ProcessId,
-Index: drivers/filesystems/cdfs_new/strucsup.c
-===================================================================
---- drivers/filesystems/cdfs_new/strucsup.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/strucsup.c (working copy)
-@@ -438,7 +438,7 @@
- --*/
-
- {
-- ULONG Shift;
-+ //ULONG Shift; /* ReactOS Change: GCC Unused variable */
- ULONG StartingBlock;
- ULONG ByteCount;
-
-Index: drivers/filesystems/cdfs_new/fileinfo.c
-===================================================================
---- drivers/filesystems/cdfs_new/fileinfo.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/fileinfo.c (working copy)
-@@ -460,6 +460,7 @@
-
- \f
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdFastQueryBasicInfo (
- IN PFILE_OBJECT FileObject,
- IN BOOLEAN Wait,
-@@ -577,6 +578,7 @@
-
- \f
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdFastQueryStdInfo (
- IN PFILE_OBJECT FileObject,
- IN BOOLEAN Wait,
-@@ -704,6 +706,7 @@
-
- \f
- BOOLEAN
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdFastQueryNetworkInfo (
- IN PFILE_OBJECT FileObject,
- IN BOOLEAN Wait,
-Index: drivers/filesystems/cdfs_new/fsctrl.c
-===================================================================
---- drivers/filesystems/cdfs_new/fsctrl.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/fsctrl.c (working copy)
-@@ -82,7 +82,8 @@
- IN PIRP_CONTEXT IrpContext,
- IN PIRP Irp
- );
--
-+
-+NTSTATUS /* ReactOS Change: Function did not have a type??? */
- CdIsVolumeDirty (
- IN PIRP_CONTEXT IrpContext,
- IN PIRP Irp
-@@ -918,7 +919,7 @@
-
- if (CdIsRemount( IrpContext, Vcb, &OldVcb )) {
-
-- KIRQL SavedIrql;
-+ //KIRQL SavedIrql; /* ReactOS Change: GCC Unused variable */
-
- ASSERT( NULL != OldVcb->SwapVpb );
-
-@@ -1374,7 +1375,7 @@
- // Compute the length of the volume name
- //
-
-- AnsiLabel.Buffer = CdRvdVolId( RawIsoVd, Vcb->VcbState );
-+ AnsiLabel.Buffer = (PCHAR)CdRvdVolId( RawIsoVd, Vcb->VcbState ); /* ReactOS Change: GCC "pointer targets in assignment differ in signedness" */
- AnsiLabel.MaximumLength = AnsiLabel.Length = VOLUME_ID_LENGTH;
-
- UnicodeLabel.MaximumLength = VOLUME_ID_LENGTH * sizeof( WCHAR );
-@@ -1401,7 +1402,7 @@
- } else {
-
- CdConvertBigToLittleEndian( IrpContext,
-- CdRvdVolId( RawIsoVd, Vcb->VcbState ),
-+ (PCHAR)CdRvdVolId( RawIsoVd, Vcb->VcbState ),/* ReactOS Change: GCC "pointer targets in assignment differ in signedness" */
- VOLUME_ID_LENGTH,
- (PCHAR) VolumeLabel );
-
-@@ -2005,7 +2006,7 @@
- //
- // Local support routine
- //
--
-+NTSTATUS /* ReactOS Change: Function did not have a type??? */
- CdIsVolumeDirty (
- IN PIRP_CONTEXT IrpContext,
- IN PIRP Irp
-@@ -2296,9 +2297,9 @@
- 0,
- *IoFileObjectType,
- KernelMode,
-- &FileToMarkBad,
-+ (PVOID*)&FileToMarkBad, /* ReactOS Change: GCC "passing argument 5 of 'ObReferenceObjectByHandle' from incompatible pointer type" */
- NULL );
-
- if (!NT_SUCCESS(Status)) {
-@@ -2642,8 +2643,8 @@
- // The track address is BigEndian, we need to flip the bytes.
- //
-
-- Source = (PUCHAR) &CdromToc->TrackData[0].Address[3];
-- Dest = (PUCHAR) &BaseSector;
-+ Source = (PCHAR) &CdromToc->TrackData[0].Address[3];/* ReactOS Change: GCC "pointer targets in assignment differ in signedness" */
-+ Dest = (PCHAR) &BaseSector; /* ReactOS Change: GCC "pointer targets in assignment differ in signedness" */
-
- do {
-
-@@ -3118,7 +3119,7 @@
- if (NT_SUCCESS( RtlOemToUnicodeN( &Vcb->Vpb->VolumeLabel[0],
- MAXIMUM_VOLUME_LABEL_LENGTH,
- &Length,
-- CdRvdVolId( RawIsoVd, Vcb->VcbState ),
-+ (PCHAR)CdRvdVolId( RawIsoVd, Vcb->VcbState ),/* ReactOS Change: GCC "pointer targets in assignment differ in signedness" */
- VOLUME_ID_LENGTH ))) {
-
- Vcb->Vpb->VolumeLabelLength = (USHORT) Length;
-@@ -3131,7 +3132,7 @@
- } else {
-
- CdConvertBigToLittleEndian( IrpContext,
-- CdRvdVolId( RawIsoVd, Vcb->VcbState ),
-+ (PCHAR)CdRvdVolId( RawIsoVd, Vcb->VcbState ),/* ReactOS Change: GCC "pointer targets in assignment differ in signedness" */
- VOLUME_ID_LENGTH,
- (PCHAR) Vcb->Vpb->VolumeLabel );
-
-Index: drivers/filesystems/cdfs_new/pnp.c
-===================================================================
---- drivers/filesystems/cdfs_new/pnp.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/pnp.c (working copy)
-@@ -51,6 +51,7 @@
- );
-
- NTSTATUS
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdPnpCompletionRoutine (
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
-@@ -774,6 +775,7 @@
- //
-
- NTSTATUS
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdPnpCompletionRoutine (
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
-Index: drivers/filesystems/cdfs_new/workque.c
-===================================================================
---- drivers/filesystems/cdfs_new/workque.c (revision 34615)
-+++ drivers/filesystems/cdfs_new/workque.c (working copy)
-@@ -97,6 +97,7 @@
-
- \f
- VOID
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdPrePostIrp (
- IN PIRP_CONTEXT IrpContext,
- IN PIRP Irp
-@@ -209,6 +210,7 @@
-
- \f
- VOID
-+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
- CdOplockComplete (
- IN PIRP_CONTEXT IrpContext,
- IN PIRP Irp
-@@ -386,7 +388,7 @@
- //
-
- ExInitializeWorkItem( &IrpContext->WorkQueueItem,
-- CdFspDispatch,
-+ (PVOID)CdFspDispatch,/* ReactOS Change: GCC "assignment from incompatible pointer type" */
- IrpContext );
-
- ExQueueWorkItem( &IrpContext->WorkQueueItem, CriticalWorkQueue );
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
_Requires_lock_held_(_Global_critical_region_)
VOID
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdPrePostIrp (
_Inout_ PIRP_CONTEXT IrpContext,
_Inout_ PIRP Irp
_Requires_lock_held_(_Global_critical_region_)
VOID
+NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
CdOplockComplete (
_Inout_ PIRP_CONTEXT IrpContext,
_Inout_ PIRP Irp
// Send it off.....
//
+#ifdef _MSC_VER
#pragma prefast(suppress:28155, "the function prototype is correct")
+#endif
ExInitializeWorkItem( &IrpContext->WorkQueueItem,
- CdFspDispatch,
+ (PVOID)CdFspDispatch,/* ReactOS Change: GCC "assignment from incompatible pointer type" */
IrpContext );
+#ifdef _MSC_VER
#pragma prefast(suppress: 28159, "prefast believes this routine is obsolete, but it is ok for CDFS to continue using it")
+#endif
ExQueueWorkItem( &IrpContext->WorkQueueItem, CriticalWorkQueue );
return;
--*/
-#include "CdProcs.h"
+#include "cdprocs.h"
//
// The Bug check file id for this module
// This macro just puts a nice little try-except around RtlZeroMemory
//
+#ifndef __REACTOS__
#define SafeZeroMemory(IC,AT,BYTE_COUNT) { \
- try { \
+ _SEH2_TRY { \
RtlZeroMemory( (AT), (BYTE_COUNT) ); \
__pragma(warning(suppress: 6320)) \
- } except( EXCEPTION_EXECUTE_HANDLER ) { \
+ } _SEH2_EXCEPT( EXCEPTION_EXECUTE_HANDLER ) { \
CdRaiseStatus( IC, STATUS_INVALID_USER_BUFFER ); \
- } \
+ } _SEH2_END; \
}
-
+#else
+#define SafeZeroMemory(IC,AT,BYTE_COUNT) { \
+ _SEH2_TRY { \
+ RtlZeroMemory( (AT), (BYTE_COUNT) ); \
+ } _SEH2_EXCEPT( EXCEPTION_EXECUTE_HANDLER ) { \
+ CdRaiseStatus( IC, STATUS_INVALID_USER_BUFFER ); \
+ } _SEH2_END; \
+}
+#endif
#ifdef ALLOC_PRAGMA
#pragma alloc_text(PAGE, CdCommonWrite)
// Use a try-finally to facilitate cleanup.
//
- try {
+ _SEH2_TRY {
//
// Verify the Fcb. Allow writes if this is a DASD handle that is
}
try_exit: NOTHING;
- } finally {
+ } _SEH2_FINALLY {
//
// Release the Fcb.
CdReleaseFile( IrpContext, Fcb );
}
- }
+ } _SEH2_END;
//
// Post the request if we got CANT_WAIT.