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.

61 lines
1.7 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. hReq = InetHttpOpenRequest(m_hConnect,
  27. g_szPOST,
  28. lpszUrl,
  29. g_szHttpVersion,
  30. NULL,
  31. NULL,
  32. INETPP_REQ_FLAGS | INTERNET_FLAG_NO_AUTH | (m_bSecure?INTERNET_FLAG_SECURE:0),
  33. 0);
  34. if ( hReq ) {
  35. if ( InetInternetSetOption (hReq,
  36. INTERNET_OPTION_USERNAME,
  37. TEXT (""),
  38. 1) &&
  39. InetInternetSetOption (hReq,
  40. INTERNET_OPTION_PASSWORD,
  41. TEXT (""),
  42. 1) ) {
  43. }
  44. else {
  45. CloseRequest (hReq);
  46. hReq = NULL;
  47. }
  48. }
  49. return hReq;
  50. }