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.

230 lines
5.0 KiB

  1. /*****************************************************************************\
  2. * MODULE: inetpp.h
  3. *
  4. * Header file for the INETPP provider routines.
  5. *
  6. *
  7. * Copyright (C) 2000 Microsoft Corporation
  8. *
  9. * History:
  10. * 13-Sep-2000 weihaic Created
  11. *
  12. \*****************************************************************************/
  13. #ifndef _INETPORT_H
  14. #define _INETPORT_H
  15. typedef class CInetMonPort* PCINETMONPORT;
  16. class GetPrinterCache;
  17. class EnumJobsCache;
  18. class CInetMonPort {
  19. public:
  20. CInetMonPort (
  21. LPCTSTR lpszPortName,
  22. LPCTSTR lpszDevDesc,
  23. PCPORTMGR pPortMgr);
  24. ~CInetMonPort ();
  25. inline BOOL
  26. bValid (VOID) CONST { return m_bValid; };
  27. VOID
  28. IncRef ();
  29. VOID
  30. DecRef ();
  31. VOID
  32. IncPrinterRef ();
  33. VOID
  34. DecPrinterRef ();
  35. BOOL
  36. SendReq(
  37. LPBYTE lpIpp,
  38. DWORD cbIpp,
  39. IPPRSPPROC pfnRsp,
  40. LPARAM lParam,
  41. BOOL bLeaveCrit);
  42. BOOL
  43. SendReq(
  44. CStream *pStream,
  45. IPPRSPPROC pfnRsp,
  46. LPARAM lParam,
  47. BOOL bLeaveCrit);
  48. BOOL
  49. ClosePort(
  50. HANDLE hPrinter);
  51. BOOL
  52. StartDocPort(
  53. DWORD dwLevel,
  54. LPBYTE pDocInfo,
  55. PJOBMAP pjmJob);
  56. BOOL
  57. EndDocPort(
  58. PJOBMAP pjmJob);
  59. BOOL
  60. WritePort(
  61. PJOBMAP pjmJob,
  62. LPBYTE lpData,
  63. DWORD cbData,
  64. LPDWORD pcbWr);
  65. BOOL
  66. AbortPort(
  67. PJOBMAP pjmJob);
  68. LPCTSTR
  69. GetPortName(
  70. VOID);
  71. PJOBMAP*
  72. GetPJMList(
  73. VOID);
  74. DWORD
  75. IncUserRefCount(
  76. PCLOGON_USERDATA hUser );
  77. VOID
  78. FreeGetPrinterCache (
  79. VOID);
  80. BOOL
  81. BeginReadGetPrinterCache (
  82. PPRINTER_INFO_2 *ppInfo2);
  83. VOID
  84. EndReadGetPrinterCache (
  85. VOID);
  86. VOID
  87. InvalidateGetPrinterCache (
  88. VOID);
  89. VOID
  90. FreeEnumJobsCache (
  91. VOID);
  92. BOOL
  93. BeginReadEnumJobsCache (
  94. LPPPJOB_ENUM *ppje);
  95. VOID
  96. EndReadEnumJobsCache (
  97. VOID);
  98. VOID
  99. InvalidateEnumJobsCache (
  100. VOID);
  101. BOOL
  102. ReadFile (
  103. CAnyConnection *pConnection,
  104. HINTERNET hReq,
  105. LPVOID lpvBuffer,
  106. DWORD cbBuffer,
  107. LPDWORD lpcbRd);
  108. BOOL
  109. GetCurrentConfiguration (
  110. PINET_XCV_CONFIGURATION pXcvConfiguration);
  111. BOOL
  112. ConfigurePort (
  113. PINET_XCV_CONFIGURATION pXcvConfigurePortReqData,
  114. PINET_CONFIGUREPORT_RESPDATA pXcvAddPortRespData,
  115. DWORD cbSize,
  116. PDWORD cbSizeNeeded);
  117. HANDLE
  118. CreateTerminateEvent (
  119. VOID);
  120. BOOL
  121. WaitForTermination (
  122. DWORD dwWaitTime);
  123. inline BOOL
  124. bDeletePending (
  125. VOID) CONST {return m_bDeletePending;};
  126. inline VOID
  127. SetPowerUpTime (
  128. time_t t) {m_dwPowerUpTime = t;};
  129. inline time_t
  130. GetPowerUpTime (
  131. VOID) CONST {return m_dwPowerUpTime;};
  132. friend class CInetMon;
  133. protected:
  134. inline PCINETMONPORT
  135. GetNext (
  136. VOID) { return m_pNext;};
  137. inline VOID
  138. SetNext (
  139. PCINETMONPORT pNext) { m_pNext = pNext;};
  140. DWORD
  141. _inet_size_entry(
  142. DWORD dwLevel);
  143. LPBYTE
  144. _inet_copy_entry(
  145. DWORD dwLevel,
  146. LPBYTE pPortInfo,
  147. LPBYTE pEnd);
  148. BOOL
  149. _inet_req_jobstart(
  150. PIPPREQ_PRTJOB ppj,
  151. PJOBMAP pjmJob);
  152. private:
  153. VOID
  154. InvalidateGetPrinterCacheForUser(
  155. HANDLE hUser);
  156. VOID
  157. InvalidateEnumJobsCacheForUser(
  158. HANDLE hUser) ;
  159. BOOL m_bValid;
  160. DWORD m_cb; // Size of struct plus <portname>
  161. PCINETMONPORT m_pNext; // Pointer to next port entry
  162. DWORD m_cRef; // Port reference count.
  163. DWORD m_cPrinterRef; // Printer handle ref count.
  164. LPTSTR m_lpszName; // Name of port output device
  165. LPTSTR m_lpszDesc; // Description of output device
  166. LPTSTR m_lpszHost; // Name of host connection
  167. LPTSTR m_lpszShare; // Name of share (after host)
  168. GetPrinterCache *m_pGetPrinterCache; // Handle of the cache
  169. EnumJobsCache *m_pEnumJobsCache; // Handle of the cache for enumjobs
  170. BOOL m_bCheckConnection; // Need to check connection
  171. PJOBMAP m_pjmList; //
  172. PCPORTMGR m_pPortMgr; // Handle of port manager, pointer to PortMgr class
  173. BOOL m_bDeletePending; // TRUE if the port is being deleted.
  174. time_t m_dwPowerUpTime; // This is the time the printer was originally
  175. // powered up, relative to UCT
  176. HANDLE m_hTerminateEvent; // Terminate event
  177. } ;
  178. #endif