Leaked source code of windows server 2003
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.

96 lines
3.0 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // File: pmanager.h
  4. // Copyright (C) 1994-1997 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // Owner: MHotchin
  8. //
  9. //-----------------------------------------------------------------------------
  10. #ifndef PMANAGER_H
  11. #define PMANAGER_H
  12. #pragma warning(disable : 4251)
  13. typedef CTypedPtrMap<CMapWordToPtr, ParserId, CLocParserInfo *> CLocParserMap;
  14. typedef CTypedPtrMap<CMapStringToPtr, CString, CLocParserList *> CLocExtMap;
  15. typedef CTypedPtrList<CPtrList, EnumInfo *> FileDescriptionList;
  16. interface ILocFile;
  17. struct ParserInfo;
  18. class CParserUnloader;
  19. class LTAPIENTRY CLocParserManager : public CLObject
  20. {
  21. friend CLocParserInfo;
  22. public:
  23. CLocParserManager();
  24. void AssertValid(void) const;
  25. BOOL InitParserManager(IUnknown *);
  26. static BOOL ReloadRegistry(void);
  27. static void UnloadParsers(void);
  28. static void UnloadUnusedParsers(void);
  29. static void GetManagerVersion(DWORD &dwMajor, DWORD &dwMinor, BOOL &fDebug);
  30. static BOOL AddParserToSystem(const CLString &);
  31. static const CLocParserInfo *GetParserInfo(ParserId pid, ParserId pidParent);
  32. static BOOL RemoveParserFromSystem(ParserId pid, ParserId pidParent);
  33. static UINT FindParsers(void);
  34. static BOOL GetLocParser(ParserId, ILocParser *&);
  35. static BOOL GetLocFile(const CFileSpec &, ParserId, FileType,
  36. ILocFile *&, CReporter &);
  37. static BOOL FindLocFile(const CPascalString &, CLocParserIdArray &);
  38. static BOOL GetStringValidation(ParserId, ILocStringValidation *&);
  39. static const CLocParserList &GetParserList(void);
  40. static void GetParserFilterString(CLString &);
  41. ~CLocParserManager();
  42. protected:
  43. static void RemoveCurrentInfo(void);
  44. static BOOL LoadParserInfo(const HKEY &, CLocParserInfo *&);
  45. static BOOL LoadMasterParserInfo(const HKEY &);
  46. static BOOL LoadSubParsers(const HKEY &, CLocParserInfo *);
  47. static BOOL WriteFileTypes(const HKEY &, const FileDescriptionList &);
  48. static BOOL OpenParserSubKey(HKEY &, ParserId, ParserId);
  49. static BOOL AddParserToRegistry(const CLString &, const ParserInfo &,
  50. const FileDescriptionList &);
  51. static void AddToFilter(const CLocParserInfo *, const CLocExtensionList &);
  52. private:
  53. static LONG m_lRefCount; //
  54. static CLocParserMap m_ParserMap; // Associative map, ID -> Parser.
  55. static CLocParserList m_ParserList; // List of open parser DLL's.
  56. static CLocParserList m_SubParserList;// list of all sub-parsers.
  57. static CLocExtMap m_ExtensionMap; // Associative map, extension->parser.
  58. static CLString m_strFilter; // Filter list for parser files.
  59. static IUnknown * m_pUnknown;
  60. static CParserUnloader m_Unloader;
  61. };
  62. //
  63. // Undecorated versions of these functions for GetProcAddress users...
  64. //
  65. extern "C"
  66. {
  67. LTAPIENTRY HRESULT AddParserToSystem(const TCHAR *strFileName);
  68. LTAPIENTRY HRESULT RemoveParserFromSystem(ParserId pid, ParserId pidParent);
  69. }
  70. #pragma warning(default : 4251)
  71. #endif // PMANAGER_H