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.

88 lines
2.0 KiB

  1. #ifndef _ANYCON_HXX
  2. #define _ANYCON_HXX
  3. class CStream;
  4. class CAnyConnection {
  5. public:
  6. CAnyConnection (
  7. BOOL bSecure,
  8. INTERNET_PORT nServerPort,
  9. BOOL bIgnoreSecurityDlg,
  10. DWORD dwAuthMethod);
  11. virtual ~CAnyConnection ();
  12. virtual HINTERNET OpenSession ();
  13. virtual BOOL CloseSession ();
  14. virtual HINTERNET Connect(
  15. LPTSTR lpszServerName);
  16. virtual BOOL Disconnect ();
  17. virtual HINTERNET OpenRequest (
  18. LPTSTR lpszUrl);
  19. virtual BOOL CloseRequest (HINTERNET hReq);
  20. virtual BOOL SendRequest(
  21. HINTERNET hReq,
  22. LPCTSTR lpszHdr,
  23. DWORD cbData,
  24. LPBYTE pidi);
  25. virtual BOOL SendRequest(
  26. HINTERNET hReq,
  27. LPCTSTR lpszHdr,
  28. CStream *pStream);
  29. virtual BOOL ReadFile (
  30. HINTERNET hReq,
  31. LPVOID lpvBuffer,
  32. DWORD cbBuffer,
  33. LPDWORD lpcbRd);
  34. BOOL IsValid () {return m_bValid;}
  35. BOOL SetPassword (
  36. HINTERNET hReq,
  37. LPTSTR lpszUserName,
  38. LPTSTR lpszPassword);
  39. BOOL GetAuthSchem (
  40. HINTERNET hReq,
  41. LPSTR lpszScheme,
  42. DWORD dwSize);
  43. void SetShowSecurityDlg (
  44. BOOL bShowSecDlg);
  45. inline DWORD GetAuthMethod (VOID) const {
  46. return m_dwAuthMethod;
  47. }
  48. protected:
  49. LPTSTR m_lpszPassword;
  50. LPTSTR m_lpszUserName;
  51. BOOL m_bValid;
  52. BOOL m_bSecure;
  53. HINTERNET m_hSession;
  54. HINTERNET m_hConnect;
  55. INTERNET_PORT m_nServerPort;
  56. BOOL m_bIgnoreSecurityDlg;
  57. private:
  58. DWORD m_dwAccessFlag;
  59. BOOL m_bShowSecDlg;
  60. DWORD m_dwAuthMethod;
  61. static const DWORD gm_dwConnectTimeout; // The connection timeout
  62. static const DWORD gm_dwSendTimeout; // The send timeout
  63. static const DWORD gm_dwReceiveTimeout; // The receive timeout
  64. static const DWORD gm_dwSendSize; // The size of the blocks we send to the server
  65. };
  66. #endif