Changeset 39855 in vbox
- Timestamp:
- Jan 24, 2012 4:40:14 PM (13 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Serial/DrvNamedPipe.cpp
r35353 r39855 51 51 /** Converts a pointer to DRVNAMEDPIPE::IMedia to a PDRVNAMEDPIPE. */ 52 52 #define PDMISTREAM_2_DRVNAMEDPIPE(pInterface) ( (PDRVNAMEDPIPE)((uintptr_t)pInterface - RT_OFFSETOF(DRVNAMEDPIPE, IStream)) ) 53 54 /** Converts a pointer to PDMDRVINS::IBase to a PPDMDRVINS. */55 #define PDMIBASE_2_DRVINS(pInterface) ( (PPDMDRVINS)((uintptr_t)pInterface - RT_OFFSETOF(PDMDRVINS, IBase)) )56 53 57 54 … … 286 283 static DECLCALLBACK(void *) drvNamedPipeQueryInterface(PPDMIBASE pInterface, const char *pszIID) 287 284 { 288 PPDMDRVINS pDrvIns = PDMIBASE_2_ DRVINS(pInterface);285 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface); 289 286 PDRVNAMEDPIPE pThis = PDMINS_2_DATA(pDrvIns, PDRVNAMEDPIPE); 290 287 PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase); -
trunk/src/VBox/Devices/Serial/DrvRawFile.cpp
r37596 r39855 39 39 #define PDMISTREAM_2_DRVRAWFILE(pInterface) ( (PDRVRAWFILE)((uintptr_t)pInterface - RT_OFFSETOF(DRVRAWFILE, IStream)) ) 40 40 41 /** Converts a pointer to PDMDRVINS::IBase to a PPDMDRVINS. */42 #define PDMIBASE_2_DRVINS(pInterface) ( (PPDMDRVINS)((uintptr_t)pInterface - RT_OFFSETOF(PDMDRVINS, IBase)) )43 44 41 45 42 /******************************************************************************* … … 98 95 static DECLCALLBACK(void *) drvRawFileQueryInterface(PPDMIBASE pInterface, const char *pszIID) 99 96 { 100 PPDMDRVINS pDrvIns = PDMIBASE_2_ DRVINS(pInterface);97 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface); 101 98 PDRVRAWFILE pThis = PDMINS_2_DATA(pDrvIns, PDRVRAWFILE); 102 99 -
trunk/src/VBox/Devices/Storage/DrvMediaISO.cpp
r37596 r39855 34 34 /** Converts a pointer to MEDIAISO::IMedia to a PRDVMEDIAISO. */ 35 35 #define PDMIMEDIA_2_DRVMEDIAISO(pInterface) ( (PDRVMEDIAISO)((uintptr_t)pInterface - RT_OFFSETOF(DRVMEDIAISO, IMedia)) ) 36 37 /** Converts a pointer to PDMDRVINS::IBase to a PPDMDRVINS. */38 #define PDMIBASE_2_DRVINS(pInterface) ( (PPDMDRVINS)((uintptr_t)pInterface - RT_OFFSETOF(PDMDRVINS, IBase)) )39 40 /** Converts a pointer to PDMDRVINS::IBase to a PVBOXHDD. */41 #define PDMIBASE_2_DRVMEDIAISO(pInterface) ( PDMINS_2_DATA(PDMIBASE_2_DRVINS(pInterface), PDRVMEDIAISO) )42 43 36 44 37 … … 181 174 static DECLCALLBACK(void *) drvMediaISOQueryInterface(PPDMIBASE pInterface, const char *pszIID) 182 175 { 183 PPDMDRVINS pDrvIns = PDMIBASE_2_ DRVINS(pInterface);176 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface); 184 177 PDRVMEDIAISO pThis = PDMINS_2_DATA(pDrvIns, PDRVMEDIAISO); 185 178 PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase); -
trunk/src/VBox/Devices/Storage/DrvRawImage.cpp
r37596 r39855 28 28 29 29 #include "VBoxDD.h" 30 31 32 /*******************************************************************************33 * Defined Constants And Macros *34 *******************************************************************************/35 /** Converts a pointer to RAWIMAGE::IMedia to a PRDVRAWIMAGE. */36 #define PDMIMEDIA_2_DRVRAWIMAGE(pInterface) ( (PDRVRAWIMAGE)((uintptr_t)pInterface - RT_OFFSETOF(DRVRAWIMAGE, IMedia)) )37 38 /** Converts a pointer to PDMDRVINS::IBase to a PPDMDRVINS. */39 #define PDMIBASE_2_DRVINS(pInterface) ( (PPDMDRVINS)((uintptr_t)pInterface - RT_OFFSETOF(PDMDRVINS, IBase)) )40 41 /** Converts a pointer to PDMDRVINS::IBase to a PVBOXHDD. */42 #define PDMIBASE_2_DRVRAWIMAGE(pInterface) ( PDMINS_2_DATA(PDMIBASE_2_DRVINS(pInterface), PDRVRAWIMAGE) )43 44 30 45 31 … … 73 59 static DECLCALLBACK(uint64_t) drvRawImageGetSize(PPDMIMEDIA pInterface) 74 60 { 75 PDRVRAWIMAGE pThis = PDMIMEDIA_2_DRVRAWIMAGE(pInterface);61 PDRVRAWIMAGE pThis = RT_FROM_MEMBER(pInterface, DRVRAWIMAGE, IMedia); 76 62 LogFlow(("drvRawImageGetSize: '%s'\n", pThis->pszFilename)); 77 63 … … 124 110 static DECLCALLBACK(int) drvRawImageRead(PPDMIMEDIA pInterface, uint64_t off, void *pvBuf, size_t cbRead) 125 111 { 126 PDRVRAWIMAGE pThis = PDMIMEDIA_2_DRVRAWIMAGE(pInterface);112 PDRVRAWIMAGE pThis = RT_FROM_MEMBER(pInterface, DRVRAWIMAGE, IMedia); 127 113 LogFlow(("drvRawImageRead: off=%#llx pvBuf=%p cbRead=%#x (%s)\n", off, pvBuf, cbRead, pThis->pszFilename)); 128 114 … … 158 144 static DECLCALLBACK(int) drvRawImageWrite(PPDMIMEDIA pInterface, uint64_t off, const void *pvBuf, size_t cbWrite) 159 145 { 160 PDRVRAWIMAGE pThis = PDMIMEDIA_2_DRVRAWIMAGE(pInterface);146 PDRVRAWIMAGE pThis = RT_FROM_MEMBER(pInterface, DRVRAWIMAGE, IMedia); 161 147 LogFlow(("drvRawImageWrite: off=%#llx pvBuf=%p cbWrite=%#x (%s)\n", off, pvBuf, cbWrite, pThis->pszFilename)); 162 148 … … 192 178 static DECLCALLBACK(int) drvRawImageFlush(PPDMIMEDIA pInterface) 193 179 { 194 PDRVRAWIMAGE pThis = PDMIMEDIA_2_DRVRAWIMAGE(pInterface);180 PDRVRAWIMAGE pThis = RT_FROM_MEMBER(pInterface, DRVRAWIMAGE, IMedia); 195 181 LogFlow(("drvRawImageFlush: (%s)\n", pThis->pszFilename)); 196 182 … … 213 199 static DECLCALLBACK(bool) drvRawImageIsReadOnly(PPDMIMEDIA pInterface) 214 200 { 215 PDRVRAWIMAGE pThis = PDMIMEDIA_2_DRVRAWIMAGE(pInterface);201 PDRVRAWIMAGE pThis = RT_FROM_MEMBER(pInterface, DRVRAWIMAGE, IMedia); 216 202 return pThis->fReadOnly; 217 203 } … … 225 211 static DECLCALLBACK(void *) drvRawImageQueryInterface(PPDMIBASE pInterface, const char *pszIID) 226 212 { 227 PPDMDRVINS pDrvIns = PDMIBASE_2_ DRVINS(pInterface);213 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface); 228 214 PDRVRAWIMAGE pThis = PDMINS_2_DATA(pDrvIns, PDRVRAWIMAGE); 229 215 -
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r39414 r39855 62 62 #define PDMIMEDIA_2_VBOXDISK(pInterface) \ 63 63 ( (PVBOXDISK)((uintptr_t)pInterface - RT_OFFSETOF(VBOXDISK, IMedia)) ) 64 65 /** Converts a pointer to PDMDRVINS::IBase to a PPDMDRVINS. */66 #define PDMIBASE_2_DRVINS(pInterface) \67 ( (PPDMDRVINS)((uintptr_t)pInterface - RT_OFFSETOF(PDMDRVINS, IBase)) )68 69 /** Converts a pointer to PDMDRVINS::IBase to a PVBOXDISK. */70 #define PDMIBASE_2_VBOXDISK(pInterface) \71 ( PDMINS_2_DATA(PDMIBASE_2_DRVINS(pInterface), PVBOXDISK) )72 64 73 65 /** Converts a pointer to VBOXDISK::IMediaAsync to a PVBOXDISK. */ … … 1873 1865 static DECLCALLBACK(void *) drvvdQueryInterface(PPDMIBASE pInterface, const char *pszIID) 1874 1866 { 1875 PPDMDRVINS pDrvIns = PDMIBASE_2_ DRVINS(pInterface);1867 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface); 1876 1868 PVBOXDISK pThis = PDMINS_2_DATA(pDrvIns, PVBOXDISK); 1877 1869
Note:
See TracChangeset
for help on using the changeset viewer.