是否有任何库或软件或任何方法可以将 Windows 中单个进程的状态保存到文件中,然后将正在运行的进程恢复到稍后已加载所有内存的运行状态?
我知道必须重新打开打开的句柄,可能必须启动线程等,但是至少可以恢复堆和单个线程堆栈吗?
我看到这个问题 ,但是答案都是针对linux的,大部分都说做不到。
我知道我可以使所有数据结构可序列化并自己完成,但我想知道如果不这样做是否可行。
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.
发布评论
评论(2)
Raymond Chen(当谈到晦涩的 Windows 知识时,他甚至可能会踢 Jon Skeet 的屁股) )说这是不可能的。
本质上,除非您的进程完全不使用系统资源(例如任何类型的句柄),否则总会有一些您无法保存和恢复的操作系统状态。
解决此问题的最实用方法是创建一个运行另一个 Windows 实例的 VM,并在其中运行您的进程:
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:
>> •您可以使用nLite 使来宾操作系统尽可能轻量。
添加到上述声明 - Windows XP 的官方轻量级版本是“XP Embedded”或“Windows 嵌入式标准"。 它是 XP 的高度组件化版本,可让您将 XP 映像缩小至 40 MB。
Windows 7 的“轻量级”版本是 Windows Embedded Standard 2011,目前处于 Beta 阶段并可供下载 (connect.microsoft.com/windowsembedded)
当然,与 NLite 不同,它不是免费软件。
谢谢,
斯里坎特
>> •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