Ramdisk load-unload-reload

Hello,
I have written a nonpnp KMDF driver program using WDF 6001.18002.This creates a ramdisk. It gets loaded and unloaded dynamically and works fine for once.If I try to reload, I get the error that service is marked for deletion.My kernel mode program does not enter the unload routine even though I have declared it using EvtIoUnload.
I am using FAT filesystem on that drive. For that I have declared the BootSector structure in a header file. If I use pragma pack(1) before the declaration of BootSector structure, exactly it takes 512 bytes and allows all disk operations ie., I can write to that disk and read from that disk but does not enter the unload routine. In the other case, if I do not use pragma pack(1), Boot Sector structure occupies 520 bytes and unload routine gets called while I can not access the disk ie., I could not read from the disk as well as write to the disk.
Can anybody help me in this? please…

Well, I know why the size of the structure is different, but I’m not really sure what you’re saying about being ‘unable’ to write.

mm

>service is marked for deletion.My kernel mode program does not enter the unload routine even though

I have declared it using EvtIoUnload.

Some device objects are still alive.

I do not think you can delete a mountable disk device object in Windows without having full PnP support.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

Hello,
What I mean by writing to the drive means creating files and writing to them.