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.

175 lines
4.8 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1994 - 1999
  3. All rights reserved.
  4. Module Name:
  5. PrLibp.hxx
  6. Abstract:
  7. PrintLib private header
  8. Author:
  9. Albert Ting (AlbertT) 22-Jun-95
  10. Revision History:
  11. --*/
  12. #ifndef _PRTLIBP_HXX
  13. #define _PRTLIBP_HXX
  14. /********************************************************************
  15. Constants used by RC that must be #define rather than const vars.
  16. ********************************************************************/
  17. #define ARCH_ALPHA 0
  18. #define ARCH_X86 1
  19. #define ARCH_MIPS 2
  20. #define ARCH_PPC 3
  21. #define ARCH_WIN95 4
  22. #define ARCH_IA64 5
  23. #define ARCH_MAX 6
  24. #define VERSION_0 0
  25. #define VERSION_1 (VERSION_0 + ARCH_MAX)
  26. #define VERSION_2 (VERSION_1 + ARCH_MAX)
  27. #define VERSION_3 (VERSION_2 + ARCH_MAX)
  28. #define DRIVER_IA64_3 (ARCH_IA64 + VERSION_3)
  29. #define DRIVER_X86_3 (ARCH_X86 + VERSION_3)
  30. #define DRIVER_ALPHA_3 (ARCH_ALPHA + VERSION_3)
  31. #define DRIVER_X86_2 (ARCH_X86 + VERSION_2)
  32. #define DRIVER_MIPS_2 (ARCH_MIPS + VERSION_2)
  33. #define DRIVER_ALPHA_2 (ARCH_ALPHA + VERSION_2)
  34. #define DRIVER_PPC_2 (ARCH_PPC + VERSION_2)
  35. #define DRIVER_X86_1 (ARCH_X86 + VERSION_1)
  36. #define DRIVER_MIPS_1 (ARCH_MIPS + VERSION_1)
  37. #define DRIVER_ALPHA_1 (ARCH_ALPHA + VERSION_1)
  38. #define DRIVER_PPC_1 (ARCH_PPC + VERSION_1)
  39. #define DRIVER_X86_0 (ARCH_X86 + VERSION_0)
  40. #define DRIVER_MIPS_0 (ARCH_MIPS + VERSION_0)
  41. #define DRIVER_ALPHA_0 (ARCH_ALPHA + VERSION_0)
  42. #define DRIVER_WIN95 (ARCH_WIN95 + VERSION_0)
  43. #ifndef RC_INVOKED
  44. #define ORPHAN // Function is an OUT parameter that must be freed.
  45. #define ADOPT // Function accepts ownership of pointer.
  46. #define CHANGE // Function changes state of pointer.
  47. typedef UINT TABLE;
  48. typedef WORD FIELD, *PFIELD;
  49. typedef WORD TYPE, *PTYPE;
  50. typedef DWORD IDENT, *PIDENT; // Job or printer ID.
  51. typedef HANDLE HBLOCK; // Opaque packet holding many jobs.
  52. typedef UINT NATURAL_INDEX, *PNATURAL_INDEX; // Printing order.
  53. typedef UINT LIST_INDEX, *PLIST_INDEX; // Listview order.
  54. const NATURAL_INDEX kInvalidNaturalIndexValue = (NATURAL_INDEX)-1;
  55. typedef union {
  56. NATURAL_INDEX NaturalIndex;
  57. DWORD dwData;
  58. LPCTSTR pszData;
  59. PSYSTEMTIME pSystemTime;
  60. PVOID pvData;
  61. STATEVAR StateVar;
  62. } INFO, *PINFO;
  63. const INFO kInfoNull = { 0 };
  64. const IDENT kInvalidIdentValue = (IDENT)-1;
  65. const FIELD kInvalidFieldValue = (FIELD)-1;
  66. const COUNT kInvalidCountValue = (COUNT)-1;
  67. enum {
  68. #define DEFINE(field, x, y, table, offset) I_PRINTER_##field,
  69. #include <ntfyprn.h>
  70. #undef DEFINE
  71. I_PRINTER_END
  72. };
  73. enum {
  74. #define DEFINE( field, x, y, table, offset ) I_JOB_##field,
  75. #include <ntfyjob.h>
  76. #undef DEFINE
  77. I_JOB_END
  78. };
  79. const DWORD I_MAX = (I_PRINTER_END > I_JOB_END) ?
  80. (DWORD)I_PRINTER_END :
  81. (DWORD)I_JOB_END;
  82. /********************************************************************
  83. Constants
  84. ********************************************************************/
  85. const UINT WM_PRINTLIB_NEW = WM_APP;
  86. const UINT WM_PRINTLIB_STATUS = WM_APP+1;
  87. const UINT kDNSMax = INTERNET_MAX_HOST_NAME_LENGTH;
  88. const UINT kServerBufMax = kDNSMax + 2 + 1;
  89. //
  90. // The maximum local printer name length is.
  91. //
  92. const UINT kPrinterLocalNameMax = 220;
  93. //
  94. // Max printer name should really be MAX_PATH, but if you create
  95. // a max path printer and connect to it remotely, win32spl prepends
  96. // "\\server\" to it, causing it to exceed max path. The new UI
  97. // therefore makes the max path MAX_PATH-kServerLenMax, but we still
  98. // allow the old case to work.
  99. //
  100. const UINT kPrinterBufMax = MAX_PATH + kServerBufMax + 1;
  101. //
  102. // Printer default string for win.ini has the format:
  103. //
  104. // PRINTERNAME,winspool,PORT
  105. //
  106. // Allow port to be MAX_PATH.
  107. //
  108. const UINT kPrinterDefaultStringBufMax = kPrinterBufMax + MAX_PATH + 10;
  109. const UINT kMessageMax = 256;
  110. const UINT kTitleMax = 128;
  111. const INT kMaxInt = 0x7fffffff;
  112. const UINT WM_EXIT = WM_APP;
  113. const UINT WM_DESTROY_REQUEST = WM_APP+1;
  114. //
  115. // Max printer share name, This name length should really be defined in
  116. // a system wide header file and probably enforced by a network API.
  117. // Currently this code is definnning it as MAX_PATH for the buffer max
  118. // and MAX_PATH - 1 for the maximum name.
  119. //
  120. const UINT kPrinterShareNameBufMax = NNLEN+1;
  121. const UINT kPrinterShareNameMax = kPrinterShareNameBufMax - 1;
  122. const UINT kPrinterDosShareNameMax = 8+3+1;
  123. //
  124. // Max printer comment and location buffers size. A printer with a
  125. // comment string longer than 255 characters cannot be shared.
  126. //
  127. const UINT kPrinterCommentBufMax = 255;
  128. const UINT kPrinterLocationBufMax = 255;
  129. #endif // ndef RC_INVOKED
  130. #endif // ndef _PRTLIBP_HXX