-
Notifications
You must be signed in to change notification settings - Fork 142
Open
Description
ReceiveFile on the window oibc will deadlock.
The function is written in a way that appears to always make that happen (that or a lucky race condition before stopped it).
There are several issues:
- After using ReadFile with the overlapped flag set, GetOverlappedResult should be used to check how many bytes were read, as the parameter will always come back 0. (This can also be used instead of WaitForSingleObject)
- EnterCriticalSection for gReadSection seems to be entered before WriteFile is called. The gReadSection is locked by waiting for the device to output some information, this of course won't happen as it is sitting idly. The EnterCriticalSection should be moved after the WriteFile
- WriteFile and ReadFile in receiveFile both need to have the &rfOverlapped parameter added to them, otherwise you will get an error
- sprintf when building the receivefile command, %ul is not a valid token (VS2010 C++ express at least)
The rest of it seems to work fine
Metadata
Metadata
Assignees
Labels
No labels