title: WinInet::InternetSetOption(...) always returns 0 and GetLastError() returns 12018
body: <p>I am trying to set user name and password for proxy using InternetSetOption(...) method. However, it always returns zero and Last error is set to 12018.
  Below is my code snippet.</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;Wininet.h&gt;
  
  
  int _tmain(int argc, _TCHAR* argv[])
  {
      HINTERNET _session = ::InternetOpen(_T("TestProgram"),
                                INTERNET_OPEN_TYPE_PRECONFIG,
                                NULL, NULL, NULL);
      LPCTSTR proxyUserName = L"username";
      LPCTSTR proxyPassword = L"userpassword";
      BOOL b = ::InternetSetOption(_session,INTERNET_OPTION_PROXY_USERNAME ,(LPVOID)proxyUserName,wcslen(proxyUserName)+1 );
          printf(" InternetSetOption returns - %d\n",b);
          printf(" InternetSetOption GetLastError - %d\n",GetLastError());
  
          b = ::InternetSetOption(_session,INTERNET_OPTION_PROXY_PASSWORD,(LPVOID)proxyPassword,wcslen(proxyPassword) +1 );
          printf(" InternetSetOption returns - %d\n",b);
          printf(" InternetSetOption GetLastError - %d\n",GetLastError());
  
          getchar();
      return 0;
  }
  </code></pre>
  
  <p>I tried to execute above program with Admin and non-admin permissions but no luck.
  Any help is welcome.</p>
  
  <p>Thanks,
  Omky</p>