~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-01-30 23:27:25 UTC
  • mfrom: (0.3.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20110130232725-2ouajjd2ggdet0zd
Tags: 4.0.2-dfsg-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add Apport hook.
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Drop *-source packages.
* Drop ubuntu-01-fix-build-gcc45.patch, fixed upstream.
* Drop ubuntu-02-as-needed.patch, added to the Debian package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: VBoxGuestR3Lib.cpp $ */
 
1
/* $Id: VBoxGuestR3Lib.cpp 33540 2010-10-28 09:27:05Z vboxsync $ */
2
2
/** @file
3
3
 * VBoxGuestR3Lib - Ring-3 Support Library for VirtualBox guest additions, Core.
4
4
 */
81
81
#endif
82
82
/** User counter.
83
83
 * A counter of the number of times the library has been initialised, for use with
84
 
 * X.org drivers, where the library may be shared by multiple independant modules
 
84
 * X.org drivers, where the library may be shared by multiple independent modules
85
85
 * inside a single process space.
86
86
 */
87
87
static uint32_t volatile g_cInits = 0;
124
124
#if defined(RT_OS_WINDOWS)
125
125
    /*
126
126
     * Have to use CreateFile here as we want to specify FILE_FLAG_OVERLAPPED
127
 
     * and possible some other bits not availble thru iprt/file.h.
 
127
     * and possible some other bits not available thru iprt/file.h.
128
128
     */
129
129
    HANDLE hFile = CreateFile(pszDeviceName,
130
130
                              GENERIC_READ | GENERIC_WRITE,
197
197
 
198
198
#else
199
199
 
200
 
    /* The default implemenation. (linux, solaris, freebsd) */
 
200
    /* The default implementation. (linux, solaris, freebsd) */
201
201
    RTFILE File;
202
202
    int rc = RTFileOpen(&File, pszDeviceName, RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
203
203
    if (RT_FAILURE(rc))
289
289
 
290
290
 
291
291
/**
292
 
 * Internal wrapper around various OS specific ioctl implemenations.
 
292
 * Internal wrapper around various OS specific ioctl implementations.
293
293
 *
294
294
 * @returns VBox status code as returned by VBoxGuestCommonIOCtl, or
295
295
 *          an failure returned by the OS specific ioctl APIs.
309
309
    if (!DeviceIoControl(g_hFile, iFunction, pvData, (DWORD)cbData, pvData, (DWORD)cbData, &cbReturned, NULL))
310
310
    {
311
311
/** @todo The passing of error codes needs to be tested and fixed (as does *all* the other hosts except for
312
 
 * OS/2).  The idea is that the VBox status codes in ring-0 should be transfered without loss down to
 
312
 * OS/2).  The idea is that the VBox status codes in ring-0 should be transferred without loss down to
313
313
 * ring-3. However, it's not vitally important right now (obviously, since the other guys has been
314
314
 * ignoring it for 1+ years now).  On Linux and Solaris the transfer is done, but it is currently not
315
315
 * lossless, so still needs fixing. */