Commit 6c2a5ee9 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

compobj.dll16: Implement CoGetClassObject16().

parent a9bae962
...@@ -714,15 +714,74 @@ HRESULT WINAPI CoFileTimeNow16( FILETIME *lpFileTime ) ...@@ -714,15 +714,74 @@ HRESULT WINAPI CoFileTimeNow16( FILETIME *lpFileTime )
* *
*/ */
HRESULT WINAPI CoGetClassObject16( HRESULT WINAPI CoGetClassObject16(
REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo, SEGPTR rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo,
REFIID iid, LPVOID *ppv) SEGPTR riid, SEGPTR ppv)
{ {
FIXME(", stub!\n\tCLSID:\t%s,\n\tIID:\t%s\n", debugstr_guid(rclsid), debugstr_guid(iid)); LPVOID *ppvl = MapSL(ppv);
TRACE("CLSID: %s, IID: %s\n", debugstr_guid(MapSL(rclsid)), debugstr_guid(MapSL(riid)));
*ppvl = NULL;
if (pServerInfo) { if (pServerInfo) {
FIXME("\tpServerInfo: name=%s\n",debugstr_w(pServerInfo->pwszName)); FIXME("pServerInfo->name=%s pAuthInfo=%p\n",
FIXME("\t\tpAuthInfo=%p\n",pServerInfo->pAuthInfo); debugstr_w(pServerInfo->pwszName), pServerInfo->pAuthInfo);
}
if (CLSCTX_INPROC_SERVER & dwClsContext)
{
char idstr[CHARS_IN_GUID];
char buf_key[CHARS_IN_GUID+19], dllpath[MAX_PATH+1];
LONG dllpath_len = sizeof(dllpath);
HMODULE16 dll;
FARPROC16 DllGetClassObject;
WORD args[6];
DWORD dwRet;
StringFromGUID216(MapSL(rclsid), idstr, CHARS_IN_GUID);
sprintf(buf_key, "CLSID\\%s\\InprocServer", idstr);
if (RegQueryValueA(HKEY_CLASSES_ROOT, buf_key, dllpath, &dllpath_len))
{
ERR("class %s not registered\n", debugstr_guid(MapSL(rclsid)));
return REGDB_E_CLASSNOTREG;
}
dll = LoadLibrary16(dllpath);
if (!dll)
{
ERR("couldn't load in-process dll %s\n", debugstr_a(dllpath));
return E_ACCESSDENIED; /* FIXME: or should this be CO_E_DLLNOTFOUND? */
}
DllGetClassObject = GetProcAddress16(dll, "DllGetClassObject");
if (!DllGetClassObject)
{
ERR("couldn't find function DllGetClassObject in %s\n", debugstr_a(dllpath));
FreeLibrary16(dll);
return CO_E_DLLNOTFOUND;
}
TRACE("calling DllGetClassObject %p\n", DllGetClassObject);
args[5] = SELECTOROF(rclsid);
args[4] = OFFSETOF(rclsid);
args[3] = SELECTOROF(riid);
args[2] = OFFSETOF(riid);
args[1] = SELECTOROF(ppv);
args[0] = OFFSETOF(ppv);
WOWCallback16Ex((DWORD) DllGetClassObject, WCB16_PASCAL, sizeof(args), args, &dwRet);
if (dwRet != S_OK)
{
ERR("DllGetClassObject returned error 0x%08x\n", dwRet);
FreeLibrary16(dll);
return dwRet;
}
return S_OK;
} }
FIXME("semi-stub\n");
return E_NOTIMPL; return E_NOTIMPL;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
4 pascal CoGetMalloc(long ptr) CoGetMalloc16 4 pascal CoGetMalloc(long ptr) CoGetMalloc16
5 pascal CoRegisterClassObject(ptr ptr long long ptr) CoRegisterClassObject16 5 pascal CoRegisterClassObject(ptr ptr long long ptr) CoRegisterClassObject16
6 pascal CoRevokeClassObject(long) CoRevokeClassObject16 6 pascal CoRevokeClassObject(long) CoRevokeClassObject16
7 pascal CoGetClassObject(ptr long ptr ptr ptr) CoGetClassObject16 7 pascal CoGetClassObject(segptr long ptr segptr segptr) CoGetClassObject16
8 stub COMARSHALINTERFACE 8 stub COMARSHALINTERFACE
9 stub COUNMARSHALINTERFACE 9 stub COUNMARSHALINTERFACE
10 stub COLOADLIBRARY 10 stub COLOADLIBRARY
......
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