VirtualBox

Changeset 55327 in vbox


Ignore:
Timestamp:
Apr 17, 2015 12:24:58 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
99650
Message:

Backed out r99649; doesn't work in guest contexts, d'oh.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/hgcmsvc.h

    r55326 r55327  
    44
    55/*
    6  * Copyright (C) 2006-2015 Oracle Corporation
     6 * Copyright (C) 2006-2011 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2828
    2929#include <iprt/assert.h>
    30 #include <iprt/mem.h>
    3130#include <iprt/string.h>
    3231#include <VBox/cdefs.h>
     
    8988
    9089#define VBOX_HGCM_SVC_PARM_INVALID (0U)
    91 #define VBOX_HGCM_SVC_PARM_32BIT   (1U)
    92 #define VBOX_HGCM_SVC_PARM_64BIT   (2U)
    93 #define VBOX_HGCM_SVC_PARM_PTR     (3U)
     90#define VBOX_HGCM_SVC_PARM_32BIT (1U)
     91#define VBOX_HGCM_SVC_PARM_64BIT (2U)
     92#define VBOX_HGCM_SVC_PARM_PTR   (3U)
    9493
    9594typedef struct VBOXHGCMSVCPARM
     
    110109#ifdef __cplusplus
    111110    /** Extract a uint32_t value from an HGCM parameter structure */
    112     int getUInt32(uint32_t *u32)
     111    int getUInt32 (uint32_t *u32)
    113112    {
    114113        AssertPtrReturn(u32, VERR_INVALID_POINTER);
     
    122121
    123122    /** Extract a uint64_t value from an HGCM parameter structure */
    124     int getUInt64(uint64_t *u64)
     123    int getUInt64 (uint64_t *u64)
    125124    {
    126125        AssertPtrReturn(u64, VERR_INVALID_POINTER);
     
    134133
    135134    /** Extract a pointer value from an HGCM parameter structure */
    136     int getPointer(void **ppv, uint32_t *pcb)
     135    int getPointer (void **ppv, uint32_t *pcb)
    137136    {
    138137        AssertPtrReturn(ppv, VERR_INVALID_POINTER);
     
    149148
    150149    /** Extract a constant pointer value from an HGCM parameter structure */
    151     int getPointer(const void **ppcv, uint32_t *pcb)
     150    int getPointer (const void **ppcv, uint32_t *pcb)
    152151    {
    153152        AssertPtrReturn(ppcv, VERR_INVALID_POINTER);
     
    161160    /** Extract a pointer value to a non-empty buffer from an HGCM parameter
    162161     * structure */
    163     int getBuffer(void **ppv, uint32_t *pcb)
     162    int getBuffer (void **ppv, uint32_t *pcb)
    164163    {
    165164        AssertPtrReturn(ppv, VERR_INVALID_POINTER);
     
    182181    /** Extract a pointer value to a non-empty constant buffer from an HGCM
    183182     * parameter structure */
    184     int getBuffer(const void **ppcv, uint32_t *pcb)
     183    int getBuffer (const void **ppcv, uint32_t *pcb)
    185184    {
    186185        AssertPtrReturn(ppcv, VERR_INVALID_POINTER);
     
    193192
    194193    /** Extract a string value from an HGCM parameter structure */
    195     int getString(char **ppch, uint32_t *pcb)
     194    int getString (char **ppch, uint32_t *pcb)
    196195    {
    197196        uint32_t cb = 0;
     
    212211
    213212    /** Extract a constant string value from an HGCM parameter structure */
    214     int getString(const char **ppch, uint32_t *pcb)
     213    int getString (const char **ppch, uint32_t *pcb)
    215214    {
    216215        char *pch = NULL;
     
    235234
    236235    /** Set a pointer value to an HGCM parameter structure */
    237     int setPointer(void *pv, uint32_t cb, bool fDeepCopy = false)
     236    void setPointer(void *pv, uint32_t cb)
    238237    {
    239238        type = VBOX_HGCM_SVC_PARM_PTR;
    240         void *addr = fDeepCopy ? RTMemDup(pv, cb) : pv;
    241         if (fDeepCopy && !addr)
    242             return VERR_NO_MEMORY;
    243         u.pointer.addr = addr;
     239        u.pointer.addr = pv;
    244240        u.pointer.size = cb;
    245241    }
    246242
    247243    /** Set a const string value to an HGCM parameter structure */
    248     int setString(const char *psz, bool fDeepCopy = false)
     244    void setString(const char *psz)
    249245    {
    250246        type = VBOX_HGCM_SVC_PARM_PTR;
    251         void *pszaddr = fDeepCopy ? (void *)RTStrDup(psz) : (void *)psz;
    252         if (fDeepCopy && !pszaddr)
    253             return VERR_NO_MEMORY;
    254         u.pointer.addr = pszaddr;
    255         u.pointer.size = (uint32_t)strlen((char *)pszaddr) + 1;
     247        u.pointer.addr = (void *)psz;
     248        u.pointer.size = (uint32_t)strlen(psz) + 1;
    256249    }
    257250
     
    320313
    321314    VBOXHGCMSVCPARM() : type(VBOX_HGCM_SVC_PARM_INVALID) {}
    322 #endif /* __cplusplus */
     315#endif
    323316} VBOXHGCMSVCPARM;
    324317
Note: See TracChangeset for help on using the changeset viewer.

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