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.

98 lines
2.8 KiB

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