Readfile() and GetOverlappedResult() return lpNumberOfBytesTransferred lenght problem.

I have a question
I declared a USB HID DEVICE, HID report as follows:
Usage Page (Vendor-Defined 1)
06 00 FF 
Usage (Vendor-Defined 2)
09 02 
Collection (Application)
A1 01 
    Logical Minimum (0)
15 00 
    Logical Maximum (255)
26 FF 00 
    Report Size (8)
75 08 
    Report ID (1)
85 01 
    Report Count (7)
95 07 
    Usage (Vendor-Defined 2)
09 02 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)
81 02 
    Usage (Vendor-Defined 2)
09 02 
    Output (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit)
91 02 
    Report ID (2)
85 02 
    Report Count (63)
95 3F 
    Usage (Vendor-Defined 2)
09 02 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)
81 02 
    Usage (Vendor-Defined 2)
09 02 
    Output (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit)
91 02 
End Collection
C0 
USB HID device success send 8 bytes data to pc. (01 35 00 00 00 00 00 00)
Part of the source code:
memset(ReadReportBuffer, 0, sizeof(ReadReportBuffer));
ReadFile(m_hReadHandle,
ReadReportBuffer,
64,
NULL,
&ReadOverlapped);
dObject = WaitForMultipleObjects(2, hArray, FALSE, INFINITE);
if (dObject == WAIT_OBJECT_0)
if (!MyDevFound)//Device extract also set the event 
continue;
GetOverlappedResult(m_hReadHandle,
&ReadOverlapped,
&nBytesRead,
TRUE);//you can also set the last parameter False
if (nBytesRead != 0)
m_strTemp = ReadReportBuffer;
m_strLog.Format(_T("Read the Report Data Length is %d.(%02d:%02d:%02d)"),
nBytesRead, sysTime.wHour, sysTime.wMinute, sysTime.wSecond);
m_strLog += m_strTemp;
Display_Info::SendEvent(m_strLog);
//Display Receive Data
pDlg->DisplayDataHex(ReadReportBuffer, nBytesRead);
why nBytesRead value = 64?

and if you open a non overlapped handle and send synchronous IO, how many bytes are returned? the code you posted was too much of a snippet, post the entirety of the function so that we can see what is going on.
d -- This posting is provided "AS IS" with no warranties, and confers no rights.

