Question: I'd like to know if I would need to ask for specific permissions and/or do something extra to make it "trustworthy" in case my program copies a dll file multiple times to the temp directory. If I do this, would the program be picked up as malicious software by anti-viruses?
Sample Code:
if (needANewCopyOfTheDll)
{
string fileName = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".dll";
// Here, copy my dll to the new file.
}
But why? I have a static library written in C++, and it has global variables, initialization procedures, and so many other stuff. I'd like to have different instances of that library and I can only load the same dll once in the memory. Thus I was thinking of wrapping the library in an instance class, and when I needed a new instance of it just copy the dll file to the temp directory and get a new handle for it using LoadLibrary()
function in kernel32.dll