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.

156 lines
4.6 KiB

  1. /*****************************************************************************\
  2. * MODULE: portmgr.cxx
  3. *
  4. * The module contains routines for handling the http port connection
  5. * for internet priting
  6. *
  7. * Copyright (C) 1996-1998 Microsoft Corporation
  8. * Copyright (C) 1996-1997 Hewlett Packard
  9. *
  10. * History:
  11. * 22-Jul-1996 WeihaiC Created
  12. *
  13. \*****************************************************************************/
  14. #ifndef _PORTMGR_H
  15. #define _PORTMGR_H
  16. #include "anycon.hxx"
  17. #include "lusrdata.hxx"
  18. #include "config.h"
  19. typedef class CInetMonPort* PCINETMONPORT;
  20. typedef BOOL (CALLBACK *IPPRSPPROC)(CAnyConnection *pConnection, HINTERNET hReq, PCINETMONPORT pIniPort, LPARAM lParam);
  21. class CStream;
  22. class CPortMgr
  23. : public CCriticalSection {
  24. public:
  25. CPortMgr ();
  26. ~CPortMgr ();
  27. BOOL ReadFile (
  28. CAnyConnection *pConnection,
  29. HINTERNET hReq,
  30. LPVOID lpvBuffer,
  31. DWORD cbBuffer,
  32. LPDWORD lpcbRd);
  33. BOOL CheckConnection (
  34. void);
  35. BOOL Create (
  36. LPCTSTR lpszPortName);
  37. BOOL Init (
  38. LPCTSTR lpszPortName);
  39. BOOL SendRequest(
  40. PCINETMONPORT pIniPort,
  41. LPBYTE lpIpp,
  42. DWORD cbIpp,
  43. IPPRSPPROC pfnRsp,
  44. LPARAM lParam);
  45. BOOL SendRequest(
  46. PCINETMONPORT pIniPort,
  47. CStream *pStream,
  48. IPPRSPPROC pfnRsp,
  49. LPARAM lParam);
  50. BOOL Remove (void);
  51. CLogonUserData *GetUserIfLastDecRef(CLogonUserData *);
  52. DWORD IncreaseUserRefCount(CLogonUserData *);
  53. BOOL ConfigurePort (
  54. PINET_XCV_CONFIGURATION pXcvConfigurePortReqData,
  55. PINET_CONFIGUREPORT_RESPDATA pXcvAddPortRespData,
  56. DWORD cbSize,
  57. PDWORD cbSizeNeeded);
  58. BOOL GetCurrentConfiguration (
  59. PINET_XCV_CONFIGURATION pXcvConfiguration);
  60. private:
  61. HINTERNET _OpenRequest (
  62. CAnyConnection *pConnection);
  63. BOOL _CloseRequest (
  64. CAnyConnection *pConnection,
  65. HINTERNET hReq);
  66. BOOL GetProxyInformation (VOID);
  67. BOOL _SendRequest (
  68. CAnyConnection *pConnection,
  69. HINTERNET hJobReq,
  70. CStream *pStream);
  71. BOOL _IppValRsp(
  72. CAnyConnection *pConnection,
  73. HINTERNET hReq,
  74. LPARAM lParam);
  75. BOOL _IppValidate (
  76. CAnyConnection *pConnection,
  77. HINTERNET hReq,
  78. LPCTSTR lpszPortName);
  79. BOOL _CheckConnection (
  80. CAnyConnection *pConnection,
  81. LPCTSTR lpszPortName,
  82. LPTSTR lpszHost,
  83. LPTSTR lpszUri);
  84. CAnyConnection *
  85. _GetCurrentConnection ();
  86. BOOL _ForceAuth (
  87. CAnyConnection *pConnection,
  88. LPCTSTR lpszPortName,
  89. LPTSTR lpszHost,
  90. LPTSTR lpszUri,
  91. PDWORD pdwAuthMethod);
  92. BOOL _IppForceAuth (
  93. CAnyConnection *pConnection,
  94. HINTERNET hReq,
  95. LPCTSTR lpszPortName,
  96. PDWORD pdwAuthMethod);
  97. BOOL _IppForceAuthRsp(
  98. CAnyConnection *pConnection,
  99. HINTERNET hReq,
  100. LPARAM lParam);
  101. private:
  102. HINTERNET m_hSession; // Handle for session connection.
  103. HINTERNET m_hConnect;
  104. LPTSTR m_lpszPassword;
  105. LPTSTR m_lpszUserName;
  106. LPTSTR m_lpszHostName;
  107. LPTSTR m_lpszUri;
  108. LPTSTR m_lpszPortName;
  109. LPTSTR m_lpszShare;
  110. BOOL m_bPortCreate;
  111. BOOL m_bValid;
  112. BOOL m_bForceAuthSupported;
  113. CLogonUserList m_UserList; // List of users used for ref-counting.
  114. CPortConfigDataMgr *m_pPortSettingMgr;
  115. BOOL m_bSecure;
  116. INTERNET_PORT m_nPort;
  117. };
  118. typedef class CPortMgr* PCPORTMGR;
  119. #endif // #ifndef _PORTMGR_H