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.

57 lines
1.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1996 - 1999
  6. //
  7. // File: httptran.hxx
  8. //
  9. //--------------------------------------------------------------------------
  10. #include "wininet.h"
  11. #include "GenTran.hxx"
  12. class CHttpTran : public ISTTTran {
  13. private:
  14. DWORD fOpen;
  15. HINTERNET hIOpen;
  16. HINTERNET hIConnect;
  17. HINTERNET hIHttp;
  18. BYTE * pbRecBuf;
  19. TCHAR * tszPartURL;
  20. public:
  21. DWORD Open(const TCHAR * tszBinding, DWORD fOpen);
  22. DWORD Free(BYTE * pb);
  23. DWORD Send(DWORD dwEncodeType, DWORD cbSendBuff, const BYTE * pbSendBuff);
  24. DWORD Receive(DWORD * pdwEncodeType, DWORD * pcbReceiveBuff, BYTE ** ppbReceiveBuff);
  25. DWORD Close(void);
  26. CHttpTran(const void * pvoid) {
  27. fOpen = 0;
  28. hIOpen = NULL;
  29. hIConnect = NULL;
  30. hIHttp = NULL;
  31. pbRecBuf = NULL;
  32. tszPartURL = NULL;
  33. }
  34. virtual ~CHttpTran(void) {
  35. // free any buffers
  36. if(pbRecBuf != NULL)
  37. delete [] pbRecBuf;
  38. if(tszPartURL != NULL)
  39. delete [] tszPartURL;
  40. if(hIHttp != NULL)
  41. InternetCloseHandle(hIHttp);
  42. if(hIConnect != NULL)
  43. InternetCloseHandle(hIConnect);
  44. if(hIOpen != NULL)
  45. InternetCloseHandle(hIOpen);
  46. }
  47. };