Source code of Windows XP (NT5)
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.

62 lines
1.5 KiB

  1. /*****************************************************************************\
  2. * MODULE: iecon.cxx
  3. *
  4. * The module contains class for connections using IE's default configuration
  5. *
  6. * Copyright (C) 1997-1998 Microsoft Corporation
  7. *
  8. * History:
  9. * 07/31/98 Weihaic Created
  10. *
  11. \*****************************************************************************/
  12. #include "precomp.h"
  13. #include "priv.h"
  14. CNTConnection::CNTConnection (
  15. BOOL bSecure,
  16. INTERNET_PORT nServerPort,
  17. BOOL bIgnoreSecurityDlg):
  18. CAnyConnection (bSecure, nServerPort, bIgnoreSecurityDlg, AUTH_NT)
  19. {
  20. }
  21. BOOL
  22. CNTConnection::SendRequest(
  23. HINTERNET hReq,
  24. LPCTSTR lpszHdr,
  25. CStream *pStream)
  26. {
  27. static const DWORD dwMaxRetry = 3;
  28. BOOL bRet = FALSE;
  29. DWORD dwRet;
  30. DWORD dwFlags;
  31. DWORD i;
  32. dwFlags = FLAGS_ERROR_UI_FLAGS_NO_UI;
  33. for (i = 0; i < dwMaxRetry; i++ ) {
  34. bRet = CAnyConnection::SendRequest (hReq,
  35. lpszHdr,
  36. pStream);
  37. if (bRet || GetLastError () != ERROR_ACCESS_DENIED) {
  38. break;
  39. }
  40. dwRet = InetInternetErrorDlg(GetDesktopWindow(),
  41. hReq,
  42. bRet ? ERROR_SUCCESS : GetLastError(),
  43. dwFlags,
  44. NULL);
  45. if (dwRet != ERROR_INTERNET_FORCE_RETRY) {
  46. break;
  47. }
  48. }
  49. return bRet;
  50. }