Closing the Communication Server Port

If the minifilter driver previously opened a kernel-mode communication server port by calling FltCreateCommunicationPort, it must close the port by calling FltCloseCommunicationPort. To prevent the system from hanging during the unload process, the minifilter driver's FilterUnloadCallback routine must close this port before calling FltUnregisterFilter.

If a user-mode application has an open connection to the communication server port, any client port for that connection will remain open after FltCloseCommunicationPort returns. However, the filter manager will close any client ports when the minifilter driver is unloaded.