It all depends on how the library is built.
If it's a 100% managed library that uses FileStream , you're probably stuck.
If it accepts the provided file name and calls its own WIN32 CreateFile function, it can give it something other than a file, such as a named pipe.
To quickly test, if possible, go @"\\.\pipe\random_name" to the method: if it answers, stating directly that it cannot open channels and file names starting with \\.\ , Well, sorry. On the other hand, if he says that he cannot find the file, you have a chance to make it work.
You can then create a NamedPipeServerStream and use the same name to invoke the library method added with \\.\pipe\ .
source share