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.

67 lines
1.8 KiB

  1. /*****************************************************************************\
  2. * MODULE: anonycon.cxx
  3. *
  4. * The module contains class for connections using anonymous account
  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. CAnonymousConnection::CAnonymousConnection (
  15. BOOL bSecure,
  16. INTERNET_PORT nServerPort,
  17. BOOL bIgnoreSecurityDlg):
  18. CAnyConnection (bSecure, nServerPort, bIgnoreSecurityDlg, AUTH_ANONYMOUS)
  19. {
  20. }
  21. HINTERNET
  22. CAnonymousConnection::OpenRequest (
  23. LPTSTR lpszUrl)
  24. {
  25. HINTERNET hReq = NULL;
  26. WIN9X_NEW_ASYNC( pacSync );
  27. WIN9X_IF_ASYNC ( pacSync )
  28. WIN9X_IF_ASYNC ( pacSync->bValid() ) {
  29. hReq = InetHttpOpenRequest(m_hConnect,
  30. g_szPOST,
  31. lpszUrl,
  32. g_szHttpVersion,
  33. NULL,
  34. NULL,
  35. INETPP_REQ_FLAGS | INTERNET_FLAG_NO_AUTH | (m_bSecure?INTERNET_FLAG_SECURE:0),
  36. WIN9X_CONTEXT_ASYNC(pacSync));
  37. } WIN9X_ELSE_ASYNC(delete pacSync);
  38. if ( hReq ) {
  39. if ( InetInternetSetOption (hReq,
  40. INTERNET_OPTION_USERNAME,
  41. TEXT (""),
  42. 1) &&
  43. InetInternetSetOption (hReq,
  44. INTERNET_OPTION_PASSWORD,
  45. TEXT (""),
  46. 1) ) {
  47. }
  48. else {
  49. CloseRequest (hReq);
  50. hReq = NULL;
  51. }
  52. }
  53. return hReq;
  54. }