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.

172 lines
4.3 KiB

  1. /*++
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. --*/
  4. #ifndef _PDEV_H
  5. #define _PDEV_H
  6. #include <minidrv.h>
  7. #ifdef USERMODE_DRIVER
  8. #ifdef DbgBreakPoint
  9. #undef DbgBreakPoint
  10. extern VOID DbgBreakPoint(VOID);
  11. #endif // DbgBreakPoint
  12. #endif // USERMODE_DRIVER
  13. #include <printoem.h>
  14. #include <prntfont.h>
  15. #include <winsplp.h> // #94193: shold create temp. file on spooler directory.
  16. #define VALID_PDEVOBJ(pdevobj) \
  17. ((pdevobj) && (pdevobj)->dwSize >= sizeof(DEVOBJ) && \
  18. (pdevobj)->hEngine && (pdevobj)->hPrinter && \
  19. (pdevobj)->pPublicDM && (pdevobj)->pDrvProcs )
  20. #define ASSERT_VALID_PDEVOBJ(pdevobj) ASSERT(VALID_PDEVOBJ(pdevobj))
  21. // Debug text.
  22. #define ERRORTEXT(s) "ERROR " DLLTEXT(s)
  23. // OEM Signature and version.
  24. #define OEM_SIGNATURE 'IBMW'
  25. #define DLLTEXT(s) "IB87WRES: " s
  26. #define OEM_VERSION 0x00010000L
  27. /************* Value **************/
  28. #define PAPER_SRC_FTRAY 20
  29. #define PAPER_SRC_CAS1 21
  30. #define PAPER_SRC_CAS2 22
  31. #define PAPER_SRC_CAS3 23
  32. #define PAPER_SRC_AUTO 24
  33. #define ORIENTATION_PORTRAIT 28
  34. #define ORIENTATION_LANDSCAPE 29
  35. #define PAGECONTROL_BEGIN_DOC 30
  36. #define PAGECONTROL_BEGIN_PAGE 31
  37. #define PAGECONTROL_END_DOC 32
  38. #define PAGECONTROL_END_PAGE 33
  39. #define PAGECONTROL_DUPLEX_OFF 34
  40. #define PAGECONTROL_ABORT_DOC 35
  41. #define PAGECONTROL_POTRAIT 36
  42. #define PAGECONTROL_LANDSCAPE 37
  43. #define PAGECONTROL_MULTI_COPIES 38
  44. #define PHYS_PAPER_BASE 50
  45. #define PHYS_PAPER_A3 50
  46. #define PHYS_PAPER_A4 51
  47. #define PHYS_PAPER_A5 52
  48. #define PHYS_PAPER_B4 53
  49. #define PHYS_PAPER_B5 54
  50. #define PHYS_PAPER_POSTCARD 55
  51. #define PHYS_PAPER_LETTER 56
  52. #define PHYS_PAPER_LEGAL 57
  53. #define PHYS_PAPER_UNFIXED 58
  54. #define PHYS_PAPER_MAX 58
  55. #define Y_REL_MOVE 71
  56. #define RESOLUTION_300 76
  57. #define RESOLUTION_600 77
  58. #define SEND_BLOCK_DATA 82
  59. #define TONER_SAVE_MEDIUM 100
  60. #define TONER_SAVE_DARK 101
  61. #define TONER_SAVE_LIGHT 102
  62. #define MAXIMGSIZE 0xF000
  63. #define NRPEAK 0x7F
  64. #define RPEAK 0x80
  65. #define MASTERUNIT 1200
  66. #define MAXLINESIZE 11817
  67. #define TEMP_NAME_PREFIX __TEXT("~IB")
  68. #define TRANS_BAND_Y_SIZE 1024
  69. #define SPOOL_OUT_BUF_SIZE 1024
  70. /************* Structure **************/
  71. typedef struct tag_PAGEDATA{
  72. SHORT sPageNum ;
  73. HANDLE hPageFile ;
  74. TCHAR TempName[MAX_PATH];
  75. DWORD dwPageLen ; //Page length of one page in byte.
  76. DWORD dwFilePos ; //Start Position for reading file.
  77. LPVOID pPrePage ;
  78. LPVOID pNextPage ;
  79. }PAGEDATA, *LPPD ;
  80. typedef struct SPLBUF {
  81. DWORD dwWrite ;
  82. DWORD dwPageLen ;
  83. HANDLE hFile ;
  84. TCHAR TempName[MAX_PATH];
  85. }SPLBUF, *LPSB ;
  86. // Status paramters for SpoolOutComp routine.
  87. typedef struct {
  88. INT iNRCnt;
  89. INT iRCnt;
  90. BYTE iPrv;
  91. BYTE pjNRBuf[NRPEAK];
  92. } SOCOMP, *PSOCOMP;
  93. typedef struct tag_IBMPDEV {
  94. ULONG ulHorzRes;
  95. ULONG ulVertRes;
  96. SIZEL szlPhysSize;
  97. POINTL ptlLogSize;
  98. POINTL ptlPhysOffset;
  99. WORD wImgWidth;
  100. WORD wImgHeight;
  101. BYTE byPaperSize ;
  102. SHORT sPageNum;
  103. SHORT sCopyNum;
  104. DWORD dwYmove ;
  105. DWORD dwCurCursorY ;
  106. DWORD dwOffset ;
  107. DWORD wCompLen ;
  108. SHORT sPaperSize ;
  109. BOOL fComp ;
  110. BOOL fChangeDirection ;
  111. SPLBUF sb ; //to count bytes
  112. SPLBUF sbcomp ; //to change direstions
  113. PBYTE pTempImage ;
  114. DWORD dwTempBufLen ;
  115. LPPD lpFstData ;
  116. LPPD lpCurData ;
  117. BOOL fDocCmd ;
  118. #define CMD_SETPAC_SIZE 31
  119. BYTE SetPac[CMD_SETPAC_SIZE]; // DefineSession + SETPAC
  120. SOCOMP Soc;
  121. } IBMPDEV, *PIBMPDEV;
  122. /************* Macro **************/
  123. // #94193: shold create temp. file on spooler directory.
  124. #define WRITESPOOLBUF(p, s, n) \
  125. (((p)->pDrvProcs->DrvWriteSpoolBuf(p, s, n)) == (n))
  126. #define PARAM(p,n) \
  127. (NULL == (p) ? 0 : *((p)+(n)))
  128. #define ABS(n) \
  129. ((n) > 0 ? (n) : -(n))
  130. #endif //_PDEV_H