在 Windows 中休眠单个进程

发布于 2024-07-18 03:44:45 字数 345 浏览 4 评论 0 原文

是否有任何库或软件或任何方法可以将 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

您的好友蓝忘机已上羡 2024-07-25 03:44:45

Raymond Chen(当谈到晦涩的 Windows 知识时,他甚至可能会踢 Jon Skeet 的屁股) )说这是不可能的

本质上,除非您的进程完全不使用系统资源(例如任何类型的句柄),否则总会有一些您无法保存和恢复的操作系统状态。

解决此问题的最实用方法是创建一个运行另一个 Windows 实例的 VM,并在其中运行您的进程:

  • 您可以使用 nLite.
  • 然后,您可以使用 VMWare VIX API 以编程方式挂起/恢复虚拟机。
  • 这当然会挂起来宾操作系统以及您的进程,从而解决操作系统状态问题。

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.
筱武穆 2024-07-25 03:44:45

>> •您可以使用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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文