开发者

Creating an Application to Save Arbitrary Application State

开发者 https://www.devze.com 2023-02-03 13:42 出处:网络
See this SuperUser question. To summarize, VM software lets you save state of arbitrary applications (by saving the whole VM image).

See this SuperUser question. To summarize, VM software lets you save state of arbitrary applications (by saving the whole VM image).

Would it be possible to write some software for Windows that allows you to save and reload arbitrary application state? If so (and presumably so), what would it entail?

I would be looking to implement this, if possible, in a high-level language like C#. I presume if I used something else, I would need to开发者_开发百科 dump memory registers (or maybe dump the entire application memory block) to a file somewhere and load it back somewhere to refresh state.

So how do I build this thing?


Well, it's unlikely that this is going to happen, especially not in C# - addressing the low level requirements in managed code would hardly be possible. Saving the state of a whole virtual machine is actually easier than just saving single processes, all you have to do is dump the whole machine memory and ensure a consistent disk image, which, given the capabilities of Virtualization software, is rather straightforward.

Restoring a single process would imply loading all shared objects that the process refers to, including whatever objects the process refers to in kernel space, i.e. file/memory/mutex/whatever handles, and without the whole machine / operating system being virtual, this would mean poking deep down in the internals of Windows...

All I'm saying is: while it is possible, the effort would be tremendous and probably not worth it.

0

精彩评论

暂无评论...
验证码 换一张
取 消