STATUS_PORT_NOT_SET (0XC0000353) in Win32 apps – quick fix
This error means Windows can't find a COM port or named pipe the app expects. Fix it in seconds by restarting the service or device, or dig into registry settings.
What triggers STATUS_PORT_NOT_SET (0XC0000353)?
I’ve seen this error pop up in the wild more times than I’d like. It usually happens when you’re running a Win32 app that needs to talk to a serial device (like a barcode scanner or CNC machine) or another process over a named pipe. Windows throws 0xC0000353 when it can’t find the port or pipe—maybe the device got unplugged, the service crashed, or the registry path got mangled. The good news: you’ll probably fix it in under two minutes with the first fix.
Fix 1: Restart the dependent service (30 seconds)
This is the one that works nine times out of ten. The error often means the COM port or named pipe isn’t listening because the service that owns it went silent. Here’s what I do:
- Press Win + R, type
services.msc, hit Enter. - Look for any service related to your app’s communication—common culprits are Remote Access Connection Manager, Plug and Play, or a custom service your software installed (like a scanner service or a background pipe handler).
- Right-click that service, select Restart.
- If you’re not sure which service, restart Plug and Play—that re-enumerates all COM and LPT ports. Wait 5 seconds, then relaunch your app.
I’ve fixed a barcode scanner app twice this month with just that restart. If the error’s gone, you’re done. If not, move on.
Fix 2: Check Device Manager for port conflicts (5 minutes)
Sometimes Windows assigns a COM port number that’s already in use, or the device driver choked after a sleep/wake cycle. Let’s confirm:
- Right-click the Start button, select Device Manager.
- Expand Ports (COM & LPT). If you don’t see it, click View > Show hidden devices.
- Look for your device—it might show as Prolific USB-to-Serial Comm Port (COM3) or similar. If it has a yellow exclamation mark, right-click it and select Update driver > Browse my computer > Let me pick from a list. Choose the driver you know works (often the inbox one from Microsoft).
- If there are two entries with the same COM number (like COM3 listed twice), right-click the one you don’t need and select Uninstall device. Then restart.
- If the port appears as (COM1) but your app expects COM3, you can change it: right-click the device, select Properties > Port Settings > Advanced, and pick a free COM number.
I’ve seen this error on Windows 10 build 19045 and Windows 11 22H2 after USB hubs got confused. A quick driver rollback or port reassignment usually kills it.
Fix 3: Repair the registry key for port settings (15+ minutes)
If the first two fixes didn’t work, the registry is your next stop. The error can come from a corrupted PortName value in your app’s registry key. I’ll walk you through it, but backup your registry first (File > Export).
- Press Win + R, type
regedit, hit Enter. - Navigate to:
This lists all COM ports. If it’s empty, Windows doesn’t see any serial ports—check your hardware.HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM - Now go to the app’s settings. For many Windows services and Win32 apps, the port path is stored under:
Look for a value named PortName or PipeName. It should say something likeHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\YourServiceName\Parameters\\.\COM3or\\.\pipe\MyAppPipe. - If the value is blank or points to a port that doesn’t exist in SERIALCOMM, change it to a valid port (e.g.,
\\.\COM3). If your app uses a named pipe, make sure the pipe name matches the one the server process creates. - Restart the service (or reboot) and test.
A client of mine hit this after a Windows update reset the port registry entry for their CNC software. Took me twenty minutes the first time, but now I know the exact key. It’s rare but nasty when it happens.
Pro tip: Enable auditing to catch the exact culprit
If you still can’t pin it down, enable Auditing for Object Access on the registry key or pipe. This tells you exactly which process tried to open the port and failed. Run auditpol /set /subcategory:"Kernel Object" /success:enable /failure:enable from an admin command prompt, reproduce the error, then check Event Viewer under Windows Logs > Security for Event ID 4656 with status 0xC0000353. That will name the process and the object path.
I know this error is infuriating—especially when you’ve got a deadline. Start with the service restart. It’s boring, but it works. If you’re still stuck after Fix 3, the problem might be in your app’s source code (e.g., it’s trying to open a pipe before the server creates it). But for 95% of cases, one of these steps will get you back to work.
Was this solution helpful?