Changeset 63910 in vbox
- Timestamp:
- Sep 20, 2016 10:14:30 AM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 110788
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Samples/DevPlayground.cpp
r63884 r63910 54 54 * Device Functions * 55 55 *********************************************************************************************************************************/ 56 /**57 * @interface_method_impl{PDMDEVREG,pfnDestruct}58 */59 static DECLCALLBACK(int) devPlaygroundDestruct(PPDMDEVINS pDevIns)60 {61 /*62 * Check the versions here as well since the destructor is *always* called.63 */64 AssertMsgReturn(pDevIns->u32Version == PDM_DEVINS_VERSION, ("%#x, expected %#x\n", pDevIns->u32Version, PDM_DEVINS_VERSION), VERR_VERSION_MISMATCH);65 AssertMsgReturn(pDevIns->pHlpR3->u32Version == PDM_DEVHLPR3_VERSION, ("%#x, expected %#x\n", pDevIns->pHlpR3->u32Version, PDM_DEVHLPR3_VERSION), VERR_VERSION_MISMATCH);66 67 return VINF_SUCCESS;68 }69 70 56 71 57 PDMBOTHCBDECL(int) devPlaygroundMMIORead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void *pv, unsigned cb) … … 122 108 123 109 /** 110 * @interface_method_impl{PDMDEVREG,pfnDestruct} 111 */ 112 static DECLCALLBACK(int) devPlaygroundDestruct(PPDMDEVINS pDevIns) 113 { 114 /* 115 * Check the versions here as well since the destructor is *always* called. 116 */ 117 PDMDEV_CHECK_VERSIONS_RETURN_QUIET(pDevIns); 118 119 return VINF_SUCCESS; 120 } 121 122 123 /** 124 124 * @interface_method_impl{PDMDEVREG,pfnConstruct} 125 125 */ 126 126 static DECLCALLBACK(int) devPlaygroundConstruct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfg) 127 127 { 128 NOREF(iInstance);128 RT_NOREF(iInstance, pCfg); 129 129 130 130 /* 131 131 * Check that the device instance and device helper structures are compatible. 132 132 */ 133 AssertLogRelMsgReturn(pDevIns->u32Version == PDM_DEVINS_VERSION, ("%#x, expected %#x\n", pDevIns->u32Version, PDM_DEVINS_VERSION), VERR_VERSION_MISMATCH); 134 AssertLogRelMsgReturn(pDevIns->pHlpR3->u32Version == PDM_DEVHLPR3_VERSION, ("%#x, expected %#x\n", pDevIns->pHlpR3->u32Version, PDM_DEVHLPR3_VERSION), VERR_VERSION_MISMATCH); 133 PDMDEV_CHECK_VERSIONS_RETURN(pDevIns); 135 134 136 135 /* … … 146 145 * Validate and read the configuration. 147 146 */ 148 if (!CFGMR3AreValuesValid(pCfg, 149 "Whatever1\0" 150 "Whatever2\0")) 151 return VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES; 147 PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "Whatever1|Whatever2", ""); 152 148 153 149 /*
Note:
See TracChangeset
for help on using the changeset viewer.