Changeset 57736 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Sep 14, 2015 1:11:50 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 102658
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostDSound.cpp
r57717 r57736 28 28 #include "VBoxDD.h" 29 29 30 /* Dynamically load dsound.dll. */ 31 typedef HRESULT WINAPI FNDIRECTSOUNDENUMERATEW(LPDSENUMCALLBACKW pDSEnumCallback, LPVOID pContext); 32 typedef FNDIRECTSOUNDENUMERATEW *PFNDIRECTSOUNDENUMERATEW; 33 typedef HRESULT WINAPI FNDIRECTSOUNDCAPTUREENUMERATEW(LPDSENUMCALLBACKW pDSEnumCallback, LPVOID pContext); 34 typedef FNDIRECTSOUNDCAPTUREENUMERATEW *PFNDIRECTSOUNDCAPTUREENUMERATEW; 35 30 36 typedef struct DSOUNDHOSTCFG 31 37 { … … 323 329 if (FAILED(hr)) 324 330 { 325 LogRel (("DSound: Error creating DirectSound instance: %Rhrc\n", hr));331 LogRelMax(s_cMaxRelLogEntries, ("DSound: Error creating DirectSound instance: %Rhrc\n", hr)); 326 332 } 327 333 else … … 1487 1493 pCfg->cMaxHstStrmsIn = 0; 1488 1494 1489 DSOUNDENUMCBCTX ctx = { pThis, pCfg }; 1490 1491 HRESULT hr = DirectSoundEnumerateW(&dsoundEnumCallback, &ctx); 1492 if (FAILED(hr)) 1493 LogRel(("DSound: Error enumerating host playback devices: %Rhrc\n", hr)); 1494 1495 LogRel(("DSound: Found %RU32 host playback devices\n", pCfg->cMaxHstStrmsOut)); 1495 RTLDRMOD hDSound = NULL; 1496 int rc = RTLdrLoadSystem("dsound.dll", true /*fNoUnload*/, &hDSound); 1497 if (RT_SUCCESS(rc)) 1498 { 1499 PFNDIRECTSOUNDENUMERATEW pfnDirectSoundEnumerateW = NULL; 1500 PFNDIRECTSOUNDCAPTUREENUMERATEW pfnDirectSoundCaptureEnumerateW = NULL; 1501 1502 rc = RTLdrGetSymbol(hDSound, "DirectSoundEnumerateW", (void**)&pfnDirectSoundEnumerateW); 1503 if (RT_SUCCESS(rc)) 1504 { 1505 rc = RTLdrGetSymbol(hDSound, "DirectSoundCaptureEnumerateW", (void**)&pfnDirectSoundCaptureEnumerateW); 1506 } 1507 1508 if (RT_SUCCESS(rc)) 1509 { 1510 DSOUNDENUMCBCTX ctx = { pThis, pCfg }; 1511 1512 HRESULT hr = pfnDirectSoundEnumerateW(&dsoundEnumCallback, &ctx); 1513 if (FAILED(hr)) 1514 LogRel(("DSound: Error enumerating host playback devices: %Rhrc\n", hr)); 1515 1516 LogRel(("DSound: Found %RU32 host playback devices\n", pCfg->cMaxHstStrmsOut)); 1517 1518 hr = pfnDirectSoundCaptureEnumerateW(&dsoundCaptureEnumCallback, &ctx); 1519 if (FAILED(hr)) 1520 LogRel(("DSound: Error enumerating host capturing devices: %Rhrc\n", hr)); 1521 1522 LogRel(("DSound: Found %RU32 host capturing devices\n", pCfg->cMaxHstStrmsIn)); 1523 } 1524 1525 RTLdrClose(hDSound); 1526 } 1527 else 1528 { 1529 /* No dsound.dll on this system. */ 1530 LogRel(("DSound: could not load dsound.dll %Rrc\n", rc)); 1531 } 1532 1533 /* Always return success and at least default values to make the caller happy. */ 1496 1534 if (pCfg->cMaxHstStrmsOut == 0) 1535 { 1536 LogRel(("DSound: Adjusting the number of host playback devices to 1\n")); 1497 1537 pCfg->cMaxHstStrmsOut = 1; /* Support at least one stream. */ 1498 1499 hr = DirectSoundCaptureEnumerateW(&dsoundCaptureEnumCallback, &ctx); 1500 if (FAILED(hr)) 1501 LogRel(("DSound: Error enumerating host capturing devices: %Rhrc\n", hr)); 1502 1503 LogRel(("DSound: Found %RU32 host capturing devices\n", pCfg->cMaxHstStrmsIn)); 1538 } 1539 1504 1540 if (pCfg->cMaxHstStrmsIn < 2) 1505 1541 { -
trunk/src/VBox/Devices/Makefile.kmk
r57522 r57736 559 559 VBoxDD_SOURCES += \ 560 560 Audio/DrvHostDSound.cpp 561 VBoxDD_LIBS += \562 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/dsound.lib563 561 endif 564 562
Note:
See TracChangeset
for help on using the changeset viewer.