title: LoadLibrary freezes
body: <p>I have compiled a JNI dll that I would like to load into my Java application using <code>System.loadLibrary</code>. This works perfectly fine on Windows XP with the dll compiled using MSVC++ 2008 Express.</p>
  
  <p>However, on Windows 7, where I compiled the dll using MSVC++ 2010 Express (same options, same processor architecture, same Java version, just different OS and compiler) the application would freeze upon the <code>loadLibrary</code> call. No error messages, no reaction at all. When I try <code>jstack</code> on the frozen process it freezes as well (no output, no termination). Running the application as an administrator does not fix this problem.</p>
  
  <p>The DLL and all its dependencies are in the <code>java.library.path</code>. In fact, when I removed them, the Java application would tell me they're missing, so the dll must have been initialized properly and something else fails. Debugging proves, however, that it's actually <code>loadLibrary</code> freezing and nothing afterwards.</p>
  
  <p>Can anybody tell me what might be going on here?</p>
  
  <hr>
  
  <p><strong>UPDATE</strong>:</p>
  
  <p>As stated in my comment below, this problem seems to go deeper. Using a simple C program to load one of the dependencies of said DLL already makes the freeze occur, so this must be some kind of problem with the Windows API and how MSVC++ linked the DLL (that dependency was linked by MSVC++ 2010 Express as well).</p>