Rename the STUBMGR thread to more accurately reflect its purpose.
diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c
index c2f4fe4..3d94fe8 100644
--- a/dlls/ole32/compobj.c
+++ b/dlls/ole32/compobj.c
@@ -1263,8 +1263,8 @@
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;
}
diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h
index 32d1772..769878e 100644
--- a/dlls/ole32/compobj_private.h
+++ b/dlls/ole32/compobj_private.h
@@ -152,7 +152,7 @@
HRESULT MARSHAL_GetStandardMarshalCF(LPVOID *ppv);
-void STUBMGR_Start();
+void start_listener_thread();
extern HRESULT PIPE_GetNewPipeBuf(wine_marshal_id *mid, IRpcChannelBuffer **pipebuf);
diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c
index b733028..6159e81 100644
--- a/dlls/ole32/marshal.c
+++ b/dlls/ole32/marshal.c
@@ -502,7 +502,8 @@
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;
diff --git a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c
index 2dd0862..449022d 100644
--- a/dlls/ole32/rpc.c
+++ b/dlls/ole32/rpc.c
@@ -759,13 +759,16 @@
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 @@
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 */
}
}