VirtualBox

Ignore:
Timestamp:
Aug 21, 2014 4:03:15 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
95649
Message:

Main: convert VirtualBoxClient and VRDEServerInfo to use wrappers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleVRDPServer.cpp

    r52064 r52442  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    40824082
    40834083#define IMPL_GETTER_BOOL(_aType, _aName, _aIndex)                         \
    4084     STDMETHODIMP VRDEServerInfo::COMGETTER(_aName)(_aType *a##_aName)  \
     4084    HRESULT VRDEServerInfo::get##_aName(_aType *a##_aName)                \
    40854085    {                                                                     \
    4086         if (!a##_aName)                                                   \
    4087             return E_POINTER;                                             \
    4088                                                                           \
    4089         AutoCaller autoCaller(this);                                      \
    4090         if (FAILED(autoCaller.rc())) return autoCaller.rc();              \
    4091                                                                           \
    40924086        /* todo: Not sure if a AutoReadLock would be sufficient. */       \
    40934087        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);                  \
     
    40964090        uint32_t cbOut = 0;                                               \
    40974091                                                                          \
    4098         mParent->i_consoleVRDPServer()->QueryInfo                           \
     4092        mParent->i_consoleVRDPServer()->QueryInfo                         \
    40994093            (_aIndex, &value, sizeof(value), &cbOut);                     \
    41004094                                                                          \
     
    41064100
    41074101#define IMPL_GETTER_SCALAR(_aType, _aName, _aIndex, _aValueMask)          \
    4108     STDMETHODIMP VRDEServerInfo::COMGETTER(_aName)(_aType *a##_aName)  \
     4102    HRESULT VRDEServerInfo::get##_aName(_aType *a##_aName)                \
    41094103    {                                                                     \
    4110         if (!a##_aName)                                                   \
    4111             return E_POINTER;                                             \
    4112                                                                           \
    4113         AutoCaller autoCaller(this);                                      \
    4114         if (FAILED(autoCaller.rc())) return autoCaller.rc();              \
    4115                                                                           \
    41164104        /* todo: Not sure if a AutoReadLock would be sufficient. */       \
    41174105        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);                  \
     
    41204108        uint32_t cbOut = 0;                                               \
    41214109                                                                          \
    4122         mParent->i_consoleVRDPServer()->QueryInfo                           \
     4110        mParent->i_consoleVRDPServer()->QueryInfo                         \
    41234111            (_aIndex, &value, sizeof(value), &cbOut);                     \
    41244112                                                                          \
     
    41304118    extern void IMPL_GETTER_SCALAR_DUMMY(void)
    41314119
    4132 #define IMPL_GETTER_BSTR(_aType, _aName, _aIndex)                         \
    4133     STDMETHODIMP VRDEServerInfo::COMGETTER(_aName)(_aType *a##_aName)  \
     4120#define IMPL_GETTER_UTF8STR(_aType, _aName, _aIndex)                      \
     4121    HRESULT VRDEServerInfo::get##_aName(_aType &a##_aName)                \
    41344122    {                                                                     \
    4135         if (!a##_aName)                                                   \
    4136             return E_POINTER;                                             \
    4137                                                                           \
    4138         AutoCaller autoCaller(this);                                      \
    4139         if (FAILED(autoCaller.rc())) return autoCaller.rc();              \
    4140                                                                           \
    41414123        /* todo: Not sure if a AutoReadLock would be sufficient. */       \
    41424124        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);                  \
     
    41444126        uint32_t cbOut = 0;                                               \
    41454127                                                                          \
    4146         mParent->i_consoleVRDPServer()->QueryInfo                           \
     4128        mParent->i_consoleVRDPServer()->QueryInfo                         \
    41474129            (_aIndex, NULL, 0, &cbOut);                                   \
    41484130                                                                          \
    41494131        if (cbOut == 0)                                                   \
    41504132        {                                                                 \
    4151             Bstr str("");                                                 \
    4152             str.cloneTo(a##_aName);                                       \
     4133            a##_aName = Utf8Str::Empty;                                   \
    41534134            return S_OK;                                                  \
    41544135        }                                                                 \
     
    41644145        }                                                                 \
    41654146                                                                          \
    4166         mParent->i_consoleVRDPServer()->QueryInfo                           \
     4147        mParent->i_consoleVRDPServer()->QueryInfo                         \
    41674148            (_aIndex, pchBuffer, cbOut, &cbOut);                          \
    41684149                                                                          \
    4169         Bstr str(pchBuffer);                                              \
    4170                                                                           \
    4171         str.cloneTo(a##_aName);                                           \
     4150        a##_aName = pchBuffer;                                            \
    41724151                                                                          \
    41734152        RTMemTmpFree(pchBuffer);                                          \
     
    41864165IMPL_GETTER_SCALAR (LONG64,  BytesReceived,      VRDE_QI_BYTES_RECEIVED,        INT64_MAX);
    41874166IMPL_GETTER_SCALAR (LONG64,  BytesReceivedTotal, VRDE_QI_BYTES_RECEIVED_TOTAL,  INT64_MAX);
    4188 IMPL_GETTER_BSTR   (BSTR,    User,               VRDE_QI_USER);
    4189 IMPL_GETTER_BSTR   (BSTR,    Domain,             VRDE_QI_DOMAIN);
    4190 IMPL_GETTER_BSTR   (BSTR,    ClientName,         VRDE_QI_CLIENT_NAME);
    4191 IMPL_GETTER_BSTR   (BSTR,    ClientIP,           VRDE_QI_CLIENT_IP);
     4167IMPL_GETTER_UTF8STR(Utf8Str, User,               VRDE_QI_USER);
     4168IMPL_GETTER_UTF8STR(Utf8Str, Domain,             VRDE_QI_DOMAIN);
     4169IMPL_GETTER_UTF8STR(Utf8Str, ClientName,         VRDE_QI_CLIENT_NAME);
     4170IMPL_GETTER_UTF8STR(Utf8Str, ClientIP,           VRDE_QI_CLIENT_IP);
    41924171IMPL_GETTER_SCALAR (ULONG,   ClientVersion,      VRDE_QI_CLIENT_VERSION,        0);
    41934172IMPL_GETTER_SCALAR (ULONG,   EncryptionStyle,    VRDE_QI_ENCRYPTION_STYLE,      0);
    41944173
    4195 #undef IMPL_GETTER_BSTR
     4174#undef IMPL_GETTER_UTF8STR
    41964175#undef IMPL_GETTER_SCALAR
    41974176#undef IMPL_GETTER_BOOL
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