Changeset 48840 in vbox
- Timestamp:
- Oct 3, 2013 1:56:56 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/DMG.cpp
r48839 r48840 1490 1490 1491 1491 /** @interface_method_impl{VBOXHDDBACKEND,pfnCheckIfValid} */ 1492 static intdmgCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,1493 PVDINTERFACE pVDIfsImage, VDTYPE *penmType)1492 static DECLCALLBACK(int) dmgCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk, 1493 PVDINTERFACE pVDIfsImage, VDTYPE *penmType) 1494 1494 { 1495 1495 LogFlowFunc(("pszFilename=\"%s\" pVDIfsDisk=%#p pVDIfsImage=%#p penmType=%#p\n", … … 1553 1553 1554 1554 /** @interface_method_impl{VBOXHDDBACKEND,pfnOpen} */ 1555 static intdmgOpen(const char *pszFilename, unsigned uOpenFlags,1556 PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,1557 VDTYPE enmType, void **ppBackendData)1555 static DECLCALLBACK(int) dmgOpen(const char *pszFilename, unsigned uOpenFlags, 1556 PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage, 1557 VDTYPE enmType, void **ppBackendData) 1558 1558 { 1559 1559 LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, ppBackendData)); … … 1618 1618 1619 1619 /** @interface_method_impl{VBOXHDDBACKEND,pfnCreate} */ 1620 static intdmgCreate(const char *pszFilename, uint64_t cbSize,1621 unsigned uImageFlags, const char *pszComment,1622 PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,1623 PCRTUUID pUuid, unsigned uOpenFlags,1624 unsigned uPercentStart, unsigned uPercentSpan,1625 PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,1626 PVDINTERFACE pVDIfsOperation, void **ppBackendData)1620 static DECLCALLBACK(int) dmgCreate(const char *pszFilename, uint64_t cbSize, 1621 unsigned uImageFlags, const char *pszComment, 1622 PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry, 1623 PCRTUUID pUuid, unsigned uOpenFlags, 1624 unsigned uPercentStart, unsigned uPercentSpan, 1625 PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage, 1626 PVDINTERFACE pVDIfsOperation, void **ppBackendData) 1627 1627 { 1628 1628 LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p ppBackendData=%#p", pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, ppBackendData)); … … 1644 1644 1645 1645 /** @interface_method_impl{VBOXHDDBACKEND,pfnClose} */ 1646 static intdmgClose(void *pBackendData, bool fDelete)1646 static DECLCALLBACK(int) dmgClose(void *pBackendData, bool fDelete) 1647 1647 { 1648 1648 LogFlowFunc(("pBackendData=%#p fDelete=%d\n", pBackendData, fDelete)); 1649 1649 PDMGIMAGE pThis = (PDMGIMAGE)pBackendData; 1650 int rc; 1651 1652 rc = dmgFreeImage(pThis, fDelete); 1650 1651 int rc = dmgFreeImage(pThis, fDelete); 1653 1652 RTMemFree(pThis); 1654 1653 … … 1658 1657 1659 1658 /** @interface_method_impl{VBOXHDDBACKEND,pfnRead} */ 1660 static intdmgRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,1661 PVDIOCTX pIoCtx, size_t *pcbActuallyRead)1659 static DECLCALLBACK(int) dmgRead(void *pBackendData, uint64_t uOffset, size_t cbToRead, 1660 PVDIOCTX pIoCtx, size_t *pcbActuallyRead) 1662 1661 { 1663 1662 LogFlowFunc(("pBackendData=%#p uOffset=%llu pIoCtx=%#p cbToRead=%zu pcbActuallyRead=%#p\n", … … 1674 1673 || cbToRead == 0) 1675 1674 { 1676 rc = VERR_INVALID_PARAMETER;1677 goto out;1675 LogFlowFunc(("returns VERR_INVALID_PARAMETER\n")); 1676 return VERR_INVALID_PARAMETER; 1678 1677 } 1679 1678 … … 1743 1742 rc = VERR_INVALID_PARAMETER; 1744 1743 1745 out:1746 1744 LogFlowFunc(("returns %Rrc\n", rc)); 1747 1745 return rc; … … 1749 1747 1750 1748 /** @interface_method_impl{VBOXHDDBACKEND,pfnWrite} */ 1751 static intdmgWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,1752 PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead,1753 size_t *pcbPostRead, unsigned fWrite)1749 static DECLCALLBACK(int) dmgWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite, 1750 PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead, 1751 size_t *pcbPostRead, unsigned fWrite) 1754 1752 { 1755 1753 LogFlowFunc(("pBackendData=%#p uOffset=%llu pIoCtx=%#p cbToWrite=%zu pcbWriteProcess=%#p pcbPreRead=%#p pcbPostRead=%#p\n", … … 1762 1760 Assert(cbToWrite % 512 == 0); 1763 1761 1764 if (pThis->uOpenFlags & VD_OPEN_FLAGS_READONLY) 1765 { 1762 if (!(pThis->uOpenFlags & VD_OPEN_FLAGS_READONLY)) 1763 AssertMsgFailed(("Not implemented\n")); 1764 else 1766 1765 rc = VERR_VD_IMAGE_READ_ONLY; 1767 goto out; 1768 } 1769 1770 AssertMsgFailed(("Not implemented\n")); 1771 1772 out: 1766 1773 1767 LogFlowFunc(("returns %Rrc\n", rc)); 1774 1768 return rc; … … 1776 1770 1777 1771 /** @interface_method_impl{VBOXHDDBACKEND,pfnFlush} */ 1778 static intdmgFlush(void *pBackendData, PVDIOCTX pIoCtx)1772 static DECLCALLBACK(int) dmgFlush(void *pBackendData, PVDIOCTX pIoCtx) 1779 1773 { 1780 1774 LogFlowFunc(("pBackendData=%#p\n", pBackendData)); … … 1791 1785 1792 1786 /** @interface_method_impl{VBOXHDDBACKEND,pfnGetVersion} */ 1793 static unsigneddmgGetVersion(void *pBackendData)1787 static DECLCALLBACK(unsigned) dmgGetVersion(void *pBackendData) 1794 1788 { 1795 1789 LogFlowFunc(("pBackendData=%#p\n", pBackendData)); … … 1805 1799 1806 1800 /** @interface_method_impl{VBOXHDDBACKEND,pfnGetSectorSize} */ 1807 static uint32_tdmgGetSectorSize(void *pBackendData)1801 static DECLCALLBACK(uint32_t) dmgGetSectorSize(void *pBackendData) 1808 1802 { 1809 1803 LogFlowFunc(("pBackendData=%#p\n", pBackendData)); … … 1821 1815 1822 1816 /** @interface_method_impl{VBOXHDDBACKEND,pfnGetSize} */ 1823 static uint64_tdmgGetSize(void *pBackendData)1817 static DECLCALLBACK(uint64_t) dmgGetSize(void *pBackendData) 1824 1818 { 1825 1819 LogFlowFunc(("pBackendData=%#p\n", pBackendData)); … … 1837 1831 1838 1832 /** @interface_method_impl{VBOXHDDBACKEND,pfnGetFileSize} */ 1839 static uint64_tdmgGetFileSize(void *pBackendData)1833 static DECLCALLBACK(uint64_t) dmgGetFileSize(void *pBackendData) 1840 1834 { 1841 1835 LogFlowFunc(("pBackendData=%#p\n", pBackendData)); … … 1861 1855 1862 1856 /** @interface_method_impl{VBOXHDDBACKEND,pfnGetPCHSGeometry} */ 1863 static intdmgGetPCHSGeometry(void *pBackendData, PVDGEOMETRY pPCHSGeometry)1857 static DECLCALLBACK(int) dmgGetPCHSGeometry(void *pBackendData, PVDGEOMETRY pPCHSGeometry) 1864 1858 { 1865 1859 LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p\n", pBackendData, pPCHSGeometry)); … … 1887 1881 1888 1882 /** @interface_method_impl{VBOXHDDBACKEND,pfnSetPCHSGeometry} */ 1889 static intdmgSetPCHSGeometry(void *pBackendData, PCVDGEOMETRY pPCHSGeometry)1883 static DECLCALLBACK(int) dmgSetPCHSGeometry(void *pBackendData, PCVDGEOMETRY pPCHSGeometry) 1890 1884 { 1891 1885 LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p PCHS=%u/%u/%u\n", … … 1898 1892 if (pThis) 1899 1893 { 1900 if (pThis->uOpenFlags & VD_OPEN_FLAGS_READONLY) 1901 { 1894 if (!(pThis->uOpenFlags & VD_OPEN_FLAGS_READONLY)) 1895 { 1896 pThis->PCHSGeometry = *pPCHSGeometry; 1897 rc = VINF_SUCCESS; 1898 } 1899 else 1902 1900 rc = VERR_VD_IMAGE_READ_ONLY; 1903 goto out;1904 }1905 1906 pThis->PCHSGeometry = *pPCHSGeometry;1907 rc = VINF_SUCCESS;1908 1901 } 1909 1902 else 1910 1903 rc = VERR_VD_NOT_OPENED; 1911 1904 1912 out:1913 1905 LogFlowFunc(("returns %Rrc\n", rc)); 1914 1906 return rc; … … 1916 1908 1917 1909 /** @interface_method_impl{VBOXHDDBACKEND,pfnGetLCHSGeometry} */ 1918 static intdmgGetLCHSGeometry(void *pBackendData, PVDGEOMETRY pLCHSGeometry)1910 static DECLCALLBACK(int) dmgGetLCHSGeometry(void *pBackendData, PVDGEOMETRY pLCHSGeometry) 1919 1911 { 1920 1912 LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p\n", pBackendData, pLCHSGeometry)); … … 1942 1934 1943 1935 /** @interface_method_impl{VBOXHDDBACKEND,pfnSetLCHSGeometry} */ 1944 static intdmgSetLCHSGeometry(void *pBackendData, PCVDGEOMETRY pLCHSGeometry)1936 static DECLCALLBACK(int) dmgSetLCHSGeometry(void *pBackendData, PCVDGEOMETRY pLCHSGeometry) 1945 1937 { 1946 1938 LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p LCHS=%u/%u/%u\n", … … 1953 1945 if (pThis) 1954 1946 { 1955 if (pThis->uOpenFlags & VD_OPEN_FLAGS_READONLY) 1956 { 1947 if (!(pThis->uOpenFlags & VD_OPEN_FLAGS_READONLY)) 1948 { 1949 pThis->LCHSGeometry = *pLCHSGeometry; 1950 rc = VINF_SUCCESS; 1951 } 1952 else 1957 1953 rc = VERR_VD_IMAGE_READ_ONLY; 1958 goto out;1959 }1960 1961 pThis->LCHSGeometry = *pLCHSGeometry;1962 rc = VINF_SUCCESS;1963 1954 } 1964 1955 else 1965 1956 rc = VERR_VD_NOT_OPENED; 1966 1957 1967 out:1968 1958 LogFlowFunc(("returns %Rrc\n", rc)); 1969 1959 return rc; … … 1971 1961 1972 1962 /** @interface_method_impl{VBOXHDDBACKEND,pfnGetImageFlags} */ 1973 static unsigneddmgGetImageFlags(void *pBackendData)1963 static DECLCALLBACK(unsigned) dmgGetImageFlags(void *pBackendData) 1974 1964 { 1975 1965 LogFlowFunc(("pBackendData=%#p\n", pBackendData)); … … 1989 1979 1990 1980 /** @interface_method_impl{VBOXHDDBACKEND,pfnGetOpenFlags} */ 1991 static unsigneddmgGetOpenFlags(void *pBackendData)1981 static DECLCALLBACK(unsigned) dmgGetOpenFlags(void *pBackendData) 1992 1982 { 1993 1983 LogFlowFunc(("pBackendData=%#p\n", pBackendData)); … … 2007 1997 2008 1998 /** @interface_method_impl{VBOXHDDBACKEND,pfnSetOpenFlags} */ 2009 static intdmgSetOpenFlags(void *pBackendData, unsigned uOpenFlags)1999 static DECLCALLBACK(int) dmgSetOpenFlags(void *pBackendData, unsigned uOpenFlags) 2010 2000 { 2011 2001 LogFlowFunc(("pBackendData=%#p\n uOpenFlags=%#x", pBackendData, uOpenFlags)); … … 2034 2024 2035 2025 /** @interface_method_impl{VBOXHDDBACKEND,pfnGetComment} */ 2036 static int dmgGetComment(void *pBackendData, char *pszComment, 2037 size_t cbComment) 2026 static DECLCALLBACK(int) dmgGetComment(void *pBackendData, char *pszComment, size_t cbComment) 2038 2027 { 2039 2028 LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment)); … … 2053 2042 2054 2043 /** @interface_method_impl{VBOXHDDBACKEND,pfnSetComment} */ 2055 static intdmgSetComment(void *pBackendData, const char *pszComment)2044 static DECLCALLBACK(int) dmgSetComment(void *pBackendData, const char *pszComment) 2056 2045 { 2057 2046 LogFlowFunc(("pBackendData=%#p pszComment=\"%s\"\n", pBackendData, pszComment)); … … 2076 2065 2077 2066 /** @interface_method_impl{VBOXHDDBACKEND,pfnGetUuid} */ 2078 static intdmgGetUuid(void *pBackendData, PRTUUID pUuid)2067 static DECLCALLBACK(int) dmgGetUuid(void *pBackendData, PRTUUID pUuid) 2079 2068 { 2080 2069 LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid)); … … 2094 2083 2095 2084 /** @interface_method_impl{VBOXHDDBACKEND,pfnSetUuid} */ 2096 static intdmgSetUuid(void *pBackendData, PCRTUUID pUuid)2085 static DECLCALLBACK(int) dmgSetUuid(void *pBackendData, PCRTUUID pUuid) 2097 2086 { 2098 2087 LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid)); … … 2118 2107 2119 2108 /** @interface_method_impl{VBOXHDDBACKEND,pfnGetModificationUuid} */ 2120 static intdmgGetModificationUuid(void *pBackendData, PRTUUID pUuid)2109 static DECLCALLBACK(int) dmgGetModificationUuid(void *pBackendData, PRTUUID pUuid) 2121 2110 { 2122 2111 LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid)); … … 2136 2125 2137 2126 /** @interface_method_impl{VBOXHDDBACKEND,pfnSetModificationUuid} */ 2138 static intdmgSetModificationUuid(void *pBackendData, PCRTUUID pUuid)2127 static DECLCALLBACK(int) dmgSetModificationUuid(void *pBackendData, PCRTUUID pUuid) 2139 2128 { 2140 2129 LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid)); … … 2159 2148 2160 2149 /** @interface_method_impl{VBOXHDDBACKEND,pfnGetParentUuid} */ 2161 static intdmgGetParentUuid(void *pBackendData, PRTUUID pUuid)2150 static DECLCALLBACK(int) dmgGetParentUuid(void *pBackendData, PRTUUID pUuid) 2162 2151 { 2163 2152 LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid)); … … 2177 2166 2178 2167 /** @interface_method_impl{VBOXHDDBACKEND,pfnSetParentUuid} */ 2179 static intdmgSetParentUuid(void *pBackendData, PCRTUUID pUuid)2168 static DECLCALLBACK(int) dmgSetParentUuid(void *pBackendData, PCRTUUID pUuid) 2180 2169 { 2181 2170 LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid)); … … 2200 2189 2201 2190 /** @interface_method_impl{VBOXHDDBACKEND,pfnGetParentModificationUuid} */ 2202 static intdmgGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)2191 static DECLCALLBACK(int) dmgGetParentModificationUuid(void *pBackendData, PRTUUID pUuid) 2203 2192 { 2204 2193 LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid)); … … 2218 2207 2219 2208 /** @interface_method_impl{VBOXHDDBACKEND,pfnSetParentModificationUuid} */ 2220 static intdmgSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)2209 static DECLCALLBACK(int) dmgSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid) 2221 2210 { 2222 2211 LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid)); … … 2241 2230 2242 2231 /** @interface_method_impl{VBOXHDDBACKEND,pfnDump} */ 2243 static voiddmgDump(void *pBackendData)2232 static DECLCALLBACK(void) dmgDump(void *pBackendData) 2244 2233 { 2245 2234 PDMGIMAGE pThis = (PDMGIMAGE)pBackendData;
Note:
See TracChangeset
for help on using the changeset viewer.