RPC_E_INVALID_PARAMETER (0x80010010) Fix: COM Marshaling
This COM error hits when RPC can't marshal a parameter. The quick fix: check interface definition alignment and proxy/stub registration.
You stare at 0x80010010 wondering why COM suddenly can't cross process boundaries. I've been there. Let's cut to the fix.
The Fix: Rebuild and Re-register the Proxy/Stub
- Find your proxy/stub project. In Visual Studio, look for the project that compiles the IDL file — typically named
xxxPS.dllorxxx_p.dll. Open itsdlldata.cand check that all your interfaces are listed in theCStdStubBuffer_AddRefcalls. - Rebuild in Release mode for the correct architecture. If your client is 64-bit and server is 32-bit (or vice versa), you need a 64-bit proxy. Run
midl.exe /Oicf yourfile.idlto regenerate the C files, then compile withcl.exe /LD dlldata.c yourfile_i.c yourfile_p.c /FeProxyStub.dll /link /DLL /MACHINE:X64(adjust architecture). - Register the new DLL with
regsvr32 ProxyStub.dll. Run as admin. Check that registration returns success. - Test your cross-process call again. The error should vanish.
The reason step 3 works: COM uses the proxy/stub DLL to serialize parameters into a format RPC can transmit. If that DLL is missing, misaligned, or uses a different interface GUID, marshaling fails with this exact code. What's actually happening here is the marshaling engine can't find a valid proxy for one of your parameters — usually a custom interface or a complex struct.
Why This Happens: The Real Cause
0x80010010 doesn't mean your parameter is invalid in the C++ sense — it means COM's serialization engine can't convert it into a wire format. Three things go wrong most often:
- Interface misalignment: The client and server have different interface definitions. Check that both sides compile from the same IDL file. Even a GUID mismatch in one method parameter breaks everything.
- Missing proxy/stub: For custom interfaces, COM doesn't have built-in marshaling like it does for
IDispatchor standard interfaces. You must provide a proxy DLL. - Proxy architecture mismatch: A 64-bit client talking to a 32-bit server needs a 64-bit proxy DLL. Windows won't warn you — it just fails.
Less Common Variations
Sometimes the fix isn't a rebuild. I've seen these edge cases:
| Symptom | Real Cause | Fix |
|---|---|---|
| Error only on one machine | Corrupted registry entries for the interface proxy (e.g., after a partial uninstall). | Use OleView.exe from the Windows SDK — check under "Automation Objects" that your interface GUID maps to the correct proxy CLSID. Run regsvr32 /u then re-register. |
Error with IDispatch-based interfaces | Your IDispatch implementation returns a type library that doesn't match the actual interfaces — marshaling defaults to typelib-based, which can fail if the typelib is stale. | Recompile the typelib (midl /tlb yourfile.tlb) and ensure LoadTypeLib on the client finds the latest version. |
Error only with SAFEARRAY or VARIANT parameters | You're passing a variant that contains a pointer to an unregistered interface inside a SAFEARRAY — nested marshaling fails. | Flatten the data: pass simple types or register the contained interface's proxy. |
One real-world scenario: a custom .NET COM-callable wrapper (CCW) exposing a
List— theListgets marshaled as a SAFEARRAY of VARIANTs, but each VARIANT contains anIMyInterfacepointer. If that interface isn't registered for marshaling, 0x80010010 appears. The fix: switch toArrayListand ensureIMyInterfaceis registered.
Prevention: Lock Down Your Build Pipeline
Skip the pain next time:
- Keep one IDL file — commit it to version control. Never hand-edit generated
_i.cor_p.cfiles. - Automate proxy registration in your CI/CD pipeline. After every build, run
regsvr32on the proxy DLL. Catch mismatches early. - Use
midl /Oicfalways — the oldmidl /Oicgenerates buggy stubs with some complex parameters. I've seen it cause this exact error on Windows Server 2019. - Test cross-architecture if your stack is mixed. Spin up a 32-bit test client on a 64-bit machine early in development.
Was this solution helpful?