Changeset 98292 in vbox for trunk/src/VBox/Main/src-server/os2
- Timestamp:
- Jan 25, 2023 1:14:53 AM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 155497
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/os2/USBProxyBackendOs2.cpp
r98103 r98292 59 59 * Try initialize the usbcalls stuff. 60 60 */ 61 intrc = DosCreateEventSem(NULL, &mhev, 0, FALSE);62 rc = RTErrConvertFromOS2(rc);63 if (RT_SUCCESS( rc))61 APIRET orc = DosCreateEventSem(NULL, &mhev, 0, FALSE); 62 int vrc = RTErrConvertFromOS2(orc); 63 if (RT_SUCCESS(vrc)) 64 64 { 65 rc = DosLoadModule(NULL, 0, (PCSZ)"usbcalls", &mhmod);66 rc = RTErrConvertFromOS2(rc);67 if (RT_SUCCESS( rc))65 orc = DosLoadModule(NULL, 0, (PCSZ)"usbcalls", &mhmod); 66 vrc = RTErrConvertFromOS2(orc); 67 if (RT_SUCCESS(vrc)) 68 68 { 69 if ( ( rc = DosQueryProcAddr(mhmod, 0, (PCSZ)"UsbQueryNumberDevices", (PPFN)&mpfnUsbQueryNumberDevices)) == NO_ERROR70 && ( rc = DosQueryProcAddr(mhmod, 0, (PCSZ)"UsbQueryDeviceReport", (PPFN)&mpfnUsbQueryDeviceReport)) == NO_ERROR71 && ( rc = DosQueryProcAddr(mhmod, 0, (PCSZ)"UsbRegisterChangeNotification", (PPFN)&mpfnUsbRegisterChangeNotification)) == NO_ERROR72 && ( rc = DosQueryProcAddr(mhmod, 0, (PCSZ)"UsbDeregisterNotification", (PPFN)&mpfnUsbDeregisterNotification)) == NO_ERROR69 if ( (orc = DosQueryProcAddr(mhmod, 0, (PCSZ)"UsbQueryNumberDevices", (PPFN)&mpfnUsbQueryNumberDevices)) == NO_ERROR 70 && (orc = DosQueryProcAddr(mhmod, 0, (PCSZ)"UsbQueryDeviceReport", (PPFN)&mpfnUsbQueryDeviceReport)) == NO_ERROR 71 && (orc = DosQueryProcAddr(mhmod, 0, (PCSZ)"UsbRegisterChangeNotification", (PPFN)&mpfnUsbRegisterChangeNotification)) == NO_ERROR 72 && (orc = DosQueryProcAddr(mhmod, 0, (PCSZ)"UsbDeregisterNotification", (PPFN)&mpfnUsbDeregisterNotification)) == NO_ERROR 73 73 ) 74 74 { 75 rc = mpfnUsbRegisterChangeNotification(&mNotifyId, mhev, mhev);76 if (! rc)75 orc = mpfnUsbRegisterChangeNotification(&mNotifyId, mhev, mhev); 76 if (!orc) 77 77 { 78 78 /* 79 79 * Start the poller thread. 80 80 */ 81 rc = start();82 if (RT_SUCCESS( rc))81 vrc = start(); 82 if (RT_SUCCESS(vrc)) 83 83 { 84 84 LogFlowThisFunc(("returns successfully - mNotifyId=%d\n", mNotifyId)); … … 86 86 return; 87 87 } 88 LogRel(("USBProxyBackendOs2: failed to start poller thread, vrc=%Rrc\n", vrc)); 88 89 } 89 90 LogRel(("USBProxyBackendOs2: failed to register change notification, rc=%d\n", rc)); 90 else 91 { 92 LogRel(("USBProxyBackendOs2: failed to register change notification, orc=%d\n", orc)); 93 vrc = RTErrConvertFromOS2(orc); 94 } 91 95 } 92 96 else 97 { 93 98 LogRel(("USBProxyBackendOs2: failed to load usbcalls\n")); 99 vrc = RTErrConvertFromOS2(orc); 100 } 94 101 95 102 DosFreeModule(mhmod); 96 103 } 97 104 else 98 LogRel(("USBProxyBackendOs2: failed to load usbcalls, rc=%d\n",rc));105 LogRel(("USBProxyBackendOs2: failed to load usbcalls, vrc=%d\n", vrc)); 99 106 mhmod = NULLHANDLE; 100 107 } … … 102 109 mhev = NULLHANDLE; 103 110 104 mLastError = rc;105 LogFlowThisFunc(("returns failure!!! ( rc=%Rrc)\n",rc));111 mLastError = vrc; 112 LogFlowThisFunc(("returns failure!!! (vrc=%Rrc)\n", vrc)); 106 113 } 107 114 … … 191 198 int USBProxyBackendOs2::wait(RTMSINTERVAL aMillies) 192 199 { 193 int rc = DosWaitEventSem(mhev, aMillies);194 return RTErrConvertFromOS2( rc);200 int orc = DosWaitEventSem(mhev, aMillies); 201 return RTErrConvertFromOS2(orc); 195 202 } 196 203 … … 198 205 int USBProxyBackendOs2::interruptWait(void) 199 206 { 200 int rc = DosPostEventSem(mhev);201 return rc == NO_ERROR ||rc == ERROR_ALREADY_POSTED207 int orc = DosPostEventSem(mhev); 208 return orc == NO_ERROR || orc == ERROR_ALREADY_POSTED 202 209 ? VINF_SUCCESS 203 : RTErrConvertFromOS2( rc);210 : RTErrConvertFromOS2(orc); 204 211 } 205 212 … … 212 219 */ 213 220 ULONG cDevices = 0; 214 int rc = mpfnUsbQueryNumberDevices((PULONG)&cDevices); /* Thanks to com/xpcom, PULONG and ULONG * aren't the same. */215 if ( rc)221 int orc = mpfnUsbQueryNumberDevices((PULONG)&cDevices); /* Thanks to com/xpcom, PULONG and ULONG * aren't the same. */ 222 if (orc) 216 223 return NULL; 217 224 … … 228 235 uint8_t abBuf[1024]; 229 236 ULONG cb = sizeof(abBuf); 230 rc = mpfnUsbQueryDeviceReport(i + 1, (PULONG)&cb, &abBuf[0]); /* see above (PULONG) */231 if ( rc)237 orc = mpfnUsbQueryDeviceReport(i + 1, (PULONG)&cb, &abBuf[0]); /* see above (PULONG) */ 238 if (orc) 232 239 continue; 233 240 PUSBDEVICEDESC pDevDesc = (PUSBDEVICEDESC)&abBuf[0];
Note:
See TracChangeset
for help on using the changeset viewer.