Now I tried RemoteExecute with a function that uses LookupUserSID. I had to remove all Delphi related code, and only use Win32 API calls. It took a while, but now it is working like a dream!
The only problem is that when I try to use it on a system process, the whole Windows hangs. But I can live with this - probably I only need to use it for normal processes.
Thanks a lot
Question: is this problem general enough to add new methods to IProcess?
IProcess.GetUser
IProcess.GetDomain