NS_E_WMP_MF_CODE_EXPIRED (0XC00D0FC0) — Media Foundation Fix
This error means a Media Foundation component Windows Media Player relies on is outdated or corrupted. The fix involves resetting or updating the codec stack.
I know seeing this error is frustrating — you just want to play a video and instead you get a cryptic code.
Let's fix it. The error NS_E_WMP_MF_CODE_EXPIRED (0xC00D0FC0) pops up when Windows Media Player's Media Foundation components — the backbone for modern codecs — are either out-of-date, corrupted, or blocked by a third-party app (like a broken codec pack).
I've seen this most often after a Windows update fails partially, or after installing something like K-Lite Codec Pack 16.x that messes with system codecs. Here's the fast fix that works 9 times out of 10.
Reset Media Foundation via Command Prompt
This is the nuclear option — and it's safe. Run these two commands as an administrator:
- Press Windows Key + X and choose "Command Prompt (Admin)" or "Windows Terminal (Admin)".
- Copy and paste this command, then press Enter:
regsvr32 /u mf.dll
- Now run:
regsvr32 mf.dll
That unregisters and re-registers the Media Foundation DLL. But we're not done — we also need to reset the entire pipeline. Still in the admin prompt, run:
sfc /scannow
Let that finish (it takes 5-15 minutes). After that, reboot. Test Windows Media Player again.
Why this works
Windows Media Player on Windows 10 and 11 uses Media Foundation as its codec engine. When that engine's state table gets corrupted — often from a failed codec pack install or a botched update — it thinks the codec license has expired. The regsvr32 commands force a clean reload of the DLL, and sfc /scannow fixes any system file corruption that might have caused the mismatch. Skipping either step often leaves the problem half-fixed.
Less common variations of the same issue
If resetting Media Foundation doesn't work, try these in order:
1. Disable third-party codec packs
Go to Control Panel > Programs > Uninstall a program. Uninstall any codec packs (K-Lite, Combined Community Codec Pack, Win7codecs). Reboot. These packs sometimes override system codecs and break Media Foundation's version checking.
2. Check for corrupted user profile
Create a new local user account in Settings > Accounts > Family & other users. Log into that account and test WMP. If it works there, your profile has corrupted Media Foundation settings. Migrate your files and ditch the old account.
3. Reinstall Windows Media Player
In Settings > Apps > Optional features, find Windows Media Player, remove it, reboot, then add it back. This forces a fresh install of the Media Foundation runtime tied to WMP.
4. Check DRM permissions
If the error only shows with certain video files (especially ones from streaming services or paid downloads), it's a digital rights issue. Delete the DRM folder at C:\Users\[YourName]\AppData\Local\Microsoft\Media Player. Then restart WMP — it'll rebuild the DRM store. But only do this if you're sure the files are legitimately yours.
Prevention
Once you've fixed it, keep it that way:
- Stop using third-party codec packs. Seriously. Windows 10 and 11 already support nearly all common formats (MP4, MKV, AVI, MOV) if you install the HEVC Video Extensions from the Microsoft Store (free). Codec packs overwrite system files and cause exactly this error.
- Run Windows Update regularly. Microsoft pushes fixes for Media Foundation through cumulative updates. Don't skip them.
- If you need advanced codecs, use VLC or MPC-HC — they ship their own codecs and leave the system's Media Foundation alone.
That's it. This fix has saved my bacon more times than I can count. You shouldn't see that error again unless something else corrupts the system files — and now you know how to handle it.
Was this solution helpful?