Changeset 40591 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Mar 23, 2012 12:26:17 PM (13 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Makefile.kmk
r40586 r40591 637 637 Audio/dsoundaudio.c \ 638 638 Serial/DrvHostSerial.cpp 639 640 641 639 ifdef VBOX_WITH_WIN_PARPORT_SUP 640 VBoxDD_SOURCES.win += Parallel/DrvHostParallel.cpp 641 endif 642 642 643 643 if defined(VBOX_WITH_NETFLT) -
trunk/src/VBox/Devices/Parallel/DrvHostParallel.cpp
r40585 r40591 73 73 #include <setupapi.h> 74 74 #include <regstr.h> 75 #include <string.h>75 #include <string.h> 76 76 #include <cfgmgr32.h> 77 77 #include <iprt/mem.h> … … 80 80 #include "VBoxDD.h" 81 81 82 82 83 /******************************************************************************* 83 84 * Structures and Typedefs * … … 92 93 PPDMDRVINS pDrvIns; 93 94 /** Pointer to the driver instance. */ 94 PPDMDRVINSR3 95 PPDMDRVINSR0 95 PPDMDRVINSR3 pDrvInsR3; 96 PPDMDRVINSR0 pDrvInsR0; 96 97 /** Pointer to the char port interface of the driver/device above us. */ 97 98 PPDMIHOSTPARALLELPORT pDrvHostParallelPort; … … 101 102 PDMIHOSTPARALLELCONNECTOR IHostParallelConnectorR3; 102 103 /** Ring-3 base interface for the ring-0 context. */ 103 PDMIBASER0 104 PDMIBASER0 IBaseR0; 104 105 /** Device Path */ 105 106 char *pszDevicePath; … … 114 115 /** Current mode the parallel port is in. */ 115 116 PDMPARALLELPORTMODE enmModeCur; 116 117 117 #ifdef VBOX_WITH_WIN_PARPORT_SUP 118 118 /** Data register. */ 119 119 uint32_t u32LptAddr; 120 /** Status register. */ 120 121 uint32_t u32LptAddrStatus; 122 /** Control register. */ 121 123 uint32_t u32LptAddrControl; 124 /** Data read buffer. */ 122 125 uint8_t bReadIn; 126 /** Control read buffer. */ 123 127 uint8_t bReadInControl; 128 /** Status read buffer. */ 124 129 uint8_t bReadInStatus; 125 uint8_t bParportAvail;126 #ifdef IN_RING0127 128 typedef struct DEVICE_EXTNESION129 130 131 132 133 134 135 }DEVICE_EXTENSION, *PDEVICE_EXTENSION;136 PDEVICE_EXTENSION pDevExtn;137 #endif130 /** Whether the parallel port is available or not. */ 131 uint8_t bParportAvail; 132 # ifdef IN_RING0 133 typedef struct DEVICE_EXTENSION 134 { 135 PPARALLEL_PORT_INFORMATION pParallelInfo; 136 PPARALLEL_PNP_INFORMATION pPnpInfo; 137 UNICODE_STRING uniName; 138 PFILE_OBJECT FileObj; 139 PDEVICE_OBJECT pParallelDeviceObject; 140 } DEVICE_EXTENSION, *PDEVICE_EXTENSION; 141 PDEVICE_EXTENSION pDevExtn; 142 # endif 138 143 #endif 139 140 144 } DRVHOSTPARALLEL, *PDRVHOSTPARALLEL; 141 145 … … 146 150 typedef enum DRVHOSTPARALLELR0OP 147 151 { 148 /** Invalid zero value. .*/152 /** Invalid zero value. */ 149 153 DRVHOSTPARALLELR0OP_INVALID = 0, 150 /** Perform DrvHostparallel R0 initialization stuff*/154 /** Perform R0 initialization. */ 151 155 DRVHOSTPARALLELR0OP_INITR0STUFF, 152 /** To read a byte from parallel port. */156 /** Read data. */ 153 157 DRVHOSTPARALLELR0OP_READ, 154 /** Read status register */158 /** Read status register. */ 155 159 DRVHOSTPARALLELR0OP_READSTATUS, 156 /** Read control register */160 /** Read control register. */ 157 161 DRVHOSTPARALLELR0OP_READCONTROL, 158 /** To write a byte to parallel port. */162 /** Write data. */ 159 163 DRVHOSTPARALLELR0OP_WRITE, 160 /** Write to control register. */164 /** Write control register. */ 161 165 DRVHOSTPARALLELR0OP_WRITECONTROL, 162 /** Set Port Direciton */166 /** Set port direction. */ 163 167 DRVHOSTPARALLELR0OP_SETPORTDIRECTION 164 168 } DRVHOSTPARALLELR0OP; … … 171 175 /** 172 176 * R0 mode function to write byte value to data port. 173 * @returns VBox status code. .174 * @param pDrvIns Driver instance ,175 * @param u64Arg data to be written to parallel port data176 * register177 * @returns VBox status code. 178 * @param pDrvIns Driver instance. 179 * @param u64Arg Data to be written to data register. 180 * 177 181 */ 178 182 PDMBOTHCBDECL(int) drvR0HostParallelReqWrite(PPDMDRVINS pDrvIns, uint64_t u64Arg) … … 185 189 186 190 /** 187 * R0 mode function to write byte value to paralell port control 188 * register .189 * @returns VBox status code. .190 * @param pDrvIns Driver instance,191 * @param u64Arg data to be written191 * R0 mode function to write byte value to paralell port control 192 * register. 193 * @returns VBox status code. 194 * @param pDrvIns Driver instance. 195 * @param u64Arg Data to be written to control register. 192 196 */ 193 197 PDMBOTHCBDECL(int) drvR0HostParallelReqWriteControl(PPDMDRVINS pDrvIns, uint64_t u64Arg) … … 200 204 201 205 /** 202 * R0 mode function to ready byte value from the parallel port 203 * data register 204 * @returns VBox status code. .205 * @param pDrvIns Driver instance ,206 * @param u64Arg 0 (not used)206 * R0 mode function to ready byte value from the parallel port 207 * data register 208 * @returns VBox status code. 209 * @param pDrvIns Driver instance. 210 * @param u64Arg Not used. 207 211 */ 208 212 PDMBOTHCBDECL(int) drvR0HostParallelReqRead(PPDMDRVINS pDrvIns, uint64_t u64Arg) … … 217 221 } 218 222 219 220 /** 221 * R0 mode function to ready byte value from the parallel port 222 * control register 223 * @returns VBox status code.. 224 * @param pDrvIns Driver instance, 225 * @param u64Arg 0 (not used) 223 /** 224 * R0 mode function to ready byte value from the parallel port 225 * control register. 226 * @returns VBox status code. 227 * @param pDrvIns Driver instance. 228 * @param u64Arg Not used. 226 229 */ 227 230 PDMBOTHCBDECL(int) drvR0HostParallelReqReadControl(PPDMDRVINS pDrvIns, uint64_t u64Arg) … … 237 240 238 241 /** 239 * R0 mode function to ready byte value from the parallel port 240 * status register 241 * @returns VBox status code. .242 * @param pDrvIns Driver instance ,243 * @param u64Arg 0 (not used)242 * R0 mode function to ready byte value from the parallel port 243 * status register. 244 * @returns VBox status code. 245 * @param pDrvIns Driver instance. 246 * @param u64Arg Not used. 244 247 */ 245 248 PDMBOTHCBDECL(int) drvR0HostParallelReqReadStatus(PPDMDRVINS pDrvIns, uint64_t u64Arg) … … 253 256 return VINF_SUCCESS; 254 257 } 255 /** 256 * R0 mode function to set the direction of parallel port - 257 * operate in bidirectional mode or single direction 258 * @returns VBox status code.. 259 * @param pDrvIns Driver instance, 260 * @param u64Arg mode 258 259 /** 260 * R0 mode function to set the direction of parallel port - 261 * operate in bidirectional mode or single direction. 262 * @returns VBox status code. 263 * @param pDrvIns Driver instance. 264 * @param u64Arg Mode. 261 265 */ 262 266 PDMBOTHCBDECL(int) drvR0HostParallelReqSetPortDir(PPDMDRVINS pDrvIns, uint64_t u64Arg) … … 267 271 PDRVHOSTPARALLEL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPARALLEL); 268 272 269 if(u64Arg) { 270 u8TmpData = 0x08; /**setting the control bit*/ 271 u8ReadControlVal = ASMInU8(pThis->u32LptAddrControl); 272 u8WriteControlVal = u8ReadControlVal | u8TmpData; 273 ASMOutU8(pThis->u32LptAddrControl, u8WriteControlVal); 273 if (u64Arg) 274 { 275 u8TmpData = 0x08; /* Set the control bit */ 276 u8ReadControlVal = ASMInU8(pThis->u32LptAddrControl); 277 u8WriteControlVal = u8ReadControlVal | u8TmpData; 278 ASMOutU8(pThis->u32LptAddrControl, u8WriteControlVal); 274 279 } 275 280 else 276 281 { 277 u8TmpData = 0xF7; /* * clearing the control register 5th bit*/282 u8TmpData = 0xF7; /* Clear the control register 5th bit */ 278 283 u8ReadControlVal = ASMInU8(pThis->u32LptAddrControl); 279 284 u8WriteControlVal = u8ReadControlVal & u8TmpData; … … 281 286 } 282 287 return VINF_SUCCESS; 283 284 } 285 288 } 286 289 287 290 /** … … 296 299 LogFlow(("Read Op\n")); 297 300 return drvR0HostParallelReqRead(pDrvIns, u64Arg); 298 break; 301 299 302 case DRVHOSTPARALLELR0OP_READSTATUS: 300 303 LogFlow(("Read Status \n")); 301 304 return drvR0HostParallelReqReadStatus(pDrvIns, u64Arg); 302 break; 305 303 306 case DRVHOSTPARALLELR0OP_READCONTROL: 304 307 LogFlow(("Read CTRL\n")); 305 308 return drvR0HostParallelReqReadControl(pDrvIns, u64Arg); 306 break; 309 307 310 case DRVHOSTPARALLELR0OP_WRITE: 308 311 LogFlow(("Write Ope\n")); 309 312 return drvR0HostParallelReqWrite(pDrvIns, u64Arg); 310 break; 313 311 314 case DRVHOSTPARALLELR0OP_WRITECONTROL: 312 315 LogFlow(("Write CTRL\n")); 313 316 return drvR0HostParallelReqWriteControl(pDrvIns, u64Arg); 314 break; 317 315 318 case DRVHOSTPARALLELR0OP_SETPORTDIRECTION: 316 319 LogFlow(("Set Port Direction")); 317 320 return drvR0HostParallelReqSetPortDir(pDrvIns, u64Arg); 318 default: 319 return 0;320 /** Not Supported.*/321 322 default: /* Not Supported. */ 323 return 0; /** @todo is this correct for not supported case? */ 321 324 } 322 325 } … … 328 331 /** 329 332 * Find IO port range for the parallel port and return the lower 330 * address. 333 * address. 331 334 * @returns parallel port IO address. 332 335 * @param DevInst Device Instance for parallel port. … … 335 338 { 336 339 uint8_t *pBuf = NULL; 337 short wHeaderSize;338 uint32_t u32Size;340 short wHeaderSize; 341 uint32_t u32Size; 339 342 CONFIGRET cmRet; 340 343 LOG_CONF firstLogConf; … … 351 354 return 0; 352 355 } 353 cmRet = CM_Get_Next_Res_Des(&nextLogConf, firstLogConf, 2, 0L, 0L);356 cmRet = CM_Get_Next_Res_Des(&nextLogConf, firstLogConf, 2, 0L, 0L); 354 357 if (cmRet != CR_SUCCESS) 355 358 { … … 357 360 return 0; 358 361 } 359 while (1) 362 363 for (;;) 360 364 { 361 365 u32Size = 0; … … 366 370 break; 367 371 } 368 pBuf = (uint8_t *)((char*)RTMemAlloc(u32Size +1));372 pBuf = (uint8_t *)((char*)RTMemAlloc(u32Size + 1)); 369 373 if (!pBuf) 370 374 { 371 375 CM_Free_Res_Des_Handle(nextLogConf); 372 376 break; 373 }; 377 }; /** @todo Is this semicolon intended? */ 374 378 cmRet = CM_Get_Res_Des_Data(nextLogConf, pBuf, u32Size, 0L); 375 379 if (cmRet != CR_SUCCESS) … … 403 407 404 408 /** 405 * Get Parallel port address and update the shared data 406 * structure. 409 * Get Parallel port address and update the shared data 410 * structure. 407 411 * @returns VBox status code. 408 412 * @param pThis The host parallel port instance data. … … 416 420 int rc = VINF_SUCCESS; 417 421 418 hDevInfo = SetupDiGetClassDevs(NULL, 0, 0, DIGCF_PRESENT | DIGCF_ALLCLASSES);422 hDevInfo = SetupDiGetClassDevs(NULL, 0, 0, DIGCF_PRESENT | DIGCF_ALLCLASSES); 419 423 if (hDevInfo == INVALID_HANDLE_VALUE) 420 424 return VERR_INVALID_HANDLE; 421 425 422 / / Enumerate through all devices in Set.426 /* Enumerate through all devices in Set. */ 423 427 DeviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA); 424 for (u32Idx =0;SetupDiEnumDeviceInfo(hDevInfo,u32Idx,&DeviceInfoData);u32Idx++)428 for (u32Idx = 0; SetupDiEnumDeviceInfo(hDevInfo, u32Idx, &DeviceInfoData); u32Idx++) 425 429 { 426 430 uint32_t u32DataType; … … 428 432 uint32_t u32BufSize = 0; 429 433 430 while (!SetupDiGetDeviceRegistryProperty(hDevInfo, &DeviceInfoData, SPDRP_FRIENDLYNAME,(PDWORD)&u32DataType,(uint8_t *)pBuf,431 u32BufSize, (PDWORD)&u32BufSize))434 while (!SetupDiGetDeviceRegistryProperty(hDevInfo, &DeviceInfoData, SPDRP_FRIENDLYNAME, (PDWORD)&u32DataType, (uint8_t *)pBuf, 435 u32BufSize, (PDWORD)&u32BufSize)) 432 436 { 433 437 if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) 434 438 { 435 if (pBuf) 439 if (pBuf) 436 440 RTMemFree(pBuf); 437 /* *Max size will never reach more than 2048 bytes */441 /* Max size will never be more than 2048 bytes */ 438 442 pBuf = (uint8_t *)((char*)RTMemAlloc(u32BufSize * 2)); 439 443 } … … 441 445 break; 442 446 } 443 444 if (pBuf)447 448 if (pBuf) 445 449 { 446 450 LogFlow(("Buffer = %s\n", pBuf)); 447 if (strstr((char*)pBuf, "LPT"))451 if (strstr((char*)pBuf, "LPT")) /** @todo Use IPRT equivalent? */ 448 452 { 449 453 LogFlow(("Found parallel port\n")); 450 454 u32ParportAddr = FindIORangeResource(DeviceInfoData.DevInst); 451 if (u32ParportAddr)452 { 453 pThis->bParportAvail = true; 455 if (u32ParportAddr) 456 { 457 pThis->bParportAvail = true; 454 458 pThis->u32LptAddr = u32ParportAddr; 455 pThis->u32LptAddrControl = pThis->u32LptAddr + 2;459 pThis->u32LptAddrControl = pThis->u32LptAddr + 2; 456 460 pThis->u32LptAddrStatus = pThis->u32LptAddr + 1; 457 461 } 458 if (pThis->bParportAvail)462 if (pThis->bParportAvail) 459 463 break; 460 464 } 461 465 } 462 if (pBuf) /**cleanup*/466 if (pBuf) 463 467 RTMemFree(pBuf); 464 if (pThis->bParportAvail) {465 /**parport address has been found. No Need to iterate466 * further. */468 if (pThis->bParportAvail) 469 { 470 /* Parport address has been found. No Need to iterate further. */ 467 471 break; 468 472 } 469 473 } 470 474 471 if ( GetLastError()!=NO_ERROR &&GetLastError()!=ERROR_NO_MORE_ITEMS ) 472 { 475 if (GetLastError() != NO_ERROR && GetLastError() != ERROR_NO_MORE_ITEMS) 473 476 rc = VERR_GENERAL_FAILURE;; 474 } 475 SetupDiDestroyDeviceInfoList(hDevInfo); 477 478 SetupDiDestroyDeviceInfoList(hDevInfo); 476 479 return rc; 477 480 … … 491 494 int rc = VINF_SUCCESS; 492 495 LogFlow(("%s: mode=%d\n", __FUNCTION__, enmMode)); 496 493 497 #ifndef VBOX_WITH_WIN_PARPORT_SUP 494 498 int rcLnx; … … 569 573 } 570 574 if (RT_UNLIKELY(rcLnx < 0)) 571 rc = RTErrConvertFromErrno(errno); 575 rc = RTErrConvertFromErrno(errno); 572 576 #else /*VBOX_WITH_WIN_PARPORT_SUP*/ 573 577 uint64_t u64Data; 574 578 u64Data = (uint8_t) *((uint8_t *)(pvBuf)); 575 579 LogFlow(("%s: Calling R0 to write to parallel port. Data is %d\n", __FUNCTION__, u64Data)); 576 if (pThis->bParportAvail)580 if (pThis->bParportAvail) 577 581 { 578 582 rc = PDMDrvHlpCallR0(pThis->CTX_SUFF(pDrvIns), DRVHOSTPARALLELR0OP_WRITE, u64Data); … … 588 592 */ 589 593 static DECLCALLBACK(int) drvHostParallelRead(PPDMIHOSTPARALLELCONNECTOR pInterface, void *pvBuf, size_t cbRead, PDMPARALLELPORTMODE enmMode) 590 { 594 { 591 595 PDRVHOSTPARALLEL pThis = RT_FROM_MEMBER(pInterface, DRVHOSTPARALLEL, CTX_SUFF(IHostParallelConnector)); 592 596 int rc = VINF_SUCCESS; 593 597 594 #ifndef VBOX_WITH_WIN_PARPORT_SUP 598 #ifndef VBOX_WITH_WIN_PARPORT_SUP 595 599 int rcLnx = 0; 596 600 LogFlow(("%s: pvBuf=%#p cbRead=%d\n", __FUNCTION__, pvBuf, cbRead)); … … 612 616 if (RT_UNLIKELY(rcLnx < 0)) 613 617 rc = RTErrConvertFromErrno(errno); 614 615 *((uint8_t*)(pvBuf)) = 0; /* * initialize the buffer*/618 #else /* VBOX_WITH_WIN_PARPORT_SUP */ 619 *((uint8_t*)(pvBuf)) = 0; /* Initialize the buffer. */ 616 620 LogFlow(("%s: Calling R0 to Read from PPort\n", __FUNCTION__)); 617 if (pThis->bParportAvail)621 if (pThis->bParportAvail) 618 622 { 619 623 int rc = PDMDrvHlpCallR0(pThis->CTX_SUFF(pDrvIns), DRVHOSTPARALLELR0OP_READ, 0); … … 622 626 *((uint8_t*)(pvBuf)) = (uint8_t)pThis->bReadIn; 623 627 } 624 628 #endif 625 629 return rc; 626 630 } … … 643 647 u64Data = (uint8_t)iMode; 644 648 LogFlow(("%s: Calling R0 to write CTRL . Data is %x\n", __FUNCTION__, u64Data)); 645 if (pThis->bParportAvail)649 if (pThis->bParportAvail) 646 650 { 647 651 rc = PDMDrvHlpCallR0(pThis->CTX_SUFF(pDrvIns), DRVHOSTPARALLELR0OP_SETPORTDIRECTION, u64Data); 648 if (RT_FAILURE(rc)) 652 if (RT_FAILURE(rc)) 649 653 AssertRC(rc); 650 654 } … … 671 675 u64Data = (uint8_t)fReg; 672 676 LogFlow(("%s: Calling R0 to write CTRL . Data is %x\n", __FUNCTION__, u64Data)); 673 if (pThis->bParportAvail)677 if (pThis->bParportAvail) 674 678 { 675 679 rc = PDMDrvHlpCallR0(pThis->CTX_SUFF(pDrvIns), DRVHOSTPARALLELR0OP_WRITECONTROL, u64Data); 676 if (RT_FAILURE(rc)) 680 if (RT_FAILURE(rc)) 677 681 AssertRC(rc); 678 682 } … … 692 696 uint8_t fReg = 0; 693 697 694 698 #ifndef VBOX_WITH_WIN_PARPORT_SUP 695 699 rcLnx = ioctl(RTFileToNative(pThis->hFileDevice), PPRCONTROL, &fReg); 696 700 if (RT_UNLIKELY(rcLnx < 0)) … … 702 706 } 703 707 #else /* VBOX_WITH_WIN_PARPORT_SUP */ 704 *pfReg = 0; /* * initialize the buffer*/705 if (pThis->bParportAvail)708 *pfReg = 0; /* Initialize the buffer*/ 709 if (pThis->bParportAvail) 706 710 { 707 711 LogFlow(("%s: Calling R0 to Read Control from PPort\n", __FUNCTION__)); … … 734 738 } 735 739 #else /* VBOX_WITH_WIN_PARPORT_SUP */ 736 *pfReg = 0; /* *intialize the buffer*/737 if (pThis->bParportAvail)740 *pfReg = 0; /* Intialize the buffer. */ 741 if (pThis->bParportAvail) 738 742 { 739 743 LogFlow(("%s: Calling R0 to Read Status from Pport\n", __FUNCTION__)); … … 753 757 #ifndef VBOX_WITH_WIN_PARPORT_SUP 754 758 struct pollfd aFDs[2]; 759 755 760 /* 756 761 * We can wait for interrupts using poll on linux hosts. … … 790 795 AssertRC(rc); 791 796 } 792 #else /* VBOX_WITH_WIN_PARPORT_SUP */793 797 #endif /* VBOX_WITH_WIN_PARPORT_SUP */ 794 798 … … 823 827 LogFlow(("%s: iInstance=%d\n", __FUNCTION__, pDrvIns->iInstance)); 824 828 PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns); 829 825 830 #ifndef VBOX_WITH_WIN_PARPORT_SUP 826 831 827 832 int rc; 828 833 … … 844 849 pThis->pszDevicePath = NULL; 845 850 } 846 #else /* VBOX_WITH_WIN_PARPORT_SUP */847 851 #endif /* VBOX_WITH_WIN_PARPORT_SUP */ 848 852 } … … 883 887 pThis->IHostParallelConnectorR3.pfnReadControl = drvHostParallelReadControl; 884 888 pThis->IHostParallelConnectorR3.pfnReadStatus = drvHostParallelReadStatus; 885 889 886 890 /* 887 891 * Validate the config. … … 909 913 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("Parallel#%d could not open '%s'"), 910 914 pDrvIns->iInstance, pThis->pszDevicePath); 915 911 916 #ifndef VBOX_WITH_WIN_PARPORT_SUP 912 917 /* … … 955 960 * Start waiting for interrupts. 956 961 */ 957 962 rc = PDMDrvHlpThreadCreate(pDrvIns, &pThis->pMonitorThread, pThis, drvHostParallelMonitorThread, drvHostParallelWakeupMonitorThread, 0, 958 963 RTTHREADTYPE_IO, "ParMon"); 959 964 if (RT_FAILURE(rc)) 960 965 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("HostParallel#%d cannot create monitor thread"), pDrvIns->iInstance); 961 966 962 967 #else /* VBOX_WITH_WIN_PARPORT_SUP */ 963 /**intialize with parallel port availability = false */964 968 pThis->bParportAvail = false; 965 /**initialize parallel port data register address to NULL */ 966 pThis->u32LptAddr =0L; 967 /**initialize parallel port control register address to NULL */ 969 pThis->u32LptAddr = 0L; 968 970 pThis->u32LptAddrControl = 0L; 969 /**initialize parallel port Status register address to NULL */970 971 pThis->u32LptAddrStatus = 0L; 971 972 rc = drvHostParallelGetParportAddr(pThis); 972 973 return rc; 974 /** @todo code after unconditional return? Either #if 0 it or remove. */ 973 975 HANDLE hPort; 974 976 hPort = CreateFile("LPT1", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, 975 977 NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); 976 if (INVALID_HANDLE_VALUE == hPort) { 978 if (INVALID_HANDLE_VALUE == hPort) 979 { 977 980 LogFlow(("Failed to get exclusive access to parallel port\n")); 978 981 return (GetLastError()); 979 } 982 } 980 983 #endif /* VBOX_WITH_WIN_PARPORT_SUP */ 981 984 return VINF_SUCCESS; … … 1000 1003 /* fFlags */ 1001 1004 #if defined(VBOX_WITH_WIN_PARPORT_SUP) 1002 PDM_DRVREG_FLAGS_HOST_BITS_DEFAULT | PDM_DRVREG_FLAGS_R0,1005 PDM_DRVREG_FLAGS_HOST_BITS_DEFAULT | PDM_DRVREG_FLAGS_R0, 1003 1006 #else 1004 1007 PDM_DRVREG_FLAGS_HOST_BITS_DEFAULT, -
trunk/src/VBox/Devices/build/VBoxDD.cpp
r40585 r40591 282 282 if (RT_FAILURE(rc)) 283 283 return rc; 284 284 285 #if defined(RT_OS_LINUX) || defined(VBOX_WITH_WIN_PARPORT_SUP) 285 286 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostParallel); … … 287 288 return rc; 288 289 #endif 289 290 291 290 292 291 #if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS) || defined(RT_OS_FREEBSD)
Note:
See TracChangeset
for help on using the changeset viewer.