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.

60 lines
2.4 KiB

  1. /******************************************************************************
  2. Header File: Code Page Knowledge Base.H
  3. This encapsulates a C++ class that will provide
  4. all of the basic information needed to manage and translate code pages for the
  5. Minidriver Development Tool.
  6. Copyright (c) 1997 by Microsoft Corporation
  7. ******************************************************************************/
  8. #ifndef RICKS_FIND
  9. #define RICKS_FIND
  10. class CCodePageInformation {
  11. DWORD m_dwidMapped, m_dwidIn, m_dwidOut; // CP cached in each array
  12. CByteArray m_cbaMap; // Raw Map
  13. CWordArray m_cwaIn, m_cwaOut; // Full MB2Uni and Uni2MB maps
  14. BOOL Load(DWORD dwidMap); // Load the support page
  15. BOOL Map(BOOL bUnicode); // Map the requested direction
  16. BOOL GenerateMap(DWORD dwidMap) const; // Create resource for RC file
  17. // based on this code page
  18. public:
  19. CCodePageInformation();
  20. // Attributes
  21. const unsigned InstalledCount() const; // Code pages in )S
  22. const unsigned MappedCount() const; // Code pages in RC file
  23. const unsigned SupportedCount() const; // Code pages supported by OS
  24. const DWORD Installed(unsigned u) const; // Retrieve one
  25. const DWORD Mapped(unsigned u) const; // Retrieve one
  26. void Mapped(CDWordArray& cdwaReturn) const; // The IDs
  27. const DWORD Supported(unsigned u) const; // Retrieve one
  28. CString Name(DWORD dw) const; // Name of the code page
  29. // cf RC file
  30. BOOL IsInstalled(DWORD dwPage) const;
  31. BOOL HaveMap(DWORD dwPage) const;
  32. // DBCS query- is page DBCS? if so is this code point DBCS?
  33. BOOL IsDBCS(DWORD dwidPage);
  34. BOOL IsDBCS(DWORD dwidPage, WORD wCodePoint);
  35. // Operations
  36. unsigned Convert(CByteArray& cbaMBCS, CWordArray& cbaWC,
  37. DWORD dwidPage);
  38. BOOL GenerateAllMaps() const; // Gen resources for any
  39. // installed & unsupported
  40. BOOL Collect(DWORD dwidMap, CWordArray& cwaWhere,
  41. BOOL bUnicode = TRUE);
  42. };
  43. #endif