Hello all devs!!
I’m a student and I’m developing my Final Project in the University. I
have to develop a driver for Windows XP that work so:
I have a file in the HD (NTFS file system) of my PC and I want to copy it
to the floppy disk (FAT16 file system). But I need that the file data in
the floppy disk is modified (added 1 respect to the original value).
For example:
I have-> HD file data: ‘hello’
I need to obtain -> Floppy file data: ‘ifmmp’
I know I have to write a File System Filter Driver.
I’m working about the sample code ‘sfilter.c’ of IFS Kit.
I think that one of the routines which will be modified is this:
BOOLEAN
SfFastIoRead (IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset,
IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, OUT PVOID Buffer,
OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
{
PDEVICE_OBJECT nextDeviceObject;
PFAST_IO_DISPATCH fastIoDispatch;
PAGED_CODE();
VALIDATE_IRQL(Irp);
if (DeviceObject->DeviceExtension) {
ASSERT(IS_MY_DEVICE_OBJECT( DeviceObject ));
//
// Pass through logic for this type of Fast I/O
//
nextDeviceObject = ((PSFILTER_DEVICE_EXTENSION)
DeviceObject->DeviceExtension)->AttachedToDeviceObject;
ASSERT(nextDeviceObject);
fastIoDispatch = nextDeviceObject->DriverObject->FastIoDispatch;
if (VALID_FAST_IO_DISPATCH_HANDLER( fastIoDispatch, FastIoRead ))
{
return (fastIoDispatch->FastIoRead)(
FileObject,
FileOffset,
Length,
Wait,
LockKey,
Buffer,
IoStatus,
nextDeviceObject );
}
}
return FALSE;
}
I suppose what I have to modify is the parameter “buffer” but I’m not sure
and I don’t know how I have to do.
It’s the first time I face a problem so serious because I have never
worked with drivers.
Please, could you help me?
Thanks a lot