oleaut32: Register non-dual dispinterfaces using the correct proxy.

Fixes a bug where NetLinx Studio 4 would fail to compile files.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-02-10 21:20:35 -06:00 committed by Alexandre Julliard
parent 767c94bc5c
commit f72f8e5c40
2 changed files with 36 additions and 6 deletions

View File

@ -4963,6 +4963,7 @@ static void test_register_typelib(BOOL system_registration)
HKEY hkey;
REGSAM opposite = (sizeof(void*) == 8 ? KEY_WOW64_32KEY : KEY_WOW64_64KEY);
BOOL is_wow64 = FALSE;
LONG size;
struct
{
TYPEKIND kind;
@ -5071,7 +5072,26 @@ static void test_register_typelib(BOOL system_registration)
ret = RegOpenKeyExA(HKEY_CLASSES_ROOT, key_name, 0, KEY_READ, &hkey);
ok(ret == expect_ret, "%d: got %d\n", i, ret);
if(ret == ERROR_SUCCESS) RegCloseKey(hkey);
if (ret == ERROR_SUCCESS)
{
size = sizeof(uuid);
ret = RegQueryValueA(hkey, "ProxyStubClsid32", uuid, &size);
ok(!ret, "Failed to get proxy GUID, error %u.\n", ret);
if (attrs[i].kind == TKIND_INTERFACE || (attrs[i].flags & TYPEFLAG_FDUAL))
{
ok(!strcasecmp(uuid, "{00020424-0000-0000-c000-000000000046}"),
"Got unexpected proxy CLSID %s.\n", uuid);
}
else
{
ok(!strcasecmp(uuid, "{00020420-0000-0000-c000-000000000046}"),
"Got unexpected proxy CLSID %s.\n", uuid);
}
RegCloseKey(hkey);
}
/* 32-bit typelibs should be registered into both registry bit modes */
if (is_win64 || is_wow64)

View File

@ -578,7 +578,10 @@ static void TLB_register_interface(TLIBATTR *libattr, LPOLESTR name, TYPEATTR *t
WCHAR keyName[60];
HKEY key, subKey;
static const WCHAR PSOA[] = {'{','0','0','0','2','0','4','2','4','-',
static const WCHAR typelib_proxy_clsid[] = {'{','0','0','0','2','0','4','2','4','-',
'0','0','0','0','-','0','0','0','0','-','C','0','0','0','-',
'0','0','0','0','0','0','0','0','0','0','4','6','}',0};
static const WCHAR dispatch_proxy_clsid[] = {'{','0','0','0','2','0','4','2','0','-',
'0','0','0','0','-','0','0','0','0','-','C','0','0','0','-',
'0','0','0','0','0','0','0','0','0','0','4','6','}',0};
@ -586,6 +589,13 @@ static void TLB_register_interface(TLIBATTR *libattr, LPOLESTR name, TYPEATTR *t
if (RegCreateKeyExW(HKEY_CLASSES_ROOT, keyName, 0, NULL, 0,
KEY_WRITE | flag, NULL, &key, NULL) == ERROR_SUCCESS)
{
const WCHAR *proxy_clsid;
if (tattr->typekind == TKIND_INTERFACE || (tattr->wTypeFlags & TYPEFLAG_FDUAL))
proxy_clsid = typelib_proxy_clsid;
else
proxy_clsid = dispatch_proxy_clsid;
if (name)
RegSetValueExW(key, NULL, 0, REG_SZ,
(BYTE *)name, (strlenW(name)+1) * sizeof(OLECHAR));
@ -593,14 +603,14 @@ static void TLB_register_interface(TLIBATTR *libattr, LPOLESTR name, TYPEATTR *t
if (RegCreateKeyExW(key, ProxyStubClsidW, 0, NULL, 0,
KEY_WRITE | flag, NULL, &subKey, NULL) == ERROR_SUCCESS) {
RegSetValueExW(subKey, NULL, 0, REG_SZ,
(const BYTE *)PSOA, sizeof PSOA);
(const BYTE *)proxy_clsid, sizeof(typelib_proxy_clsid));
RegCloseKey(subKey);
}
if (RegCreateKeyExW(key, ProxyStubClsid32W, 0, NULL, 0,
KEY_WRITE | flag, NULL, &subKey, NULL) == ERROR_SUCCESS) {
RegSetValueExW(subKey, NULL, 0, REG_SZ,
(const BYTE *)PSOA, sizeof PSOA);
(const BYTE *)proxy_clsid, sizeof(typelib_proxy_clsid));
RegCloseKey(subKey);
}