Changeset 54666 in vbox
- Timestamp:
- Mar 6, 2015 1:44:04 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
r54664 r54666 1115 1115 if (cbInput < cbBuf) 1116 1116 RtlZeroMemory((uint8_t *)pHdr + cbInput, cbBuf - cbInput); 1117 rcNt = STATUS_SUCCESS; 1117 if (!memcmp(pHdr, &Hdr, sizeof(Hdr))) 1118 rcNt = STATUS_SUCCESS; 1119 else 1120 rcNt = STATUS_INVALID_PARAMETER; 1118 1121 } 1119 1122 __except(EXCEPTION_EXECUTE_HANDLER) … … 1121 1124 rcNt = GetExceptionCode(); 1122 1125 } 1126 if (NT_SUCCESS(rcNt)) 1127 { 1128 /* 1129 * Now call the common code to do the real work. 1130 */ 1131 rc = supdrvIOCtl(uCmd, pDevExt, pSession, pHdr, cbBuf); 1132 if (RT_SUCCESS(rc)) 1133 { 1134 /* 1135 * Copy back the result. 1136 */ 1137 cbOut = pHdr->cbOut; 1138 if (cbOut > cbOutput) 1139 { 1140 cbOut = cbOutput; 1141 OSDBGPRINT(("VBoxDrvNtFastIoDeviceControl: too much output! %#x > %#x; uCmd=%#x!\n", 1142 pHdr->cbOut, cbOut, uCmd)); 1143 } 1144 if (cbOut) 1145 { 1146 __try 1147 { 1148 RtlCopyMemory(pvOutput, pHdr, cbOut); 1149 rcNt = STATUS_SUCCESS; 1150 } 1151 __except(EXCEPTION_EXECUTE_HANDLER) 1152 { 1153 rcNt = GetExceptionCode(); 1154 } 1155 } 1156 else 1157 rcNt = STATUS_SUCCESS; 1158 } 1159 else if (rc == VERR_INVALID_PARAMETER) 1160 rcNt = STATUS_INVALID_PARAMETER; 1161 else 1162 rcNt = STATUS_NOT_SUPPORTED; 1163 Log2(("VBoxDrvNtFastIoDeviceControl: returns %#x cbOut=%d rc=%#x\n", rcNt, cbOut, rc)); 1164 } 1165 else 1166 Log(("VBoxDrvNtFastIoDeviceControl: Error reading %u bytes of user memory at %p (uCmd=%#x)\n", 1167 cbInput, pvInput, uCmd)); 1168 ExFreePoolWithTag(pHdr, 'VBox'); 1123 1169 } 1124 1170 else 1125 1171 rcNt = STATUS_NO_MEMORY; 1126 if (NT_SUCCESS(rcNt))1127 {1128 /*1129 * Now call the common code to do the real work.1130 */1131 rc = supdrvIOCtl(uCmd, pDevExt, pSession, pHdr, cbBuf);1132 if (RT_SUCCESS(rc))1133 {1134 /*1135 * Copy back the result.1136 */1137 cbOut = pHdr->cbOut;1138 if (cbOut > cbOutput)1139 {1140 cbOut = cbOutput;1141 OSDBGPRINT(("VBoxDrvNtFastIoDeviceControl: too much output! %#x > %#x; uCmd=%#x!\n",1142 pHdr->cbOut, cbOut, uCmd));1143 }1144 if (cbOut)1145 {1146 __try1147 {1148 RtlCopyMemory(pvOutput, pHdr, cbOut);1149 rcNt = STATUS_SUCCESS;1150 }1151 __except(EXCEPTION_EXECUTE_HANDLER)1152 {1153 rcNt = GetExceptionCode();1154 }1155 }1156 else1157 rcNt = STATUS_SUCCESS;1158 }1159 else if (rc == VERR_INVALID_PARAMETER)1160 rcNt = STATUS_INVALID_PARAMETER;1161 else1162 rcNt = STATUS_NOT_SUPPORTED;1163 Log2(("VBoxDrvNtFastIoDeviceControl: returns %#x cbOut=%d rc=%#x\n", rcNt, cbOut, rc));1164 ExFreePoolWithTag(pHdr, 'VBox');1165 }1166 1172 } 1167 1173 else
Note:
See TracChangeset
for help on using the changeset viewer.