Advanced system utilities to manage, troubleshoot, and diagnose Windows and Linux systems and applications.
Does Portmon really work on Win 10/11 or Server 2022 ??
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I have been investigating why Process Monitor does not capture CreateFile (IRP_MJ_CREATE) calls against serial ports (character devices) and I would appreciate some clarification on the architecture.
Setup:
Issue:
When the program opens either port, the API Monitor tool (rohitab.com) clearly shows the following call:
CreateFileA("\\.\COM14", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL)
The call succeeds and returns a valid handle. However Sysinternals Process Monitor shows nothing for either device, even with the IRP_MJ_CREATE filter active and all other filters removed.
My understanding:
NtCreateFile is the single kernel entry point for all CreateFile variants regardless of target device type. The Object Manager resolves "\.\COM14" to "??\COM14" which maps to "\Device\Serial13" or "\Device\Silabser0" depending on the adapter. I/O Manager then dispatches IRP_MJ_CREATE down the device stack.
As I understand it, IRP_MJ_CREATE is not filesystem-specific. It is dispatched for all device types including character devices.
My question:
Is Process Monitor implemented as a Filter Manager minifilter (FltRegisterFilter), and if so does Filter Manager only attach to filesystem device stacks, leaving character device stacks uncovered? Or is there another reason why IRP_MJ_CREATE against "\.\COM14" or "\.\COM10" is not captured?
For reference, a WDM upper filter driver registered for the Ports device class (GUID {4D36E978-E325-11CE-BFC1-08002BE10318}) via IoAttachDeviceToDeviceStack would sit in the device stack and would see IRP_MJ_CREATE for the same open. This suggests the limitation is specific to how Process Monitor attaches to device stacks rather than a fundamental limitation of IRP_MJ_CREATE visibility.
Is this a known limitation, a design decision, or am I missing something in the filter configuration?
Thanks!
Advanced system utilities to manage, troubleshoot, and diagnose Windows and Linux systems and applications.
Does Portmon really work on Win 10/11 or Server 2022 ??
Process Monitor does not sit in arbitrary device stacks and therefore does not see IRP_MJ_CREATE requests for serial (PORTS) class devices such as COM ports. That behavior is a consequence of its architecture rather than a limitation of IRP_MJ_CREATE itself.
From the available information:
IoAttachDeviceToDeviceStack to the Ports device class, as described, will indeed see IRP_MJ_CREATE for COM ports, because it is explicitly layered into that device stack.By contrast, Portmon is specifically implemented to monitor serial and parallel ports by inserting a filter driver directly into the serial/parallel device stacks:
ZwCreateFile and IoAttachDeviceByPointer to attach its own filter device object to the target device object. From that point, the Portmon driver sees all requests aimed at that device, including IOCTLs and create/close operations.That design explicitly targets serial/parallel stacks, which is why Portmon can see operations on COM ports while Process Monitor does not.
Given this, the absence of IRP_MJ_CREATE events for \\.\COM14 or \\.\COM10 in Process Monitor is a design/architecture limitation: it does not attach into the serial-port device stacks where those IRPs flow. The behavior described matches that design and is not due to filter misconfiguration or a fundamental limitation of IRP_MJ_CREATE visibility.
For detailed serial/parallel monitoring, Portmon (or a custom upper filter for the Ports class) is the appropriate tool; Process Monitor is not intended to provide full coverage of character-device I/O such as COM-port opens.
References: