diff --git a/source/P4VFS.Driver/Source/DriverFilter.c b/source/P4VFS.Driver/Source/DriverFilter.c index 8b033b2..349f4e9 100644 --- a/source/P4VFS.Driver/Source/DriverFilter.c +++ b/source/P4VFS.Driver/Source/DriverFilter.c @@ -608,19 +608,10 @@ P4vfsServicePortDisconnect( goto CLEANUP; } - pConnectionHandle = (P4VFS_SERVICE_PORT_CONNECTION_HANDLE*)pConnectionCookie; - if (pConnectionHandle->pClientPort != NULL) - { - // If this connection handle is our exclusive active pServiceClientPort, clear this value as we close the handle - if (pConnectionHandle->pClientPort == g_FltContext.pServiceClientPort) - { - P4vfsTraceInfo(Filter, L"P4vfsServicePortDisconnect: Closed active connection [%p]", g_FltContext.pServiceClientPort); - g_FltContext.pServiceClientPort = NULL; - } - - FltCloseClientPort(g_FltContext.pFilter, &pConnectionHandle->pClientPort); - } + P4vfsTraceInfo(Filter, L"P4vfsServicePortDisconnect: Closed active connection [%p]", g_FltContext.pServiceClientPort); + FltCloseClientPort(g_FltContext.pFilter, &g_FltContext.pServiceClientPort); + pConnectionHandle = (P4VFS_SERVICE_PORT_CONNECTION_HANDLE*)pConnectionCookie; if (pConnectionHandle->hUserProcess != NULL) { ZwClose(pConnectionHandle->hUserProcess);