20楼#
发布于:2007-06-04 21:26
flush 在一个文件已经被映射到进程的地址空间(而且还是以image方式映射的),这个时候是不能调用的! 再说你的驱动也没有办法调用flush,那是在文件系统上面调用的.
|
|
21楼#
发布于:2007-06-07 14:36
VOID
RamDiskCleanUp( IN PDEVICE_OBJECT DeviceObject ) /*++ Routine Description: This routine does the required cleaning like deleting the symbolic link releasjing the memory etc. Arguments: DeviceObject - Supplies a pointer to the device object that represents the device whose capacity is to be read. Return Value: None. --*/ { PDEVICE_EXTENSION devExt = DeviceObject->DeviceExtension; PAGED_CODE(); DBGPRINT( DBG_COMP_PNP, DBG_LEVEL_VERBOSE, ("RamDiskCleanUp\n" ) ); if ( devExt->Flags & FLAG_LINK_CREATED ) { IoDeleteSymbolicLink( &devExt->SymbolicLink ); } if ( devExt->SymbolicLink.Buffer ) { ExFreePool( devExt->SymbolicLink.Buffer ); } if ( devExt->DiskRegInfo.DriveLetter.Buffer ) { ExFreePool( devExt->DiskRegInfo.DriveLetter.Buffer ); } if ( devExt->DiskImage ) { ExFreePool( devExt->DiskImage ); } if ( devExt->LowerDeviceObject ) { IoDetachDevice( devExt->LowerDeviceObject ); } IoDeleteDevice( DeviceObject ); return; } 楼主,这个行不行, 问一下,RamDisk能否改变成大缓存驱动,减少磁盘读写次数,提高pc性能? 就是当应用层读大文件时,我先从我的RamDisk中调数据,如果没有对应的文件或数据存在,则 从硬盘中读2Mb到我的内存虚拟磁盘中并缓存起来.否则我直接从内存中取数据,请问是否可行? |
|
上一页
下一页