title: How do I call "CoInitializeSecurity" before an c# application to deactivate COM-Security?
body: <p>I've written an WPF-Apllication in c#, that uses Bluetooth Low Energy. The values of the BLE-device are never received by the app and googeling the problem suggests COM-Security may be the problem. </p>
  
  <p>To solve that problem, the following website: </p>
  
  <p><a href="http://microsoft.com/Forums/en-US/58da3fdb-a0e1-4161-8af3-778b6839f4e1/bluetooth-bluetoothledevicefromidasync-does-not-complete-on-10015063?forum=wdk" rel="nofollow noreferrer">http://microsoft.com/Forums/en-US/58da3fdb-a0e1-4161-8af3-778b6839f4e1/bluetooth-bluetoothledevicefromidasync-does-not-complete-on-10015063?forum=wdk</a></p>
  
  <p>...suggested to call <a href="https://msdn.microsoft.com/de-de/library/windows/desktop/ms693736(v=vs.85).aspx" rel="nofollow noreferrer">CoInitializeSecurity</a> manually before the c# programm starts (since when the c# program starts, the function would be called implicitly and you can't call it twice).</p>
  
  <p>Sadly I have no idea how to call this function, if I can't call it from my c#-sourcecode.</p>
  
  <p>Any help highly appreciated!</p>
  
  <p><strong>EDIT:</strong>
  <a href="http://www.pinvoke.net/default.aspx/ole32.coinitializesecurity" rel="nofollow noreferrer">http://www.pinvoke.net/default.aspx/ole32.coinitializesecurity</a> is the best help I found so far and they state "The workaround is to write an unmanaged "shim" that will call CoInitializeSecurity, then activate and call into managed code. You can do this via an export from a mixed-mode C++ DLL, by registering a managed component for use by COM, or by using the CLR hosting API." I have absolutely no idea what these things mean.</p>