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

« back to all changes in this revision

Viewing changes to src/VBox/Runtime/testcase/tstLdr-4.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: tstLdr-4.cpp $ */
 
1
/* $Id: tstLdr-4.cpp 33269 2010-10-20 15:42:28Z vboxsync $ */
2
2
/** @file
3
3
 * IPRT - Testcase for RTLdrOpen using ldrLdrObjR0.r0.
4
4
 */
98
98
    {
99
99
        RTLDRMOD    hLdrMod;
100
100
        void       *pvBits;
 
101
        size_t      cbBits;
101
102
        const char *pszName;
102
103
    }   aLoads[6] =
103
104
    {
104
 
        { NULL, NULL, "foo" },
105
 
        { NULL, NULL, "bar" },
106
 
        { NULL, NULL, "foobar" },
107
 
        { NULL, NULL, "kLdr-foo" },
108
 
        { NULL, NULL, "kLdr-bar" },
109
 
        { NULL, NULL, "kLdr-foobar" }
 
105
        { NULL, NULL, 0, "foo" },
 
106
        { NULL, NULL, 0, "bar" },
 
107
        { NULL, NULL, 0, "foobar" },
 
108
        { NULL, NULL, 0, "kLdr-foo" },
 
109
        { NULL, NULL, 0, "kLdr-bar" },
 
110
        { NULL, NULL, 0, "kLdr-foobar" }
110
111
    };
111
112
    unsigned i;
112
113
    int rc;
136
137
            cErrors++;
137
138
            break;
138
139
        }
139
 
        cbImage = cb;
 
140
        aLoads[i].cbBits = cbImage = cb;
140
141
 
141
142
        /* Allocate bits. */
142
143
        aLoads[i].pvBits = RTMemExecAlloc(cb);
195
196
    for (i = 0; i < RT_ELEMENTS(aLoads); i++)
196
197
    {
197
198
        if (aLoads[i].pvBits)
198
 
            RTMemExecFree(aLoads[i].pvBits);
 
199
            RTMemExecFree(aLoads[i].pvBits, aLoads[i].cbBits);
199
200
        if (aLoads[i].hLdrMod)
200
201
        {
201
202
            rc = RTLdrClose(aLoads[i].hLdrMod);