mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
[CDFS_NEW] Following 1bef487
, add a hack and stub FastIO write routine to avoid bugchecks on write attempts.
This allows booting the ReactOS LiveCD as HDD image in Qemu without issues :-)
This commit is contained in:
parent
1bef48796e
commit
5f255827d3
1 changed files with 36 additions and 0 deletions
|
@ -58,6 +58,29 @@ CdShutdown (
|
||||||
#pragma alloc_text(INIT, CdInitializeGlobalData)
|
#pragma alloc_text(INIT, CdInitializeGlobalData)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
|
||||||
|
//
|
||||||
|
// Stub for CcWrite, this is a hack
|
||||||
|
//
|
||||||
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
|
CdFastIoWrite (
|
||||||
|
IN PFILE_OBJECT FileObject,
|
||||||
|
IN PLARGE_INTEGER FileOffset,
|
||||||
|
IN ULONG Length,
|
||||||
|
IN BOOLEAN Wait,
|
||||||
|
IN ULONG LockKey,
|
||||||
|
IN PVOID Buffer,
|
||||||
|
OUT PIO_STATUS_BLOCK IoStatus,
|
||||||
|
IN PDEVICE_OBJECT DeviceObject)
|
||||||
|
{
|
||||||
|
ASSERT(FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Local support routine
|
// Local support routine
|
||||||
|
@ -342,6 +365,19 @@ Return Value:
|
||||||
CdFastIoDispatch.SizeOfFastIoDispatch = sizeof(FAST_IO_DISPATCH);
|
CdFastIoDispatch.SizeOfFastIoDispatch = sizeof(FAST_IO_DISPATCH);
|
||||||
CdFastIoDispatch.FastIoCheckIfPossible = CdFastIoCheckIfPossible; // CheckForFastIo
|
CdFastIoDispatch.FastIoCheckIfPossible = CdFastIoCheckIfPossible; // CheckForFastIo
|
||||||
CdFastIoDispatch.FastIoRead = FsRtlCopyRead; // Read
|
CdFastIoDispatch.FastIoRead = FsRtlCopyRead; // Read
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
|
||||||
|
//
|
||||||
|
// Add a stub for CdFastIoWrite. This is a hack required because
|
||||||
|
// our current implementation of NtWriteFile won't validate
|
||||||
|
// access granted to files opened. And some applications may attempt
|
||||||
|
// to write to a file. In case it is cached, the kernel will null-dereference
|
||||||
|
// the fastIO routine, trying to call it.
|
||||||
|
// FIXME: remove once NtWriteFile got fixed!
|
||||||
|
//
|
||||||
|
|
||||||
|
CdFastIoDispatch.FastIoWrite = CdFastIoWrite; // Write
|
||||||
|
#endif
|
||||||
CdFastIoDispatch.FastIoQueryBasicInfo = CdFastQueryBasicInfo; // QueryBasicInfo
|
CdFastIoDispatch.FastIoQueryBasicInfo = CdFastQueryBasicInfo; // QueryBasicInfo
|
||||||
CdFastIoDispatch.FastIoQueryStandardInfo = CdFastQueryStdInfo; // QueryStandardInfo
|
CdFastIoDispatch.FastIoQueryStandardInfo = CdFastQueryStdInfo; // QueryStandardInfo
|
||||||
CdFastIoDispatch.FastIoLock = CdFastLock; // Lock
|
CdFastIoDispatch.FastIoLock = CdFastLock; // Lock
|
||||||
|
|
Loading…
Reference in a new issue