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.

103 lines
3.8 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // File: Win32RT.H
  4. // Copyright (C) 1994-1997 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. //
  8. // Declare helper runtime functions for Win32 parsers and sub parsers
  9. //-----------------------------------------------------------------------------
  10. #ifndef __WIN32RT_H
  11. #define __WIN32RT_H
  12. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  13. // Put a name or ord in a buffer. Caller is responsible for
  14. // the having enough memory in the buffer.
  15. // The pointer is updated on return.
  16. //-----------------------------------------------------------------------------
  17. void
  18. W32PutNameOrd(
  19. const CLocId &locId, // Name or id to write
  20. BYTE * &pbCur); // Buffer pointer updated on return
  21. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  22. // Create a Res32 header.
  23. // The caller is responsible for calling delete on the returned
  24. // memory.
  25. //-----------------------------------------------------------------------------
  26. BYTE*
  27. W32MakeRes32Header(
  28. const CLocTypeId& typeId, //typeid for header
  29. const CLocResId& resId, //resID for header
  30. LangId nLangId, //Lang for header
  31. DWORD dwCharacteristics); //Characteristics member.
  32. //Has special values for
  33. //Espresso.
  34. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  35. // Pad a buffer to a DWORD boundary
  36. //-----------------------------------------------------------------------------
  37. void
  38. W32PadDW(
  39. const BYTE *pbBase, //Base Address
  40. BYTE * &pbCur); //Current pointer - will be updated
  41. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  42. // Flips the bytes in a unicode_null terminated unicode stirng
  43. // The string is modified in place.
  44. //-----------------------------------------------------------------------------
  45. void
  46. W32UnicodeFlip(
  47. WCHAR* pbBuffer); //Address of unicode string.
  48. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  49. // Flips the bytes in a unicode stirng
  50. // The string is modified in place.
  51. //-----------------------------------------------------------------------------
  52. void
  53. W32UnicodeFlip(
  54. WCHAR* pbBuffer, //Address of unicode string.
  55. UINT nCntChar); //Count of unicode characters
  56. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  57. // Examines a CPascalString for embedded NULLS; issues a message. Debug
  58. // version can be made to issue messages for ALL strings.
  59. //-----------------------------------------------------------------------------
  60. BOOL
  61. W32FoundNullInPasString(
  62. MessageSeverity severity, // Severity of the message
  63. C32File *p32File, // file
  64. HINSTANCE hInstance, // DLL handle
  65. UINT uiMaskMsgId, // msg mask with 3 %s sequences, viz:
  66. // "Unexpected NULL found in %s %s, ResId %s."
  67. UINT uiTypeMsgId, // msg naming res type, e.g., "Menu"
  68. UINT uiHelpId,
  69. const CLocResId &locResId, // res name
  70. const CLocUniqueId &locItemUniqueId, // item id
  71. const CPascalString &pas); // item string
  72. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  73. // Calls FoundNullInPasString() for every string in a CLocItemPtrArray.
  74. //-----------------------------------------------------------------------------
  75. BOOL
  76. W32FoundNullInLocItemPtrArrayPasString(
  77. MessageSeverity severity, // Severity of the message
  78. C32File *p32File, // file
  79. HINSTANCE hInstance, // DLL handle
  80. UINT uiMaskMsgId, // msg mask with 3 %s sequences, viz:
  81. // "Unexpected NULL found in %s %s, ResId %s."
  82. UINT uiTypeMsgId, // msg naming res type, e.g., "Menu"
  83. UINT uiHelpId,
  84. CLocItem *pLocItem, // res name
  85. CLocItemPtrArray &rgLocItem); // item strings
  86. #endif //__WIN32RT_H