Hybrid sleep is indeed an important issue for privacy.
I forgot to say that the previously pointed command also disable the hibernation. But obviously, if you are using encryption tools, you'll want to avoid to write everything to the hard drive: unencrypted data, encryption keys...
By the way, if you don't use system encryption but still use ImDisk, you can take a look at my ProxyCrypt (but containers are not compatible).
I think to add an option to force the dismount of the ramdisk at system shutdown, but I wonder how to implement that. There is already a service used for waiting the system shutdown, but it cannot be used for that because it already process a pre-shutdown notification which prevents it to receive the final shutdown notification that would be required for dismounting the volume.
So, unless creating a new service, this could be difficult.
But there is already:
- "ImDisk Virtual Disk Driver Helper": used by the driver
- "ImDisk RamDisk starter": used by the Toolkit to mount the ramdisks at system boot
- "ImDisk Toolkit helper service": installed if you use the data synchronization at system shutdown
A 4th service might be a bit overkill...
An easier alternative would be to display a warning if the hybrid sleep is enabled and the user attempts to mount a static ramdisk, with a button to disable the hybrid sleep in one click (with, as a side effect, to also disable the hibernation because on Windows 8/8.1, disable only the hybrid sleep in the power policy does not work, I don't have checked yet on Windows 10 because it requires a physical machine).
But of course, with that, the system startup can be slower. So it's not an elegant solution.