Platform SDK: Broadcast Architecture

Processing Quit Events

While a loader is loading data into the Guide database, the Loadstub component cannot check for messages from the operating system. Thus, the loader cannot receive a notification to quit processing.

Instead, Loadstub monitors the operating-system message queue for notifications of quit events. At convenient times in loader processing, your loader should call the function at the address specified by pfnForceQuit, a parameter that Loadstub.exe passes to the loader entry-point function. Use of the function pointed to by pfnForceQuit enables Loadstub to forward quit event notifications to the loader so that the loader can stop processing, if necessary.

Your loader can instruct Loadstub to monitor for quit event notifications by calling the following code whenever loader processing can be gracefully stopped.

if ((*pfnForceQuit()){ 
  //Code to clean up and gracefully exit the loader
}

where pfnForceQuit was passed in the entry-point function.