title: My DLL doesn't work properly when it's placed on System's directory
body: <p>I wrote a COM DLL that is loaded from a third party application (which uses VBA for scripting).</p>
  
  <p>At startup, a value is passed to the DLL by the application in order to find its instance afterwards.</p>
  
  <p>This (unmanaged) value is a specific type to the application that I made <code>static</code> and global (it's outside any classes).</p>
  
  <p>The DLL is correctly registered in registry (with <code>regasm</code>) and the third party application loads correctly the DLL.</p>
  
  <p>The DLL is placed onto System's directory (i.e. System32 or SysWoW64).</p>
  
  <p>In Windows XP, the DLL works like a charm, but in Windows 7 (64 bits), there is an issue : <strong>the static value becomes null</strong> ! However, the rest of the DLL works good, just this value is buggy.</p>
  
  <p>On the other side, when we place the DLL in a non-system's folder, it's OK.</p>
  
  <p>I think that the GC destroy the value, but it's impossible because there is static and unmanaged.</p>
  
  <p>The problem it is with GC ? Why the system's folder doesn't work (even with admin rights) ? Is there a speciality with Windows7 ?</p>