title: ESP Not saved across function call / Runtime Error #0
body: <p>I get a strange error complaining about stack corruption I'm assuming, and I have debugged it a bit but I haven't found out the issue. I also can't seem to implement nothrow in Visual Studio 2010!</p>
  
  <pre><code>XYZ::XYZ(char * d)
  {
      hostname = new char[HOSTNAME_LENGTH];
      ip = new char[IP_ADDR_LENGTH];
  
      /*Dynamic Memory*/
      memset(hostname, 0, HOSTNAME_LENGTH);
      memset(ip, 0, IP_ADDR_LENGTH);
  
      //strncpy(hostname, d, HOSTNAME_LENGTH);
  
      if(dWSAStartup(MAKEWORD(2,2), &amp;wsd) == 0) //Crashes Here!
      //And so on..
  </code></pre>
  
  <p>dWSAStartup is dynamically linked from ws2_32.dll and has correct function parameters typecasted:</p>
  
  <pre><code>typedef int (*WSAS)(WORD, LPWSADATA); //WSAStartup
  </code></pre>
  
  <p>And no, the FreeLibrary function hasn't been called -- so the function pointer IS valid!</p>
  
  <p>This bug is the only thing stopping me! Would anyone throw me a pointer?</p>