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.

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