fix named pipe to also check for LastError ERROR_PIPE_CONNECTED #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ConnectNamedPipe can return 0, but have a good connection, when a client opens the pipe between the pipe's creation and the ConnectNamedPipe call. In that case, GetLastError() is ERROR_PIPE_CONNECTED.
For whatever reason, the threads in the host and client hit this scenario constantly on my PC. The Host goes into an infinite loop of "failed" ConnectNamedPipe calls since it never checked GetLastError.
I also had to edit the EasyHook csproj files so their default Configurations correspond to Configurations those projects actually define. The ProtoInput.sln didn't build in the ms build tools developer command line. Properties set for an sln build only apply to projects directly referenced in the sln file. If those projects reference a project not in the sln, that external project is built with its defaults.
The csproj files for EasyHook define PropertyGroups for Configuration netfx4-Debug not Debug
but were setting the default Configuration to Debug
Now these commands both work
msbuild .\ProtoInput.sln /p:ConfigurationPlatforms=Debug /p:Platform="x64"
msbuild .\ProtoInput.sln /p:ConfigurationPlatforms=Debug /p:Platform="x86"