Application Restart and Recovery on Windows 7 in Native Code
- Posted: Mar 16, 2011 at 11:39 AM
- 28,933 Views
- 8 Comments
Download
How do I download the videos?
- To download, right click the file type you would like and pick “Save target as…” or “Save link as…”
Why should I download videos from Channel9?
- It's an easy way to save the videos you like locally.
- You can save the videos in order to watch them offline.
- If all you want is to hear the audio, you can download the MP3!
Which version should I choose?
- If you want to view the video on your PC, Xbox or Media Center, download the High Quality WMV file (this is the highest quality version we have available).
- If you'd like a lower bitrate version, to reduce the download time or cost, then choose the Medium Quality WMV file.
- If you have a Zune, WP7, iPhone, iPad, or iPod device, choose the low or medium MP4 file.
- If you just want to hear the audio of the video, choose the MP3 file.
Right click “Save as…”
- High Quality WMV (PC, Xbox, MCE)
- MP3 (Audio only)
- Mid Quality WMV (Lo-band, Mobile)
- High Quality MP4 (iPad, PC)
- MP4 (iPod, Zune HD)
Application Recovery and Restart (ARR) technologies enable developers to customize an application's behavior when Windows Error Reporting (WER) terminates the application due to an unrecoverable error. For example, it enables an application to perform data recovery and cleanup operations such as capturing application state and releasing resources before termination. It also allows developers to specify that WER should automatically restart an application that it has terminated.
In this screencast, Kate Gregory (@gregcons) provides an overview of ARR on Windows 7. Kate also demonstrates how to integrate ARR into your native applications via Win32.
Update (March 22, 2011 - 5:40 PM): The Windows Restart and Recovery Recipe is now available to download.
Comments Closed
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
I labelled this screencast as native code for developers who draw a comparison to managed code (i.e. CLR). And, don't worry: more C++ stuff is on the way! Let me know if there's anything in particular that you'd like to see!
Surprised this was not up on the Channel9 Zune podcasts. Good work Kate.
Now it is
John, please let me know when you are going to post content created by Kate and I will ensure it shows up in our main feed. Go Kate. Go!
C
@Charles: Will do. We have one more in the hopper.
But why ?
Clearly this is native, since you should be able to use the code in NativeAndRestartRecovery.h even for non-MFC C++ applications (not tested).
But I am not too happy, because the recipe is full of memory leaks.
In NativeTestDlg.cpp there is a memory leak on line 66 (the memory pointed to by former doc is lost).
In NativeTestDlg.cpp there is a memory leak on line 70 (the memory pointed to by rrh lost).
CNativeTestHarnessDlg has no destructor, so the memory pointed to by doc leaks.
NativeAndRestartRecovery.h there is a potential memory leak on line 66 if the supplied 'T::operator >>' throws.
If you dont want to handle it, use RAII (in these cases unique_ptr or shared_ptr or even auto_ptr, since the code was written a year ago).
Another problem I see is that the recovery may fail due to dead lock/races as your program is in an undefined state and you launch a new thread; what if the program crashes in HeapAlloc due to Heap corruption or your gui is not responding but some thread is updating the recovery document structure.
These problems seem not to be handled by this 'recipe', but I dont know what magic Windows does under the covers. Another issue are Blue Screens or power failures. So it would be still appropiate to save application state as the application is in a known state.
But I might have missed the point of this cast.
Daniel
Has anyone tried to build the sample NativeTestHarness in Visual Studio 2010? I built the sample, but, it will not crash. I've entered data and clicked the "Crash" button, but, the app stays alive.
Any idea whats goig on here?
Remove this comment
Remove this thread
close