Changeset 37596 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Jun 22, 2011 7:30:06 PM (14 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r37410 r37596 97 97 SUPLIBDATA g_supLibData = 98 98 { 99 NIL_RTFILE99 SUP_HDEVICE_NIL 100 100 #if defined(RT_OS_DARWIN) 101 101 , NULL … … 185 185 return VERR_INVALID_MAGIC; 186 186 if ( !(fFlags & SUPSECMAIN_FLAGS_DONT_OPEN_DEV) 187 && pPreInitData->Data.hDevice == NIL_RTFILE)187 && pPreInitData->Data.hDevice == SUP_HDEVICE_NIL) 188 188 return VERR_INVALID_HANDLE; 189 189 if ( (fFlags & SUPSECMAIN_FLAGS_DONT_OPEN_DEV) 190 && pPreInitData->Data.hDevice != NIL_RTFILE)190 && pPreInitData->Data.hDevice != SUP_HDEVICE_NIL) 191 191 return VERR_INVALID_PARAMETER; 192 192 -
trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h
r35188 r37596 185 185 { 186 186 /** The device handle. */ 187 RTFILE hDevice; 187 #if defined(RT_OS_WINDOWS) 188 void *hDevice; 189 #else 190 int hDevice; 191 #endif 188 192 #if defined(RT_OS_DARWIN) 189 193 /** The connection to the VBoxSupDrv service. */ … … 203 207 /** Pointer to const pre-init data. */ 204 208 typedef SUPLIBDATA const *PCSUPLIBDATA; 209 210 /** The NIL value of SUPLIBDATA::hDevice. */ 211 #if defined(RT_OS_WINDOWS) 212 # define SUP_HDEVICE_NIL NULL 213 #else 214 # define SUP_HDEVICE_NIL (-1) 215 #endif 205 216 206 217 -
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
r35311 r37596 1019 1019 */ 1020 1020 g_pszSupLibHardenedProgName = pszProgName; 1021 g_SupPreInitData.u32Magic = SUPPREINITDATA_MAGIC;1022 g_SupPreInitData.Data.hDevice = NIL_RTFILE;1023 g_SupPreInitData.u32EndMagic = SUPPREINITDATA_MAGIC;1021 g_SupPreInitData.u32Magic = SUPPREINITDATA_MAGIC; 1022 g_SupPreInitData.Data.hDevice = SUP_HDEVICE_NIL; 1023 g_SupPreInitData.u32EndMagic = SUPPREINITDATA_MAGIC; 1024 1024 1025 1025 #ifdef SUP_HARDENED_SUID -
trunk/src/VBox/HostDrivers/Support/darwin/SUPLib-darwin.cpp
r33540 r37596 194 194 * Do the job. 195 195 */ 196 Assert(pThis->hDevice == NIL_RTFILE);196 Assert(pThis->hDevice == (intptr_t)NIL_RTFILE); 197 197 int rc = suplibDarwinOpenService(pThis); 198 198 if (RT_SUCCESS(rc)) … … 237 237 * Check if we're inited at all. 238 238 */ 239 if (pThis->hDevice != NIL_RTFILE)239 if (pThis->hDevice != (intptr_t)NIL_RTFILE) 240 240 { 241 241 if (close(pThis->hDevice)) 242 242 AssertFailed(); 243 pThis->hDevice = NIL_RTFILE;243 pThis->hDevice = (intptr_t)NIL_RTFILE; 244 244 } 245 245 -
trunk/src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp
r33540 r37596 133 133 * Check if we're inited at all. 134 134 */ 135 if (pThis->hDevice != NIL_RTFILE)135 if (pThis->hDevice != (intptr_t)NIL_RTFILE) 136 136 { 137 137 if (close(pThis->hDevice)) 138 138 AssertFailed(); 139 pThis->hDevice = NIL_RTFILE;139 pThis->hDevice = (intptr_t)NIL_RTFILE; 140 140 } 141 141 return VINF_SUCCESS; -
trunk/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp
r37556 r37596 79 79 if (fPreInited) 80 80 return VINF_SUCCESS; 81 Assert(pThis->hDevice == NIL_RTFILE);81 Assert(pThis->hDevice == (intptr_t)NIL_RTFILE); 82 82 83 83 /* … … 145 145 * Close the device if it's actually open. 146 146 */ 147 if (pThis->hDevice != NIL_RTFILE)147 if (pThis->hDevice != (intptr_t)NIL_RTFILE) 148 148 { 149 149 if (close(pThis->hDevice)) 150 150 AssertFailed(); 151 pThis->hDevice = NIL_RTFILE;151 pThis->hDevice = (intptr_t)NIL_RTFILE; 152 152 } 153 153 … … 172 172 int suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq) 173 173 { 174 AssertMsg(pThis->hDevice != NIL_RTFILE, ("SUPLIB not initiated successfully!\n"));174 AssertMsg(pThis->hDevice != (intptr_t)NIL_RTFILE, ("SUPLIB not initiated successfully!\n")); 175 175 176 176 /* -
trunk/src/VBox/HostDrivers/Support/os2/SUPLib-os2.cpp
r33540 r37596 100 100 } 101 101 102 pThis->hDevice = (RTFILE)hDevice;102 pThis->hDevice = hDevice; 103 103 return VINF_SUCCESS; 104 104 } … … 112 112 * Check if we're inited at all. 113 113 */ 114 if (pThis->hDevice != NIL_RTFILE)114 if (pThis->hDevice != (intptr_t)NIL_RTFILE) 115 115 { 116 116 APIRET rc = DosClose((HFILE)pThis->hDevice); 117 117 AssertMsg(rc == NO_ERROR, ("%d\n", rc)); NOREF(rc); 118 pThis->hDevice = NIL_RTFILE;118 pThis->hDevice = (intptr_t)NIL_RTFILE; 119 119 } 120 120 -
trunk/src/VBox/HostDrivers/Support/solaris/SUPLib-solaris.cpp
r28800 r37596 162 162 if (close(pThis->hDevice)) 163 163 AssertFailed(); 164 pThis->hDevice = NIL_RTFILE;164 pThis->hDevice = (intptr_t)NIL_RTFILE; 165 165 } 166 166 -
trunk/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp
r33540 r37596 139 139 * We're done. 140 140 */ 141 pThis->hDevice = (RTFILE)hDevice;141 pThis->hDevice = hDevice; 142 142 return VINF_SUCCESS; 143 143 } … … 475 475 * Check if we're inited at all. 476 476 */ 477 if (pThis->hDevice != N IL_RTFILE)477 if (pThis->hDevice != NULL) 478 478 { 479 479 if (!CloseHandle((HANDLE)pThis->hDevice)) 480 480 AssertFailed(); 481 pThis->hDevice = NIL_RTFILE; 481 pThis->hDevice = NIL_RTFILE; /* yes, that's right */ 482 482 } 483 483
Note:
See TracChangeset
for help on using the changeset viewer.