You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

NativeMethods.cs 1.4 kB

123456789101112131415161718192021222324252627282930313233343536
  1. /****************************** Module Header ******************************\
  2. Module Name: NativeMethods.cs
  3. Project: CSWebBrowserWithProxy
  4. Copyright (c) Microsoft Corporation.
  5. This class is a simple .NET wrapper of wininet.dll. It contains 4 extern
  6. methods in wininet.dll. They are InternetOpen, InternetCloseHandle,
  7. InternetSetOption and InternetQueryOption.
  8. This source is subject to the Microsoft Public License.
  9. See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
  10. All other rights reserved.
  11. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
  12. EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
  13. WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
  14. \***************************************************************************/
  15. using System;
  16. using System.Runtime.InteropServices;
  17. namespace Shadowsocks.Util.SystemProxy
  18. {
  19. internal static class NativeMethods
  20. {
  21. /// <summary>
  22. /// Sets an Internet option.
  23. /// </summary>
  24. [DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true)]
  25. internal static extern bool InternetSetOption(
  26. IntPtr hInternet,
  27. INTERNET_OPTION dwOption,
  28. IntPtr lpBuffer,
  29. int lpdwBufferLength);
  30. }
  31. }