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.

79 lines
2.3 KiB

  1. #ifndef __APPMGR_H_
  2. #define __APPMGR_H_
  3. #define REGSTR_PATH_APPPUBLISHER TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\App Management\\Publishers")
  4. // Structure to contain the list of GUIDs for a category
  5. typedef struct _GuidList
  6. {
  7. GUID CatGuid;
  8. IAppPublisher * papSupport;
  9. struct _GuidList * pNextGuid;
  10. } GUIDLIST;
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CShellAppManager
  13. class CShellAppManager : public IShellAppManager
  14. {
  15. public:
  16. CShellAppManager();
  17. // *** IUnknown Methods
  18. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  19. virtual STDMETHODIMP_(ULONG) AddRef(void) ;
  20. virtual STDMETHODIMP_(ULONG) Release(void);
  21. // *** IShellAppManager
  22. STDMETHODIMP GetNumberofInstalledApps(DWORD * pdwResult);
  23. STDMETHODIMP EnumInstalledApps(IEnumInstalledApps ** ppeia);
  24. STDMETHODIMP GetPublishedAppCategories(PSHELLAPPCATEGORYLIST psacl);
  25. STDMETHODIMP EnumPublishedApps(LPCWSTR pszCategory, IEnumPublishedApps ** ppepa);
  26. STDMETHODIMP InstallFromFloppyOrCDROM(HWND hwndParent);
  27. protected:
  28. virtual ~CShellAppManager();
  29. LONG _cRef;
  30. // App Publisher List
  31. HDPA _hdpaPub;
  32. // Item of the Internal Category List
  33. #define CATEGORYLIST_GROW 16
  34. typedef struct _CategoryItem
  35. {
  36. LPWSTR pszDescription;
  37. GUIDLIST * pGuidList;
  38. } CATEGORYITEM;
  39. // Category List
  40. HDSA _hdsaCategoryList;
  41. void _Lock(void);
  42. void _Unlock(void);
  43. CRITICAL_SECTION _cs;
  44. DEBUG_CODE( LONG _cRefLock; )
  45. // Internal structure funcitons
  46. void _DestroyGuidList(GUIDLIST * pGuidList);
  47. #ifndef DOWNLEVEL_PLATFORM
  48. HRESULT _AddCategoryToList(APPCATEGORYINFO * pai, IAppPublisher * pap);
  49. HRESULT _BuildInternalCategoryList(void);
  50. HRESULT _CompileCategoryList(PSHELLAPPCATEGORYLIST pascl);
  51. #endif //DOWNLEVEL_PLATFORM
  52. void _DestroyCategoryItem(CATEGORYITEM * pci);
  53. void _DestroyInternalCategoryList(void);
  54. void _DestroyAppPublisherList(void);
  55. #ifndef DOWNLEVEL_PLATFORM
  56. GUIDLIST * _FindGuidListForCategory(LPCWSTR pszDescription);
  57. #endif //DOWNLEVEL_PLATFORM
  58. BOOL _bCreatedTSMsiHack; // The "EnableAdminRemote" value for MSI to work on TS
  59. };
  60. #endif //__APPMGR_H_