Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.8 KiB

  1. //Copyright (c) 1998 - 1999 Microsoft Corporation
  2. //
  3. // subcomp.h
  4. // defines a subcomponent class
  5. //
  6. #ifndef _subcomp_h_
  7. #define _subcomp_h_
  8. #include "hydraoc.h"
  9. #define RUNONCE_SECTION_KEYWORD _T("RunOnce.Setup")
  10. #define RUNONCE_DEFAULTWAIT 5 * 60 * 1000 // 5 mins default wait for process to complete.
  11. #define RUNONCE_CMDBUFSIZE 512
  12. class OCMSubComp
  13. {
  14. private:
  15. LONG m_lTicks;
  16. public:
  17. enum ESections
  18. {
  19. kFileSection,
  20. kRegistrySection,
  21. kDiskSpaceAddSection
  22. };
  23. OCMSubComp ();
  24. void Tick (DWORD dwTickCount = 1);
  25. void TickComplete ();
  26. BOOL HasStateChanged() const;
  27. BOOL GetCurrentSubCompState () const;
  28. BOOL GetOriginalSubCompState () const;
  29. DWORD LookupTargetSection (LPTSTR szTargetSection, DWORD dwSize, LPCTSTR lookupSection);
  30. DWORD GetTargetSection (LPTSTR szTargetSection, DWORD dwSize, ESections eSectionType, BOOL *pbNoSection);
  31. virtual LPCTSTR GetSubCompID () const = 0;
  32. virtual LPCTSTR GetSectionToBeProcessed (ESections) const = 0;
  33. //
  34. // default implementaion is provided for all these
  35. //
  36. virtual BOOL Initialize ();
  37. virtual BOOL BeforeCompleteInstall ();
  38. virtual BOOL AfterCompleteInstall ();
  39. virtual DWORD GetStepCount () const;
  40. virtual DWORD OnQuerySelStateChange (BOOL bNewState, BOOL bDirectSelection) const;
  41. virtual DWORD OnQueryState (UINT uiWhichState) const;
  42. virtual DWORD OnCalcDiskSpace (DWORD addComponent, HDSKSPC dspace);
  43. virtual DWORD OnQueueFiles (HSPFILEQ queue);
  44. virtual DWORD OnCompleteInstall ();
  45. virtual DWORD OnAboutToCommitQueue ();
  46. // implemented by this class.
  47. DWORD OnQueryStepCount ();
  48. virtual VOID SetupRunOnce( HINF inf, LPCTSTR SectionName );
  49. };
  50. #endif // _subcomp_h_