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.

119 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. connect.hxx
  5. Abstract:
  6. Contains the client-side connect handle class
  7. Author:
  8. Richard L Firth (rfirth) 03-Jan-1996
  9. Revision History:
  10. 03-Jan-1996 rfirth
  11. Created
  12. --*/
  13. //
  14. // forward references
  15. //
  16. class CServerInfo;
  17. /*++
  18. Class Description:
  19. This class defines the INTERNET_CONNECT_HANDLE_OBJECT.
  20. Private Member functions:
  21. None.
  22. Public Member functions:
  23. --*/
  24. class INTERNET_CONNECT_HANDLE_OBJECT : public INTERNET_HANDLE_BASE {
  25. protected:
  26. // params from WinHttpConnect
  27. ICSTRING _HostName;
  28. INTERNET_PORT _HostPort;
  29. INTERNET_SCHEME _SchemeType; // http vs. https
  30. public:
  31. INTERNET_CONNECT_HANDLE_OBJECT(
  32. INTERNET_HANDLE_BASE * INetObj,
  33. LPTSTR lpszServerName,
  34. INTERNET_PORT nServerPort,
  35. DWORD dwFlags,
  36. DWORD_PTR dwContext
  37. );
  38. INTERNET_CONNECT_HANDLE_OBJECT(
  39. INTERNET_CONNECT_HANDLE_OBJECT * InternetConnectObj
  40. );
  41. INTERNET_CONNECT_HANDLE_OBJECT(
  42. INTERNET_HANDLE_BASE * Parent,
  43. HINTERNET Child,
  44. LPTSTR lpszServerName,
  45. INTERNET_PORT nServerPort,
  46. DWORD dwFlags,
  47. DWORD_PTR dwContext
  48. );
  49. virtual ~INTERNET_CONNECT_HANDLE_OBJECT(VOID);
  50. virtual HINTERNET_HANDLE_TYPE GetHandleType(VOID)
  51. {
  52. return TypeHttpConnectHandle;
  53. }
  54. VOID SetHostName(LPSTR HostName) {
  55. _HostName = HostName;
  56. }
  57. LPSTR GetHostName(VOID) {
  58. return _HostName.StringAddress();
  59. }
  60. LPSTR GetHostName(LPDWORD lpdwStringLength) {
  61. *lpdwStringLength = _HostName.StringLength();
  62. return _HostName.StringAddress();
  63. }
  64. LPSTR GetServerName(VOID) {
  65. return _HostName.StringAddress();;
  66. }
  67. VOID SetHostPort(INTERNET_PORT Port) {
  68. _HostPort = Port;
  69. }
  70. INTERNET_PORT GetHostPort(VOID) {
  71. return _HostPort;
  72. }
  73. INTERNET_SCHEME GetSchemeType(VOID) const {
  74. return (_SchemeType == INTERNET_SCHEME_DEFAULT)
  75. ? INTERNET_SCHEME_HTTP
  76. : _SchemeType;
  77. }
  78. VOID SetSchemeType(INTERNET_SCHEME SchemeType) {
  79. _SchemeType = SchemeType;
  80. }
  81. };