Subject Re: Operating system directive OpenProcess failed (sometimes CreateEvent failed)
Author somusque
Hello,

I found the cause but still need a solution.

Sometimes my program has to switch the user context using
LogonUserW and ImpersonateLoggedOnUser (Win32 API).

After that, the Embedded Firebird server can't open database files any more. I will investigate if I can give the new user full control over handles created by the initial user, but if there are any hints I would be grateful.

Maybe I should detach the DLL before switching user context and then attach it again? But how to do that with IBO ... also I sometimes need to run different threads in the same process under different user accounts. Sounds terrible, but it is actually quite straightforward under Windows.

Cheers,
Tobias