I have a Vendor.DLL (Native DLL, written in C++) that exposes many methods. Typically Vendor.DLL opens Vendor proprietary files, returns handles and allows more Read/Write operation on those files. Vendor.DLL supports multi-threading (when called from unmanaged code/COM).
If I expose Pinvoked method(s) from Vendor DLL, say
PinvokedVendor.DLL
[System.Runtime.InteropServices.DllImportAttribute("Vendor.dll", EntryPoint = "SomeVendorMethod")]
public static extern int SomeVendorMethod(uint param1, ref SomeVendorDataStruct pData);
How to ensure that this wrapper class is thread safe? Is it even thread safe when called from ASP.NET? What are my options?
Thanks in advance.