title: Why can't Indy 10 initialize?
body: <p>I have a problem with a Delphi 2009 project : It can't initialize Indy 10 !
  This code worked fine before in Delphi 2007 (although we might have been using an older revision of Indy, but I suspect that has not much to do with it);</p>
  
  <p>The initial call to IdWinsock2.InitializeWinSock(), raises this exception (with error code 998) :</p>
  
  <pre><code>Project EAServer.exe raised exception class EIdWinsockStubError with message
  'Error on loading Winsock2 library (WS2\_32.DLL): Invalid access to memory location'.
  </code></pre>
  
  <p>But ws2_32.dll is in C:\Windows\System32 allright, with these version details :</p>
  
  <pre><code>File Version : 5.1.2600.5512 (xpsp.080413-0852)
  Description : Windows Socket 2.0 32-Bit DLL
  Copyright : © Microsoft Corporation. All rights reserved.
  </code></pre>
  
  <p>(this shows I'm on WinXP btw).</p>
  
  <p>The silly thing is, that when I look at the process itself (using "Process Explorer"), I can see the process already has this DLL open. The reason "WS2_32.DLL" is already loaded, seems to be because we use the RTL unit Winsock.pas in this project too.
  This unit is statically linked to "wsock32.dll", which has a dependancy on WS2_32.DLL, so there.</p>
  
  <p>Does anyone know why this code worked fine before (in Delphi 2007), and now (in Delphi 2009) it suddenly breaks?</p>
  
  <p>And is this inability to re-open the ws2_32 dll common knowledge, or is there really something wrong here? (I did check : I only have 1 version of these DLL's present on my system).</p>
  
  <p>Better yet : Can anyone help me fixing this?</p>