this post was submitted on 03 Jul 2025
1 points (100.0% liked)

Coding Blogs

424 readers
1 users here now

founded 10 months ago
MODERATORS
 

A customer was adding an interface to their out-of-process COM server. They added their interface to the project’s existing IDL file and recompiled the resulting proxy stub DLL. But when they tried to connect to the server, the connection failed with error 0x80040155, also known as REGDB_E_IID­NOT­REG: Interface not registered.

They realized that they forgot to register the interface’s proxy, so they added an entry to HKCR\Interface{iid}[ProxyStubClsid32] so that COM knew where to find the proxy stub. (They didn’t have to create a new CLSID entry for the proxy DLL because they were adding an interface to their existing IDL, so the proxy DLL was itself already registered by whoever set up that IDL file initially.)

Upon trying again, the connection still failed. This time with the error 0x80004002, the often-encountered E_NO­INTERFACE: No such interface supported.

We learned that one cause of this is a missing marshaler.

“But that doesn’t apply in this case, because I registered the interface and pointed it to the proxy DLL that holds the marshaler!”

Does that proxy DLL hold the marshaler?

We looked at the interface declaration.

[ object, local, uuid(iid) ] interface IWidgetFactory : IUnknown { ⟦ ... ⟧ }

The interface is marked as local. A local interface is one that never leaves its home apartment and therefore never needs to be marshalled. The IDL compiler does not generate marshallers for local interface because they would never be needed.

I don’t know the history here. It’s possible that this interface started out as local because it was originally designed as an in-apartment object, but then the team decided to move the widget factory out of process (which now requires a marshaller) and forgot to remove the local attribute.

Or maybe the local was just a copy-pasta from elsewhere in the IDL file that they forgot to remove. (Or they didn’t realize what it meant.)

The post Unintended yet somehow entirely expected consequences of marking a COM interface as local appeared first on The Old New Thing.


From The Old New Thing via this RSS feed

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here