Why start a COM local server twice?

Marcus Meissner marcus at jet.franken.de
Tue May 28 15:33:56 CDT 2002


On Tue, May 28, 2002 at 11:25:52AM -0700, Medland, Bill wrote:
> Is this an oversight or a deliberate policy?
> 
> Remote_CoGetClassObject creates the local server process and hands over to
> create_marshalled_proxy
> If create_marshalled_proxy can't immediately find the pipe then it will
> create the process again.
> 
> Is it safe to drop the first one?  How about the second?  It looks to me as
> if Remote_CoGetClassObject is the only place that calls
> create_marshalled_proxy so I presume we can remove either.

Yes.

I have tested following patch with dw4 install.

Ciao, Marcus

License: LGPL
Changelog:
	Dropped superflous Remote_CoGetClassObject() (entirely contained
	in create_marshalled_proxy()).

Index: compobj.c
===================================================================
RCS file: /home/wine/wine/dlls/ole32/compobj.c,v
retrieving revision 1.55
diff -u -r1.55 compobj.c
--- compobj.c	9 Mar 2002 23:39:09 -0000	1.55
+++ compobj.c	28 May 2002 21:40:28 -0000
@@ -1293,42 +1293,6 @@
   return hr;
 }
 
-static HRESULT WINAPI Remote_CoGetClassObject(
-    REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo,
-    REFIID iid, LPVOID *ppv
-) {
-  HKEY		key;
-  char 		buf[200];
-  HRESULT	hres = E_UNEXPECTED;
-  char		xclsid[80];
-  WCHAR 	dllName[MAX_PATH+1];
-  DWORD 	dllNameLen = sizeof(dllName);
-  STARTUPINFOW	sinfo;
-  PROCESS_INFORMATION	pinfo;
-
-  WINE_StringFromCLSID((LPCLSID)rclsid,xclsid);
-
-  sprintf(buf,"CLSID\\%s\\LocalServer32",xclsid);
-  hres = RegOpenKeyExA(HKEY_CLASSES_ROOT, buf, 0, KEY_READ, &key);
-
-  if (hres != ERROR_SUCCESS)
-      return REGDB_E_CLASSNOTREG;
-
-  memset(dllName,0,sizeof(dllName));
-  hres= RegQueryValueExW(key,NULL,NULL,NULL,(LPBYTE)dllName,&dllNameLen);
-  if (hres)
-	  return REGDB_E_CLASSNOTREG; /* FIXME: check retval */
-  RegCloseKey(key);
-
-  TRACE("found LocalServer32 exe %s\n", debugstr_w(dllName));
-
-  memset(&sinfo,0,sizeof(sinfo));
-  sinfo.cb = sizeof(sinfo);
-  if (!CreateProcessW(NULL,dllName,NULL,NULL,FALSE,0,NULL,NULL,&sinfo,&pinfo))
-      return E_FAIL;
-  return create_marshalled_proxy(rclsid,iid,ppv);
-}
-
 /***********************************************************************
  *           CoGetClassObject [COMPOBJ.7]
  *           CoGetClassObject [OLE32.16]
@@ -1389,7 +1353,9 @@
 
     if (((CLSCTX_LOCAL_SERVER) & dwClsContext)
         && !((CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER) & dwClsContext))
-	return Remote_CoGetClassObject(rclsid,dwClsContext,pServerInfo,iid,ppv);
+	return create_marshalled_proxy(rclsid,iid,ppv);
+
+  
 
     /* remote servers not supported yet */
     if (     ((CLSCTX_REMOTE_SERVER) & dwClsContext)



More information about the wine-devel mailing list