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.

163 lines
4.6 KiB

  1. /*++
  2. Copyright (c) 1990-1995 Microsoft Corporation
  3. Module Name:
  4. resource.h
  5. Abstract:
  6. This module contains definitions for the resources
  7. Author:
  8. 29-Aug-1995 Tue 12:41:52 created -by- Daniel Chou (danielc)
  9. [Environment:]
  10. NT Windows - Common Printer Driver UI DLL.
  11. [Notes:]
  12. Revision History:
  13. --*/
  14. #define GBF_PREFIX_OK 0x0001
  15. #define GBF_INT_NO_PREFIX 0x0002
  16. #define GBF_ANSI_CALL 0x0004
  17. #define GBF_COPYWSTR 0x0008
  18. #define GBF_IDS_INT_CPSUI 0x0010
  19. #define GBF_DUP_PREFIX 0x0020
  20. typedef struct _GSBUF {
  21. HINSTANCE hInst;
  22. LPWSTR pBuf; // Pointer to the begining of the buffer
  23. LPWSTR pEndBuf; // pointer to the end of the buffer
  24. WORD Flags; // GBF_xxxx flags
  25. WCHAR chPreAdd; // the character add before string
  26. } GSBUF, *PGSBUF;
  27. #define GSBUF_BUF GSTextBuf
  28. #define GSBUF_PBUF GSBuf.pBuf
  29. #define GSBUF_FLAGS GSBuf.Flags
  30. #define GSBUF_COUNT (UINT)(GSBUF_PBUF - GSBUF_BUF)
  31. #define GSBUF_RESET GSBUF_PBUF=(LPWSTR)GSBUF_BUF
  32. #define GSBUF_INIT(p,b,c) GSBuf.hInst=_OI_HINST(p); \
  33. GSBuf.chPreAdd = L'\0';GSBuf.Flags= \
  34. (_OI_EXTFLAGS(p) & OIEXTF_ANSI_STRING) ? \
  35. GBF_ANSI_CALL : 0;GSBUF_PBUF=(LPWSTR)(b); \
  36. GSBuf.pEndBuf=(LPWSTR)(b)+(c)
  37. #define GSBUF_DEF(p,c) GSBUF GSBuf;WCHAR GSTextBuf[c]; \
  38. GSBUF_INIT((p),GSTextBuf,(c))
  39. #define GSBUF_CHPREADD(c) GSBuf.chPreAdd=L##c
  40. #define GSBUF_GETSTR(p) GetString(&GSBuf,(LPTSTR)((ULONG_PTR)(p)))
  41. #define GSBUF_GETINTSTR(p) GSBUF_FLAGS |= GBF_IDS_INT_CPSUI; \
  42. GSBUF_GETSTR(p); \
  43. GSBUF_FLAGS &= ~GBF_IDS_INT_CPSUI
  44. #define GSBUF_COPYWSTR(p) GSBuf.Flags|=GBF_COPYWSTR;GSBUF_GETSTR(p); \
  45. GSBuf.Flags&=~GBF_COPYWSTR
  46. #define GSBUF_CHGETSTR(c,p) GSBUF_CHPREADD(c);GetString(&GSBuf,(LPTSTR)(p))
  47. #define GSBUF_SUB_SIZE(c) *(GSBUF_PBUF-=(c))=(WCHAR)0
  48. #define GSBUF_ADDC(i, c) GSBufAddWChar(&GSBuf, i, c)
  49. #define GSBUF_ADD_SPACE(c) GSBufAddSpace(&GSBuf, c)
  50. #define GSBUF_ADDNUM(n,s) GSBufAddNumber(&GSBuf,n,s)
  51. #define GSBUF_COMPOSE(i,p,a,b) GSBUF_PBUF += ComposeStrData(GSBuf.hInst, \
  52. GSBUF_FLAGS, GSBUF_PBUF, \
  53. (UINT)(GSBuf.pEndBuf - GSBUF_PBUF), \
  54. (UINT)i, p, LODWORD(a), LODWORD(b))
  55. #define GETICON_SIZE(hInst, IconID, cx, cy) \
  56. ((IconID) ? LoadImage((((IconID) >= IDI_CPSUI_ICONID_FIRST) && \
  57. ((IconID) <= IDI_CPSUI_ICONID_LAST)) ? \
  58. hInstDLL : hInst, \
  59. MAKEINTRESOURCE(IconID), \
  60. IMAGE_ICON, cx, cy, 0) : NULL)
  61. #define GETICON16(hInst, IconID) GETICON_SIZE(hInst, IconID, 16, 16)
  62. #define GETICON32(hInst, IconID) GETICON_SIZE(hInst, IconID, 32, 32)
  63. #define GETICON(hInst, IconID) \
  64. ((IconID) ? LoadIcon((((IconID) >= IDI_CPSUI_ICONID_FIRST) && \
  65. ((IconID) <= IDI_CPSUI_ICONID_LAST)) ? \
  66. hInstDLL : hInst, \
  67. MAKEINTRESOURCE(IconID)) : NULL)
  68. UINT
  69. RemoveAmpersandA(
  70. LPSTR pStr
  71. );
  72. UINT
  73. RemoveAmpersandW(
  74. LPWSTR pwStr
  75. );
  76. UINT
  77. GetStringBuffer(
  78. HINSTANCE hInst,
  79. WORD GBFlags,
  80. WCHAR chPreAdd,
  81. LPTSTR pStr,
  82. LPWSTR pBuf,
  83. UINT cwBuf
  84. );
  85. UINT
  86. GSBufAddWChar(
  87. PGSBUF pGSBuf,
  88. UINT IntCharStrID,
  89. UINT Count
  90. );
  91. UINT
  92. GSBufAddSpace(
  93. PGSBUF pGSBuf,
  94. UINT Count
  95. );
  96. UINT
  97. GSBufAddNumber(
  98. PGSBUF pGSBuf,
  99. DWORD Number,
  100. BOOL Sign
  101. );
  102. UINT
  103. GetString(
  104. PGSBUF pGSBuf,
  105. LPTSTR pStr
  106. );
  107. LONG
  108. LoadCPSUIString(
  109. LPTSTR pStr,
  110. UINT cStr,
  111. UINT StrResID,
  112. BOOL AnsiCall
  113. );
  114. UINT
  115. ComposeStrData(
  116. HINSTANCE hInst,
  117. WORD GBFlags,
  118. LPWSTR pBuf,
  119. UINT cwBuf,
  120. UINT IntFormatStrID,
  121. LPTSTR pStr,
  122. DWORD dw1,
  123. DWORD dw2
  124. );