Bug with SetFileCompletionNotificationModes and Non IFS Layered Service Provider

On Windows Vista and above the method SetFileCompletionNotificationModes can be used to set the way it receives IO completion port status. When this is used on Non IFS LSP sockets, any operation that uses IO completion port will fail.

What it affects

Mostly connections to MSSQL, up until now this would go under the radar, but since .net 4.5 came out and introduced native connection to MSSQL, it’s now wide spread.

Reason for the bug

We think this is done on purpose to kill LSP on Windows 7, the problem is that WFP is only mature enough on Windows 8.

Fix

We found a way to fix this issue, it’s one of our more creative fix in the LSP world.