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.

84 lines
1.7 KiB

  1. // DlgResFile.h: Dialog resource memory file.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(DLGRESFILE_H)
  5. #define DLGRESFILE_H
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. // Structure of a res file header. The header consists
  10. // of two fixed sized parts with a variable sized middle
  11. // The middle structure appears twice the first is the
  12. // type ID and the second one is the Res ID
  13. #include <pshpack1.h>
  14. typedef struct
  15. {
  16. DWORD dwDataSize;
  17. DWORD dwHeaderSize;
  18. } DRF_RESHEAD1;
  19. typedef struct
  20. {
  21. DWORD dwDataVersion;
  22. WORD wFlags;
  23. WORD wLang;
  24. DWORD dwResVersion;
  25. DWORD dwCharacteristics;
  26. } DRF_RESHEAD3;
  27. #include <poppack.h>
  28. //-----------------------------------------------------------------------------
  29. //
  30. // Format of a Name or Ordinal Field
  31. //
  32. //-----------------------------------------------------------------------------
  33. typedef union
  34. {
  35. WCHAR wzId[1];
  36. struct
  37. {
  38. WORD wFlag;
  39. WORD wId;
  40. };
  41. } DRF_NAMEORD;
  42. class LTAPIENTRY CDlgResFile : public CLFile
  43. {
  44. public:
  45. CDlgResFile(CFile* pFile);
  46. ~CDlgResFile();
  47. virtual BOOL OpenSource(const CFileSpec &fsSourceFile,
  48. CFileException *pExcept);
  49. virtual BOOL GetNextResource();
  50. //Helper functions
  51. virtual DWORD WriteNameOrd(const CLocId &locId);
  52. virtual UINT WriteString(const CPascalString &pstrString);
  53. void AssertValid(void) const;
  54. protected:
  55. BOOL ReadHeader(DWORD &dwNextPos, DWORD &dwDataSize, CLocId &lidType,
  56. CLocId &lidRes, LangId &langId, DWORD &dwChar, void * &pv);
  57. private:
  58. DWORD m_dwHeaderPos;
  59. DWORD m_dwFileSize;
  60. DWORD m_dwNextPos;
  61. };
  62. void GetNameOrd(BYTE * &pbBuffer, CLocId *plocId);
  63. void GetString(BYTE * &pbbuffer, CPascalString & pasStr);
  64. #endif // !defined(DLGRESFILE_H)