Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use windows oibc to receive a file #19

Open
jbry opened this issue Nov 20, 2011 · 1 comment
Open

Cannot use windows oibc to receive a file #19

jbry opened this issue Nov 20, 2011 · 1 comment
Assignees

Comments

@jbry
Copy link

jbry commented Nov 20, 2011

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:

  1. 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)
  2. 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
  3. WriteFile and ReadFile in receiveFile both need to have the &rfOverlapped parameter added to them, otherwise you will get an error
  4. 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

@ricky26
Copy link
Member

ricky26 commented Nov 20, 2011

This is quite true, there are also numerous other problems with it. (Such as it not parsing the file header from OIB.)

I don't believe I've actually tested it since the very hacky port from the original linux OIBC source.

We haven't really heard of many people using the windows tools, and as windows loadibec works, and the rest of of the tools work fine under a VM, it's had a rather low priority. We will try and look at it when we get a chance.

@ghost ghost assigned ricky26 Jan 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants