All pastes #991799 Raw Edit

Something

public text v1 · immutable
#991799 ·published 2008-04-21 11:49 UTC
rendered paste body
int dotest(const char *pszFromFilename, const char *pszFromBackend,
           const char *pszToFilename, const char *pszToBackend)
{
    PVBOXHDD pDiskFrom = NULL;
    PVBOXHDD pDiskTo = NULL;
    int rc = VINF_SUCCESS;

#define CHECK(str) \
    do \
    { \
        RTPrintf("%s rc=%Vrc\n", str, rc); \
        if (VBOX_FAILURE(rc)) \
        { \
            VDCloseAll(pDiskFrom); \
            VDCloseAll(pDiskTo); \
            return rc; \
        } \
    } while (0)

    rc = VDCreate(VDErrorCallback, NULL, &pDiskFrom);
    CHECK("VDCreate()");

    PDMMEDIAGEOMETRY PCHSGeometry = {10, 10, 10};
    PDMMEDIAGEOMETRY LCHSGeometry = {10, 10, 10};

    rc = VDCreateBase(pDiskFrom, pszFromBackend, pszFromFilename, VD_IMAGE_TYPE_NORMAL,
                      (1000 * 1024 * 1024ULL), VD_IMAGE_FLAGS_NONE,
                      "Test image", &PCHSGeometry, &LCHSGeometry,
                      VD_OPEN_FLAGS_NORMAL, NULL, NULL);
    CHECK("VDCreateBase()");

....