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.

181 lines
3.9 KiB

  1. /*****************************************************************************\
  2. * MODULE: splpjm.h
  3. *
  4. * Header file for the job-mapping list.
  5. *
  6. *
  7. * Copyright (C) 1996-1997 Microsoft Corporation
  8. * Copyright (C) 1996-1997 Hewlett Packard
  9. *
  10. * History:
  11. * 13-Jan-1997 HWP-Guys Created.
  12. *
  13. \*****************************************************************************/
  14. #ifndef _SPLPJM_H
  15. #define _SPLPJM_H
  16. // Constants.
  17. //
  18. #define PJM_LOCALID 0 // pjmFind().
  19. #define PJM_REMOTEID 1 // pjmFind().
  20. #define PJM_SPOOLING 0x00000001
  21. #define PJM_CANCEL 0x00000002
  22. #define PJM_PAUSE 0x00000004
  23. #define PJM_NOOPEN 0x00000008
  24. #define PJM_ASYNCON 0x00000010
  25. class CFileStream;
  26. typedef class CInetMonPort* PCINETMONPORT;
  27. // JobMap Structure. This is used to track local/remote job-ids during
  28. // the life of a print-job. This is necessary with our IPP printing model
  29. // since we would otherwise lose the remote job Id at enddoc time.
  30. //
  31. typedef struct _JOBMAP {
  32. struct _JOBMAP FAR *pNext;
  33. PCINETMONPORT pIniPort;
  34. DWORD dwState;
  35. DWORD idJobLocal;
  36. DWORD idJobRemote;
  37. LPTSTR lpszUri;
  38. LPTSTR lpszUser;
  39. LPTSTR lpszDocName;
  40. DWORD dwLocalJobSize;
  41. SYSTEMTIME SubmitTime;
  42. DWORD dwStatus;
  43. HANDLE hSplFile;
  44. BOOL bRemoteJob;
  45. } JOBMAP;
  46. typedef JOBMAP *PJOBMAP;
  47. typedef JOBMAP *NPJOBMAP;
  48. typedef JOBMAP *LPJOBMAP;
  49. typedef struct _PPJOB_ENUM {
  50. DWORD cItems;
  51. DWORD cbSize;
  52. IPPJI2 ji2[1];
  53. } PPJOB_ENUM;
  54. typedef PPJOB_ENUM *PPPJOB_ENUM;
  55. typedef PPJOB_ENUM *NPPPJOB_ENUM;
  56. typedef PPJOB_ENUM *LPPPJOB_ENUM;
  57. // JobMap Routines.
  58. //
  59. PJOBMAP pjmAdd(
  60. PJOBMAP* pjmList,
  61. PCINETMONPORT pIniPort,
  62. LPCTSTR lpszUser,
  63. LPCTSTR lpszDocName);
  64. VOID pjmCleanRemoteFlag(
  65. PJOBMAP* pjmList);
  66. PJOBMAP pjmFind(
  67. PJOBMAP* pjmList,
  68. DWORD fType,
  69. DWORD idJob);
  70. DWORD pjmGetLocalJobCount(
  71. PJOBMAP* pjmList,
  72. DWORD* pcbItems);
  73. PJOBMAP pjmNextLocalJob(
  74. PJOBMAP* pjmList,
  75. PJOB_INFO_2 pJobInfo2,
  76. PBOOL pbFound);
  77. VOID pjmDel(
  78. PJOBMAP *pjmList,
  79. PJOBMAP pjm);
  80. VOID pjmDelList(
  81. PJOBMAP pjmList);
  82. CFileStream* pjmSplLock(
  83. PJOBMAP pjm);
  84. BOOL pjmSplUnlock(
  85. PJOBMAP pjm);
  86. BOOL pjmSplWrite(
  87. PJOBMAP pjm,
  88. LPVOID lpMem,
  89. DWORD cbMem,
  90. LPDWORD lpcbWr);
  91. BOOL pjmSetState(
  92. PJOBMAP pjm,
  93. DWORD dwState);
  94. VOID pjmClrState(
  95. PJOBMAP pjm,
  96. DWORD dwState);
  97. VOID pjmSetJobRemote(
  98. PJOBMAP pjm,
  99. DWORD idJobRemote,
  100. LPCTSTR lpszUri);
  101. VOID pjmAddJobSize(
  102. PJOBMAP pjm,
  103. DWORD dwSize);
  104. VOID pjmRemoveOldEntries(
  105. PJOBMAP *pjmList);
  106. VOID pjmUpdateLocalJobStatus(
  107. PJOBMAP pjm,
  108. DWORD dwStatus);
  109. /*****************************************************************************\
  110. * pjmJobId
  111. *
  112. \*****************************************************************************/
  113. _inline DWORD pjmJobId(
  114. PJOBMAP pjm,
  115. DWORD fType)
  116. {
  117. return (pjm ? ((fType == PJM_REMOTEID) ? pjm->idJobRemote : pjm->idJobLocal) : 0);
  118. }
  119. /*****************************************************************************\
  120. * pjmSplFile
  121. *
  122. \*****************************************************************************/
  123. _inline LPCTSTR pjmSplFile(
  124. PJOBMAP pjm)
  125. {
  126. return (pjm ? SplFileName(pjm->hSplFile) : NULL);
  127. }
  128. /*****************************************************************************\
  129. * pjmSplUser
  130. *
  131. \*****************************************************************************/
  132. _inline LPCTSTR pjmSplUser(
  133. PJOBMAP pjm)
  134. {
  135. return (pjm ? pjm->lpszUser : NULL);
  136. }
  137. /*****************************************************************************\
  138. * pjmChkState
  139. *
  140. \*****************************************************************************/
  141. _inline BOOL pjmChkState(
  142. PJOBMAP pjm,
  143. DWORD dwState)
  144. {
  145. return (pjm ? (pjm->dwState & dwState) : FALSE);
  146. }
  147. #endif