About Loadstub

[This is preliminary documentation and subject to change.]

Guide database loaders are all called as needed by a standard loader stub program. This stub program, Loadstub.exe, is scheduled to run at appropriate times to update the Guide database.

When the stub program starts, it first parses the command line for recognized options. The options Loadstub recognizes are /X, /R, /C, /E and /LEH; for more information on these options, see Using Loadstub. Loadstub passes any other options on to the loader. Loadstub parses options in this order:

  1. It executes the /X option to replace the database, if it exists.
  2. It starts the Microsoft® Jet database engine.
  3. It executes the /R option to repair the database, if this option exists, and does a quick check and repair of corruption errors if it does not.
  4. It executes the /C option to compact the database, if the option exists. The /C also repairs the database before compaction.
  5. It executes the /E option, if it exists, to empty a specified tuning space.
  6. It executes the /LEH option to load the specified enhancements file, if the option exists.

Once Loadstub has parsed all options, it:

  1. Uses the globally unique identifier (GUID) from the command line to extract the name of the loader DLL from the registry.
  2. Extracts user and password information from the loader.
  3. Opens a workspace in the DAO database named LoaderWSP and a user named loader.
  4. Creates a window message by calling the RegisterWindowMessage function, part of the Microsoft® Win32® application programming interface (API). On the RegisterWindowMessage call, Loadstub passes the string representation of the loader's GUID.
  5. Broadcasts an EPGLDR_STARTING message to notify broadcast client applications that the database is receiving updated data. For more information on broadcast window messages, see Sending Loader Event Notifications.
  6. Starts the loader DLL.
  7. Broadcasts an EPGLDR_ENDING message to notify client applications that the database update is completed and to indicate success or failure.
  8. Updates the LastAttempt and LastRun entries in the Program Guide Loaders key of the system registry.