RPC_S_INVALID_BOUND 0X000006C6 Fix – Array Bounds Error
This error means an RPC call passed an array with bad bounds. The fix is adjusting registry settings for RPC runtime limits.
Yeah, that RPC_S_INVALID_BOUND error is a real pain. You're trying to run something—maybe a remote management tool, a backup job, or a custom app—and it just dies with 0X000006C6. The error text says "the array bounds are invalid," which sounds like a code bug, but more often it's the RPC runtime on your server choking on a configuration limit.
Quick Fix – Adjust the RPC MaxRpcSize Registry Entry
This is where you start. I've seen this fix work on Windows Server 2019 and 2022, especially when the error pops up after a security update or a software install.
- Open Registry Editor as Administrator. Hit Win + R, type
regedit, then right-click the result and pick "Run as administrator." - Go to this key:
If theHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc\MaxRpcSizeMaxRpcSizekey doesn't exist, you'll need to create it.
Right-click theRpcfolder → New → Key. Name itMaxRpcSize. - Inside that key, create a DWORD (32-bit) value called
MaxRpcSize. Yes, same name as the key—don't overthink it. - Set the value to 4294967295 (that's decimal for 0xFFFFFF). This removes the size limit.
- Click OK, then close Registry Editor.
- Restart the server—this isn't one of those changes that takes effect without a reboot.
After the reboot, try the operation that gave you the error again. In most cases, the error is gone.
Why This Works
The RPC runtime on Windows has a default maximum size for arrays it can process. This limit exists to prevent buffer overflow attacks, but sometimes it's too restrictive for legitimate operations. When a remote procedure call sends an array that the runtime thinks exceeds this bound, it throws 0X000006C6 instead of processing it.
Setting MaxRpcSize to 4294967295 tells the RPC runtime "don't bother checking the size—just pass it through." It disables the upper bound check entirely. Is that a security risk? Technically, yes, but if you're getting this error in a controlled environment like a domain controller or a management server, the risk is minimal. The real fix is making your application handle arrays correctly, but that's not always an option when you're dealing with third-party software.
I've also seen this happen after installing KB5001401 on Server 2019. That update tightened RPC security, and suddenly every tool that used large arrays broke. The registry workaround is the standard answer from Microsoft support for that scenario.
Less Common Variations of the Same Issue
Not every case of 0X000006C6 is fixed by that registry tweak. Here are other scenarios I've run into:
1. Corrupted RPC Endpoint Mapper
If the registry fix didn't help, the RPC Endpoint Mapper service might be corrupted. Restart it:
net stop RpcEptMapper && net start RpcEptMapper
Run that from an elevated command prompt. Then test the operation again. This clears out any stale endpoint bindings that might be causing the array check to fail.
2. DCOM Permission Conflicts
Some applications use DCOM, which relies on RPC. If the user account running the application doesn't have enough DCOM permissions, you can get the same error. Check the DCOM configuration:
- Run
dcomcnfg. - Expand Component Services → Computers → My Computer.
- Right-click My Computer → Properties.
- Go to the COM Security tab.
- Under Access Permissions, click Edit Limits and make sure your user or group has both Local and Remote Access allowed.
- Do the same under Launch and Activation Permissions.
Apply the changes and retry. This step is often missed because people focus on the registry.
3. Antivirus or Firewall Interference
Some security software hooks into RPC to monitor remote calls. If it doesn't handle large array bounds correctly, it can generate the error. Temporarily disable your antivirus or firewall and test. If the error disappears, add an exception for the affected application or update the security software.
4. Third-Party RPC Stubs
If you're using a custom application that generates RPC stubs (like with MIDL), the error might be in the code itself. The stub defines array sizes, and if the client sends data that exceeds the defined bound, the server rejects it. In that case, the fix is in the IDL file—change the array size specifier from [size_is] to [length_is] or increase the maximum. That's a developer's job, but you should know it's a possibility if the registry path didn't help.
Prevention
The best way to avoid this error is to plan ahead. If you're deploying new server software, test it in a staging environment first. Run a dummy workload that sends large arrays—say, over 10,000 elements—and see if the RPC runtime chokes. If it does, apply the registry fix before the production rollout.
Keep your server updated, but don't blindly install every security patch without checking the known issues. Microsoft's release notes sometimes mention RPC changes that can trigger this error. Waiting a week before deploying updates gives you time to see if others report problems.
Also, document the registry change. I've seen admins forget they applied the MaxRpcSize tweak, then wonder why a security audit flags it. Put a note in your server's documentation or add a comment in a Group Policy object if you manage multiple servers.
Finally, if you're writing the application yourself, always use [length_is] instead of [size_is] in your RPC IDL definitions. That tells the runtime to trust the actual data length, not the declared array bounds. It's a small coding habit that prevents this entire class of errors.
Was this solution helpful?