http://bugs.winehq.org/show_bug.cgi?id=20296
--- Comment #55 from Amos Wenger amos@official.fm 2011-04-10 20:29:39 CDT --- (In reply to comment #54)
I think you mixed up the DcomLaunch service and dllhost.exe a bit in the first part.
Yeah, sorry about that. I was a bit confused at first
- rpcss.dll implements the DCOM Server Process Launcher service. When it
receives a request to start a surrogate it launches dllhost.exe. This seems to be only a part of what the DLL contains, but that is what would be needed for League of Legends.
Yeah, I think I can get started with only implementing the service. I'm not sure how to add a dll to wine (ie. what to add in Makefiles etc.) but I'll try to figure it out from other existing dlls
- dllhost.exe loads the DLL that implements the COM interface and calls
CoRegisterSurrogateEx.
Yeah, I also need to implement dllhost.exe so we can do away with Windows XP's one, but it's pretty basic from what I saw, so np.
I have no idea how the communication between the application and the COM Server Process Launcher works. That it provides a COM object itself that is used by ole32.dll to start the surrogate server could be possible.
Well that's how I would do it, I think - no matter how it's done on Windows.
So all that is needed is to implement rpcss.dll, add it to the registry and find a way to tell it to start a dllhost.exe process from the application that needs a COM server. DcomLaunch itself is always running, it gets the AppID it should pass to dllhost.exe when it receives a request to start a COM server.
Maybe it would be better to ask on the wine-devel mailinglist how Wine's COM implementation works. There seems to be some support for LOCAL_SERVER that is not using DllSurrogate, so there has to be a way to wait for a COM server that provides a CLSID to become available.
Well if you look at dlls/ole32/rpc.c, in the RPC_GetLocalClassObject function, there's code that waits till a local_server COM object is fully loaded apparently (up to 30 seconds)
I think the basic algorithm stays the same, while loop with max_tries and Sleep.. no rocket science here :) Also see http://msdn.microsoft.com/en-us/library/ms686321(v=vs.85).aspx here for interesting docs