Commit 36aee719 authored by Mike Hearn's avatar Mike Hearn Committed by Alexandre Julliard

Rename the STUBMGR thread to more accurately reflect its purpose.

parent 23ded07e
......@@ -1263,8 +1263,8 @@ HRESULT WINAPI CoRegisterClassObject(
if (dwClsContext & CLSCTX_LOCAL_SERVER) {
DWORD tid;
STUBMGR_Start();
newClass->hThread=CreateThread(NULL,0,_LocalServerThread,newClass,0,&tid);
start_listener_thread();
newClass->hThread = CreateThread(NULL,0,_LocalServerThread,newClass,0,&tid);
}
return S_OK;
}
......
......@@ -152,7 +152,7 @@ HRESULT MARSHAL_Disconnect_Proxies();
HRESULT MARSHAL_GetStandardMarshalCF(LPVOID *ppv);
void STUBMGR_Start();
void start_listener_thread();
extern HRESULT PIPE_GetNewPipeBuf(wine_marshal_id *mid, IRpcChannelBuffer **pipebuf);
......
......@@ -502,7 +502,8 @@ CoMarshalInterface( IStream *pStm, REFIID riid, IUnknown *pUnk,
if (pUnk == NULL)
return E_INVALIDARG;
STUBMGR_Start(); /* Just to be sure we have one running. */
start_listener_thread(); /* Just to be sure we have one running. */
mid.processid = GetCurrentProcessId();
IUnknown_QueryInterface(pUnk,&IID_IUnknown,(LPVOID*)&pUnknown);
mid.objectid = (DWORD)pUnknown;
......
......@@ -759,13 +759,16 @@ _StubReaderThread(LPVOID param) {
return 0;
}
static DWORD WINAPI
_StubMgrThread(LPVOID param) {
/* This thread listens on a named pipe for the entire process. It
* deals with incoming connection requests to objects.
*/
static DWORD WINAPI listener_thread(LPVOID param)
{
char pipefn[200];
HANDLE listenPipe;
sprintf(pipefn,OLESTUBMGR"_%08lx",GetCurrentProcessId());
TRACE("Stub Manager Thread starting on (%s)\n",pipefn);
TRACE("Process listener thread starting on (%s)\n",pipefn);
while (1) {
listenPipe = CreateNamedPipeA(
......@@ -792,14 +795,15 @@ _StubMgrThread(LPVOID param) {
return 0;
}
void
STUBMGR_Start() {
static BOOL stubMgrRunning = FALSE;
void start_listener_thread()
{
static BOOL running = FALSE;
DWORD tid;
if (!stubMgrRunning) {
stubMgrRunning = TRUE;
CreateThread(NULL,0,_StubMgrThread,NULL,0,&tid);
if (!running)
{
running = TRUE;
CreateThread(NULL, 0, listener_thread, NULL, 0, &tid);
Sleep(2000); /* actually we just try opening the pipe until it succeeds */
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment