VirtualBox

Ignore:
Timestamp:
Aug 16, 2011 10:34:32 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
73520
Message:

VD: Interface cleanup. Merge the two involved structures (generic interface descriptor and callback table) into one, remove the duplicated interface wrappers in the backends and move the interface definitions into separate headers separating public and private interfaces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/testcase/tstVD-2.cpp

    r33567 r38469  
    7676    return VINF_SUCCESS;
    7777}
    78 
    79 
    80 VDINTERFACECONFIG icc = {
    81     sizeof(VDINTERFACECONFIG),
    82     VDINTERFACETYPE_CONFIG,
    83     tstAreKeysValid,
    84     tstQuerySize,
    85     tstQuery
    86 };
    8778
    8879static const char *tstVDDeviceType(VDTYPE enmType)
     
    194185        RTPrintf("\n");
    195186
    196         VDINTERFACE ic;
    197         ic.cbSize = sizeof(ic);
    198         ic.enmInterface = VDINTERFACETYPE_CONFIG;
    199         ic.pCallbacks = &icc;
     187        PVDINTERFACE pVDIfs = NULL;
     188        VDINTERFACECONFIG ic;
     189
     190        ic.pfnAreKeysValid = tstAreKeysValid;
     191        ic.pfnQuerySize    = tstQuerySize;
     192        ic.pfnQuery        = tstQuery;
     193
     194        rc = VDInterfaceAdd(&ic.Core, "tstVD-2_Config", VDINTERFACETYPE_CONFIG,
     195                            NULL, sizeof(VDINTERFACECONFIG), &pVDIfs);
     196        AssertRC(rc);
     197
    200198        char *pszLocation, *pszName;
    201         rc = aVDInfo[i].pfnComposeLocation(&ic, &pszLocation);
     199        rc = aVDInfo[i].pfnComposeLocation(pVDIfs, &pszLocation);
    202200        CHECK("pfnComposeLocation()");
    203201        if (pszLocation)
     
    210208            }
    211209        }
    212         rc = aVDInfo[i].pfnComposeName(&ic, &pszName);
     210        rc = aVDInfo[i].pfnComposeName(pVDIfs, &pszName);
    213211        CHECK("pfnComposeName()");
    214212        if (pszName)
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