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.

157 lines
4.0 KiB

  1. /*++
  2. Copyright (c) 1993-1995, Microsoft Corp. All rights reserved.
  3. Module Name:
  4. nw\svcdlls\ncpsvc\proc\nwprint.h
  5. Abstract:
  6. Include file for the NCP print processor.
  7. Author:
  8. Tommy Evans (vtommye) 02-16-1993
  9. Revision History:
  10. --*/
  11. /** Data types we support **/
  12. #define PRINTPROCESSOR_TYPE_RAW 0
  13. #define PRINTPROCESSOR_TYPE_RAW_FF 1
  14. #define PRINTPROCESSOR_TYPE_RAW_FF_AUTO 2
  15. #define PRINTPROCESSOR_TYPE_JOURNAL 3
  16. #define PRINTPROCESSOR_TYPE_TEXT 4
  17. #define PRINTPROCESSOR_TYPE_NT_TEXT 5
  18. #define PRINTPROCESSOR_TYPE_NUM 6 /* What is this? */
  19. /** This is so we can compile JOURNAL.C **/
  20. extern BOOL GdiPlayJournal(HDC, LPWSTR, DWORD, DWORD, INT);
  21. extern HANDLE NCPXsPortHandle;
  22. #define IDS_PSERVER_PORT 400
  23. /** Structure used to track jobs **/
  24. typedef struct _PRINTPROCESSORDATA {
  25. DWORD signature;
  26. DWORD cb;
  27. struct _PRINTPROCESSORDATA *pNext;
  28. DWORD fsStatus;
  29. DWORD uDatatype;
  30. DWORD JobId;
  31. DWORD Copies; /* Number of copies to print */
  32. DWORD TabSize; /* Tab expansion size */
  33. ULONG QueueId; /* Object id of the queue */
  34. HANDLE semPaused; /* Semaphore for job pausing */
  35. HANDLE hPrinter;
  36. HANDLE hLPCPort;
  37. HDC hDC;
  38. LPWSTR pPortName; /* Text string for printer port */
  39. LPWSTR pPrinterName; /* Text string for printer name */
  40. LPWSTR pDocument;
  41. LPWSTR pOutputFile;
  42. LPWSTR pDatatype; /* Text string for datatype */
  43. LPWSTR pParameters; /* Parameters string for job */
  44. USHORT NcpJobNumber; /* NetWare job number for this job */
  45. BOOL PServerPortFlag; /* Flag if on a PServer port */
  46. BOOL PServerAttachedFlag; /* Flag if PServer attached to q */
  47. } PRINTPROCESSORDATA, *PPRINTPROCESSORDATA;
  48. #define PRINTPROCESSORDATA_SIGNATURE 0x5051 /* 'QP' is the signature value */
  49. /* Define flags for fsStatus field */
  50. #define PRINTPROCESSOR_ABORTED 0x0001
  51. #define PRINTPROCESSOR_PAUSED 0x0002
  52. #define PRINTPROCESSOR_CLOSED 0x0004
  53. #define PRINTPROCESSOR_RESERVED 0xFFF8
  54. /** Flags used for the GetKey routing **/
  55. #define VALUE_STRING 0x01
  56. #define VALUE_ULONG 0x02
  57. /** Buffer sizes we'll use **/
  58. #define READ_BUFFER_SIZE 4096
  59. #define BASE_PRINTER_BUFFER_SIZE 2048
  60. PPRINTPROCESSORDATA
  61. ValidateHandle(
  62. HANDLE hPrintProcessor
  63. );
  64. /**
  65. Debugging stuff.
  66. **/
  67. #define DBG_NONE 0x00000000
  68. #define DBG_INFO 0x00000001
  69. #define DBG_WARNING 0x00000002
  70. #define DBG_ERROR 0x00000004
  71. #define DBG_TRACE 0x00000008
  72. #if DBG
  73. /* Quick fix:
  74. *
  75. * Ensure DbgPrint and DbgBreakPoint are prototyped,
  76. * so that we're not affected by STDCALL.
  77. * This should be replaced by OutputDebugString
  78. */
  79. ULONG
  80. DbgPrint(
  81. PCH Format,
  82. ...
  83. );
  84. VOID
  85. DbgBreakPoint(
  86. VOID
  87. );
  88. #define GLOBAL_DEBUG_FLAGS Debug
  89. extern DWORD GLOBAL_DEBUG_FLAGS;
  90. /* These flags are not used as arguments to the DBGMSG macro.
  91. * You have to set the high word of the global variable to cause it to break.
  92. * It is ignored if used with DBGMSG.
  93. * (Here mainly for explanatory purposes.)
  94. */
  95. #define DBG_BREAK_ON_WARNING ( DBG_WARNING << 16 )
  96. #define DBG_BREAK_ON_ERROR ( DBG_ERROR << 16 )
  97. /* Double braces are needed for this one, e.g.:
  98. *
  99. * DBGMSG( DBG_ERROR, ( "Error code %d", Error ) );
  100. *
  101. * This is because we can't use variable parameter lists in macros.
  102. * The statement gets pre-processed to a semi-colon in non-debug mode.
  103. *
  104. * Set the global variable GLOBAL_DEBUG_FLAGS via the debugger.
  105. * Setting the flag in the low word causes that level to be printed;
  106. * setting the high word causes a break into the debugger.
  107. * E.g. setting it to 0x00040006 will print out all warning and error
  108. * messages, and break on errors.
  109. */
  110. #define DBGMSG( Level, MsgAndArgs ) \
  111. { \
  112. if( ( Level & 0xFFFF ) & GLOBAL_DEBUG_FLAGS ) \
  113. DbgPrint MsgAndArgs; \
  114. if( ( Level << 16 ) & GLOBAL_DEBUG_FLAGS ) \
  115. DbgBreakPoint(); \
  116. }
  117. #else
  118. #define DBGMSG
  119. #endif