VirtualBox

Changeset 11659 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Aug 26, 2008 12:32:46 PM (16 years ago)
Author:
vboxsync
Message:

Backed out r35359

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/KeyboardImpl.cpp

    r11655 r11659  
    2525#include "Logging.h"
    2626
    27 #include <VBox/com/array.h>
    2827#include <VBox/pdmdrv.h>
    2928#include <iprt/asm.h>
     
    149148                      This value can be NULL.
    150149 */
    151 STDMETHODIMP Keyboard::PutScancodes(ComSafeArrayIn (LONG, scancodes),
     150STDMETHODIMP Keyboard::PutScancodes(LONG *scancodes,
     151                                    ULONG count,
    152152                                    ULONG *codesStored)
    153153{
    154     if (ComSafeArrayInIsNull(scancodes))
     154    if (!scancodes)
    155155        return E_INVALIDARG;
    156156
     
    160160    CHECK_CONSOLE_DRV (mpDrv);
    161161
    162     com::SafeArray <LONG> keys(ComSafeArrayInArg(scancodes));
     162    LONG *currentScancode = scancodes;
    163163    int rcVBox = VINF_SUCCESS;
    164164
    165     for (uint32_t i = 0; (i < keys.size()) && VBOX_SUCCESS(rcVBox); i++)
    166     {
    167         rcVBox = mpDrv->pUpPort->pfnPutEvent(mpDrv->pUpPort, (uint8_t)keys[i]);
     165    for (uint32_t i = 0; (i < count) && VBOX_SUCCESS(rcVBox); i++, currentScancode++)
     166    {
     167        rcVBox = mpDrv->pUpPort->pfnPutEvent(mpDrv->pUpPort, *(uint8_t*)currentScancode);
    168168    }
    169169
     
    174174    /// @todo is it actually possible that not all scancodes can be transmitted?
    175175    if (codesStored)
    176         *codesStored = keys.size();
     176        *codesStored = count;
    177177
    178178    return S_OK;
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r11655 r11659  
    77077707  <interface
    77087708     name="IKeyboard" extends="$unknown"
    7709      uuid="2d1a531b-4c6e-49cc-8af6-5c857b78b5d7"
     7709     uuid="FD443EC1-000A-4F5B-9282-D72760A66916"
    77107710     wsmap="managed"
    77117711     >
     
    77247724    <method name="putScancodes">
    77257725      <desc>Sends an array of scancode to the keyboard.</desc>
    7726       <param name="scancodes" type="long" dir="in" safearray="yes"/>
     7726      <param name="scancodes" type="long" dir="in" array="count"/>
     7727      <param name="count" type="unsigned long" dir="in"/>
    77277728      <param name="codesStored" type="unsigned long" dir="return"/>
    77287729    </method>
  • trunk/src/VBox/Main/include/KeyboardImpl.h

    r11655 r11659  
    7272
    7373    STDMETHOD(PutScancode)(LONG scancode);
    74     STDMETHOD(PutScancodes)(ComSafeArrayIn (LONG, scancodes),
     74    STDMETHOD(PutScancodes)(LONG *scancodes,
     75                            ULONG count,
    7576                            ULONG *codesStored);
    7677    STDMETHOD(PutCAD)();
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette