Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hibernating a single process in Windows

Is there any library or software or any way of saving the state of a single process in Windows to a file, then restoring the running process to a running state with all the memory already loaded at a later time?

I am aware that open handles will have to be re-opened, threads may have to started, etc, but can the heap and a single thread stack at least be restored?

I saw this question, but the answers are all for linux and most of them say it can't be done.

I know I can make all of my data structures serializable and do it myself, but I'd like to know if it is possible without that.

like image 882
Carlos A. Ibarra Avatar asked Apr 24 '09 19:04

Carlos A. Ibarra


2 Answers

Raymond Chen (who may even kick Jon Skeet's ass when it comes to obscure Windows knowledge) says it isn't possible.

Essentially, unless your process uses absolutely no system resources (e.g. handles of any kind), there's always going to be some OS state which you can't save and restore.

The most practical way of solving this problem is to create a VM running another instance of Windows and run your process inside that:

  • You can make the guest OS as lightweight as possible by using nLite.
  • You can then use the VMWare VIX API to suspend/resume the VM programmatically.
  • This of course suspends the guest OS, and your process with it, solving the OS state problem.
like image 50
snowcrash09 Avatar answered Nov 01 '22 03:11

snowcrash09


>> •You can make the guest OS as lightweight as possible by using nLite.

To add to the above statement - The official lightweight version of Windows XP is "XP Embedded" or "Windows Embedded Standard". It is a heavily componentized version of XP that lets you slim down the XP image as small as 40 MB.

The "light weight" version of Windows 7 is Windows Embedded Standard 2011 , which is currently in Beta and available for download (connect.microsoft.com/windowsembedded)

Of course , it is not a freeware unlike NLite.

Thanks,

Srikanth

like image 43
Colonel Panic Avatar answered Nov 01 '22 05:11

Colonel Panic