Skip to content

Commit 623c059

Browse files
Update COM host to match RegAsm registration behavior (#63292)
* Update COM host to match RegAsm registration behavior
1 parent f97546b commit 623c059

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/native/corehost/comhost/comhost.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -339,15 +339,14 @@ namespace
339339

340340
RegKey regKey{ regKeyRaw };
341341

342-
// Set the default value for all COM host servers
343-
const WCHAR defServerName[] = _X("CoreCLR COMHost Server");
342+
// Set the default value, type name - this matches RegAsm behavior.
344343
res = ::RegSetValueExW(
345344
regKey.get(),
346345
nullptr,
347346
0,
348347
REG_SZ,
349-
reinterpret_cast<const BYTE*>(defServerName),
350-
static_cast<DWORD>(sizeof(defServerName)));
348+
reinterpret_cast<const BYTE*>(entry.type.c_str()),
349+
static_cast<DWORD>(entry.type.size() + 1) * sizeof(entry.type[0]));
351350
if (res != ERROR_SUCCESS)
352351
return __HRESULT_FROM_WIN32(res);
353352

0 commit comments

Comments
 (0)