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.

100 lines
2.7 KiB

  1. #pragma once
  2. #define OTHERFILES 0
  3. #define MANIFEST 1
  4. class CAssemblyCache : public IAssemblyCacheImport, public IAssemblyCacheEmit
  5. {
  6. public:
  7. enum CacheFlags
  8. {
  9. Base = 0,
  10. Staging
  11. };
  12. typedef enum
  13. {
  14. COMPLETED = 0,
  15. CONFIRMED,
  16. CRITICAL
  17. } CacheStatus;
  18. // IUnknown methods
  19. STDMETHODIMP QueryInterface(REFIID riid,void ** ppv);
  20. STDMETHODIMP_(ULONG) AddRef();
  21. STDMETHODIMP_(ULONG) Release();
  22. // Import/Emit methods
  23. STDMETHOD(GetManifestImport)(
  24. /* out */ LPASSEMBLY_MANIFEST_IMPORT *ppManifestImport);
  25. STDMETHOD(GetManifestFilePath)(
  26. /* out */ LPOLESTR *ppwzManifestFilePath,
  27. /* in, out */ LPDWORD ccManifestFilePath);
  28. STDMETHOD(GetManifestFileDir)(
  29. /* out */ LPOLESTR *ppwzManifestFileDir,
  30. /* in, out */ LPDWORD ccManifestFileDir);
  31. STDMETHOD(GetDisplayName)(
  32. /* out */ LPOLESTR *ppwzDisplayName,
  33. /* out */ LPDWORD ccDisplayName);
  34. // Import only methods
  35. STDMETHOD(FindExistMatching)(
  36. /* in */ LPASSEMBLY_FILE_INFO pAssemblyFileInfo,
  37. /* out */ LPOLESTR *ppwzPath);
  38. // Emit only methods
  39. STDMETHOD(CopyFile)(
  40. /* in */ LPOLESTR pwzSourcePath,
  41. /* in */ LPOLESTR pwzFileName,
  42. /* in */ DWORD dwFlags);
  43. STDMETHOD(Commit)(
  44. /* in */ DWORD dwFlags);
  45. CAssemblyCache();
  46. ~CAssemblyCache();
  47. static HRESULT CreateDirectoryHierarchy(
  48. LPWSTR pwzRootPath,
  49. LPWSTR pwzPath);
  50. static HRESULT GetCacheRootDir(CString &sCacheDir, CacheFlags eFlags);
  51. private:
  52. DWORD _dwSig;
  53. DWORD _cRef;
  54. DWORD _hr;
  55. CString _sRootDir;
  56. CString _sManifestFileDir;
  57. CString _sManifestFilePath;
  58. CString _sDisplayName;
  59. LPASSEMBLY_MANIFEST_IMPORT _pManifestImport;
  60. HRESULT Init(CAssemblyCache* pAssemblyCache);
  61. // status get/set methods
  62. BOOL IsStatus(LPWSTR pwzDisplayName, CacheStatus eStatus);
  63. HRESULT SetStatus(LPWSTR pwzDisplayName, CacheStatus eStatus);
  64. friend HRESULT CreateAssemblyCacheImport(
  65. LPASSEMBLY_CACHE_IMPORT *ppAssemblyCacheImport,
  66. LPASSEMBLY_IDENTITY pAssemblyIdentity,
  67. DWORD dwFlags);
  68. friend HRESULT CreateAssemblyCacheEmit(
  69. LPASSEMBLY_CACHE_EMIT *ppAssemblyCacheEmit,
  70. LPASSEMBLY_CACHE_EMIT pAssemblyCacheEmit,
  71. DWORD dwFlags);
  72. friend HRESULT SearchForHighestVersionInCache(
  73. LPWSTR *ppwzResultDisplayName,
  74. LPWSTR pwzSearchDisplayName,
  75. CAssemblyCache::CacheStatus eCacheStatus,
  76. CAssemblyCache* pCache);
  77. };