Similar Messages

  • XSL and carriage return problem

    I'm using an HTML form to get the input text from the user.
    The text is stored in an XML file and after that I use XSL transformation
    to show the text as HTML file.
    The problem is with carriage returns that user has entered.
    In HTML file I see 
    In my java code I tried to replace all &#13; with <br> but It sounds there is no &#13; when I
    look in my XML content in a java string variable.
    Any Idea?
    Thanks,
    Payam

    Store the user-entered portion in a <![CDATA[Data goes here]]> tag to preserve whitespace and carriage returns.
    - Jesse

  • TS3276 I have no sound on my MacBook Air for sending and receiving messages. All sound settings have been checked and are OK. This problem has arisen many times and is intermittent in the sense that the sound returns and disappears for no apparent reason.

    I have no sound on my MacBook Air for sending and receiving messages. All sound settings have been checked and are OK. This problem has arisen many times and is intermittent in the sense that the sound returns and disappears for no apparent reason.

    Open System Preferences > Sound > Sound Effects
    Select:  Play user interface sound effects
    And make sure the Mute box is not selected.
    Now open Mail. From the Mail menu bar clik Mail > Preferences then select the General tab.
    Make a selection from the:  New messages sound  pop up menu.

  • Migration and Carriage Returns Problem

    I'm trying to migrate from Now Up To Date a Palm based 3rd party app - to Address Book in order to get get ready for and buy an iPhone. But all contacts with carriage returns in my NUTD contacts (doulble address lines and in Notes) look like this in Address Book after importing:
    Title: ¶Description: Serial Number: BD0C159 ¶TSID Number: 10040150 ¶Model: SCSI Card AV-2906¶¶¶
    Instead of:
    Title:
    Description: Serial Number: BD0C159
    TSID Number: 10040150
    Model: SCSI Card AV-2906
    I have over 1000 contacts many of which have carriage returns. Will I have to fix these manually?
    Thx,
    Steven

    Store the user-entered portion in a <![CDATA[Data goes here]]> tag to preserve whitespace and carriage returns.
    - Jesse

  • Keep white spaces and carriage returns?

    I'm viewing a column -VARCHAR2(4000)- in a standard report column.
    The column value contains white spaces and carriage returns.
    I put "white-space:pre;" in CSS Style, but it still skips carriage returns...
    What can I do to view white spaces and carriage returns?
    I'm using apex 3.0 and IE 7.
    Saad.

    I'm using apex 3.0 and IE 7.There's your problem...
    IE6 (and, since there don't seem to be any docs saying anything different, presumably IE7) don't support white-space: pre in quirks mode. Don't ask me why - probably in one of MS efforts to "not break the web".
    All the APEX built-in templates are rendered in quirks mode as they don't supply complete DOCTYPEs. If you are using a standard APEX template or a custom template without a complete DOCTYPE declaration you are probably seeing this quirks behaviour.
    It looks like this will change in IE8.

  • TS4123 This is not correct solution. I have fresh copy of Windows 7 64 bit and I have the same problem.  Autorun only shows the Bonjour service.  It started when try to sync more than one iphone.

    This is not correct solution. I have fresh/new copy of Windows 7 64 bit and I have the same problem. 
    Autorun only shows the Apple Bonjour service.  It started when try to sync more than one iphone over WiFi. I have two iphones and an iPad. I turned off syncing over WiFi and still has high CPU utilization. One of the CPU's is pegged at 100%.  It is the AppleMobileDeviceService.exe process.

    For the record, I then followed the suggestion of MarcDCMB in https://discussions.apple.com/thread/4291206 of just manually restarting the Apple Mobile Device service in Windows services.msc once each time after starting iTunes and the service no longer hogs CPU after that service restart.  Not too painful as a work-around, and apparently an effective one, but clearly not a solution to the problem.  Again, as above, all the other solutions didn't work for me and I have no conflicting software as far as I can tell. So you'd have to say this Apple's problem.
    Also FTR, I am still on the 5.2.0.6 version of the Apple Mobile Device Support MSI and I don't know if that is relevant to this work-around working but my sense is that it is NOT relevant.  I'll report back on this thread if I re-upgrade and the problem returns in spite of the service-restart approach.

  • Can you increase the brightness of a photo in order to edit and then return to the original brighten

    Can you increase the brightness of a photo temporarily while editing in PS and then return to the original brightness.  My problem is that I want to delete some objects in my photo and can hardly see them.

    Awesome--some of my menu choices were not the same so I had to guess but I did it and it preserved the original brightness.
    My path:
    View->Proof Setup->Custom->Device to simulate: sRGB ice (bunch of nos.)->Preserve no. set on
    And Voila!  it returned me to my orignal colors and brightness and maintained the other changes I made.
    Thank you.

  • How can I search a file system and only return newer files?

    Sorry the title didn't give me much room to work with. I'm writing a tool which needs to track all the files in an OS. What I'd like to do is make it so my program will only return files that have been modified/created since the last search to add to my program. I was wondering if there's an efficient way to do this other than checking each file's timestamps? Also is there a way to tell from a parent directory whether any files in its directory have been modified/created? I'm looking for ways for Windows and Linux.

    I have no problem checking timestamps but it can be rather time consuming doing this. I don't know if this is quicker but I'd like to sort by modified date and check the time stamps for newer timestamps than the last time I ran. This way if I hit a time stamp equal to my last run I know to stop there. I checked Windows and the folder does tell you whether any file was created/modified in it's directory. However, if a file is created in one of its children's directories it won't update the time stamp. It's unfortunate because I could've avoided the search at a higher level directory otherwise. Without this I'll have to walk the whole structure one way or another. I can still improve the speed but I can't make it as efficient as I'd like.

  • The ipad wont sync and will return an error "Ipad cannot sync because the computer is no longer authorized to transfer the purchases..." But when I do a file devices transfer purchases.

    The ipad wont sync and will return an error "Ipad cannot sync because the computer is no longer authorized to transfer the purchases..." But when I do a file>devices>transfer purchases. It is successful. Updated to ios7 recently. I'm facing the problem since then. I've tried deauthorizing and then authorizing several times.

    Thanks Gail but ive tried that as well as logging oht and back into my accounts on my iphone and mac but I still get that message. I actually found a solution by unckecking my synced music playlist and clicking sync to remove it and then reclicked on my playlist to sync and it actually synced notmally and I got all of my new songs so I wanted to test it again so I clicked on sync again and the message once again popped up until I did the un-syncing and re-syncing again. I guess I will keep doing that in the future even though its annoying but its better than resetting my iphone.

  • When installing Maverick on my 17" Macbook pro I got the message that my HD is damaged and can't be repaired. I now can't restart without simply repeating the attempt to install Maverick and thereby returning to the same message. How do I abort install

    When installing Maverick on my 17" Macbook pro I got the message that my HD was damaged and couldn't be repaired. (not good news!!) I now can't restart without returning  to the Maverick setup and therefore returning to the same message. How do I abort the Maverick installation so that I can try to return to the previous OS so that I can try to recover/repair the HD

    I have the same problem with my 2008 MacBook. Repair disk from disk utility says it was successful but the installer thinks it's groundhog day after a reboot. I also tried fsck -fy after booting in to a command mode and it came back clean but again the installer gives the same error message. It seems like a bit is stuck somewhere indicating my HD is bad when it isn't.
    I had the latest version of Mountain Lion and have applied every upgrade up to then without issue.
    Anyone find a solution yet without having to erase the entire disk and staring over?
    Attached is a screen shot of the error.

  • HT201177 My new Mac Mini is plugged directly into my tv via hdmi cable and the screen will abruptly go blank and then return after a few seconds. Why is this happening?

    So I recently got a Mac Mini about two weeks ago and for some reason while I am on it the display will go blank and then return after a few seconds. It is happening very frequently. I checked the HDMI cable, I checked my tv and nothing seems to be wrong with them and I don't know what is going on.
    I am getting a bit frustrated because this Mac is brand spanking new and it is totally acting up for no reason whatsoever.
    Could someone please help me with this? I don't want my new computer to be useless. I need it.

    Which TV model do you have?
    Be aware of the fact that very many TVs do expect video signals on their HDMI inputs, not data signals from Macs or PCs. Please consult your TV manual if PCs or Macs can definitely be connected via HDMI, or if e.g. only DVI or RGB/VGA connectors are to be used.
    In case of DVI inputs for data being present, it's not a problem if an HDMI->DVI adapter, or better, cable is being used.
    Many users here are overlooking this potential reason for problems, assuming that HDMI outputs must always communicate with any HDMI input, certainly also because TV manufacturers do not "advertise" such limitations loudly.
    AV receivers with multiple HDMI inputs and a single HDMI video output to the TV are typically more "tolerant" and provide a sort of "converter" function. If present, feed a Mac's HDMI signal into the receiver, not the TV directly. If the receiver does not have enough HDMI inputs, consider to connect rather a video source (DVD player or similar) directly to the TV than the the Mac.

  • I I made a PDF fie to preview, but am still apprehensive to actually order the book, as I have ordered some prints of photos after I thought i had them cropped correctly and prints returned with heads, half of bodies have a book formatted and ready to buy

    I have formatted a photo book, but am apprehensive to push the "buy" button as I have ordered prints that I thought were cropped correctly, and they returned with heads cut off and half of bodies mising.  I have put the book on a PDF file as instucted, please reassure me that if everything looks right there, that is the way the book will look??

    If the PDF looks good then the printed copy should be OK.  The only problem you might run into is the color rendering.  As long as none of your photos use the sRGB profile and not the Adobe RGB color profile the color should be fine.
    On those prints that were cropped incorrectly: did you copy them to the print size ordered before uploading for printing? If not then they will be cropped by the printing equipment and you'll lose part of the top and bottom of the print (for landscape prints).
    OT

  • EA6500 completely disappointing, erratic performance, waste of time and money, return it

    Bought this late last year, paid almost $200 for up to date features, dual band and fast speed.  This is apiece of junk.  Firmware up to date too.
    Intermittent  both WIFI and wired connections.  Randomly drops WIFI and wired connections and then requires full power down to reset.  Waste of my time to do so 2 or 3 times each week.  Calls to tech support direct me  to TURN OFF THE FEATURES (prioritization, parental control) included in it.  Really?  For $200 why should I have too. And they are ALREADY off and it chugs along inconsistently.
    Saved box and receipt and am returning it.  Need advice what to buy now.  Have had WIFI at home for 10 years, this was my 3rd router. Had more problem in a few weeks than I had in a decade with the other 2 and they were MUCH cheaper.

    Hi vid81,
    Have you ever tried to call tech support?  If you did, you probably had a bad router. I suggest the newest from Linksys WRT1900ac. Check this out.

  • Asynchronous XI- RFC and RFC- XI scenario - strange problem

    Hello XI-Xperts,
    I've come to really strange problem, which I would like to share with you and possibly get an explanation.
    I have an asynchronous scenario with ending XI->RFC. The RFC function in R/3 has got an optional parameter called SENDER, which when is filled, the another asynchronous RFC->XI scenario should be started. (via ABAP code <i>CALL FUNCTION 'Z_XI_RETURN' DESTINATION gc_xi_destination</i> ... etc.)
    Now, the direction XI->RFC is configured properly, but the way back NO(!). Anyway I thought that it wouldn't make me a trouble, because those two scenarios are IMHO absolutelly separated. So I'd presume that the the data should come to R/3 without problem, it should be processed, and in case the parameter SENDER is filled the R/3 would establish the RFC connection and the "return data" should go back in different XI thread.
    Well I would think like that but the situation is different:
    When the parameter SENDER is empty, all goes OK and I can see in Runtime Workbench Message Monitoring - Adapter engine - Detail - Audit log only "successes". But when SENDER is filled with a value and R/3 does CALL FUNCTION with DESTINATION to a <i>non-existing Sender agreement</i>, the R/3 apparently doesn't send a acknowledgement to Adapter Engine of first thread XI->RFC. Intstead of that there are three messages in audit log:
    <i>MP: exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: JCO.Exception while calling Z_FIDATA_INPUT in remote system (RfcClient[IS2RFC_SAP_BG]):com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: senderAgreement not found: lookup of binding via CPA-cache failed for AdapterType RFC, AdapterNS http://sap.com/xi/XI/System, di: com.sap.aii.af.rfc.afcommunication.RfcAFWException: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: JCO.Exception w
    </i>
    Basically I understand what is happening on the background, but I really can't go over my persuation that in case of the ASYNCHRONOUS SCENARIO this should not happen.
    Or is the RFC call (I mean XI->RFC) "pseudo-synchronous" even in asynchronous scenario ? I mean that Adapter engine waits for the result of RFC everytime ... ?!
    Thank you
    Tomas

    Hello again guys,
    so I've understood it on the end. My ABAP code didn't contain EXCEPTION part of CALL FUNCTION statement.
    <i>CALL FUNCTION 'Z_XI_RETURN'
        DESTINATION gc_xi_destination
        EXPORTING
          <PARS>
        <b>EXCEPTIONS
          communication_failure = 1
          system_failure        = 2.</b></i>
    Without it the RFC short-dumped and AE correctly tried to call it 1+3 times. The thing, that the problem was connected to XI related topic, tricked me. Well it's smart, I must admit on the end
    Reward points for interest.
    THX Tomas

  • Command+Return and Shift+Return keyboard shortcuts stopped working

    I'm using Firefox 4.0 on a 21.5" iMac running Mac OS X version 10.6.7. Just this morning, the command+return and shift+return keyboard shortcuts to auto-complete the .com and .net addresses of websites stopped working. Command+w still closes a tab, and command+left click still opens a tab in a new window. However, when I type anything in the address bar ("mac" for example) and then hit command+enter, Firefox opens up a new tab with a Google search for the word I typed. The address for this new tab is as follows:
    http://www.google.com/search?q=mac&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
    Any idea what gives? I'm rather perplexed and frustrated.

    Just removed OmniBar and the problem went away.

Maybe you are looking for