Fix tests for win9x and old versions of DirectX.
This commit is contained in:
parent
a740045064
commit
3cab60997f
|
@ -320,7 +320,7 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
|
||||||
if (rc==DSERR_NODRIVER)
|
if (rc==DSERR_NODRIVER)
|
||||||
trace(" No Driver\n");
|
trace(" No Driver\n");
|
||||||
else if (rc==E_FAIL)
|
else if (rc==E_FAIL)
|
||||||
trace(" E_FAIL\n");
|
trace(" No Device\n");
|
||||||
else if (rc==DSERR_ALLOCATED)
|
else if (rc==DSERR_ALLOCATED)
|
||||||
trace(" Already In Use\n");
|
trace(" Already In Use\n");
|
||||||
goto EXIT;
|
goto EXIT;
|
||||||
|
|
|
@ -882,7 +882,7 @@ static HRESULT test_for_driver(LPGUID lpGuid)
|
||||||
|
|
||||||
/* Create the DirectSound object */
|
/* Create the DirectSound object */
|
||||||
rc=DirectSoundCreate(lpGuid,&dso,NULL);
|
rc=DirectSoundCreate(lpGuid,&dso,NULL);
|
||||||
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
|
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
|
||||||
"DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
|
"DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
|
||||||
if (rc!=DS_OK)
|
if (rc!=DS_OK)
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -1166,6 +1166,9 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
|
||||||
} else if (rc == DSERR_ALLOCATED) {
|
} else if (rc == DSERR_ALLOCATED) {
|
||||||
trace(" Already In Use\n");
|
trace(" Already In Use\n");
|
||||||
return 1;
|
return 1;
|
||||||
|
} else if (rc == E_FAIL) {
|
||||||
|
trace(" No Device\n");
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
trace(" Testing the primary buffer\n");
|
trace(" Testing the primary buffer\n");
|
||||||
|
|
|
@ -796,7 +796,7 @@ static HRESULT test_for_driver8(LPGUID lpGuid)
|
||||||
|
|
||||||
/* Create the DirectSound object */
|
/* Create the DirectSound object */
|
||||||
rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
|
rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
|
||||||
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
|
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
|
||||||
"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
||||||
if (rc!=DS_OK)
|
if (rc!=DS_OK)
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -1081,6 +1081,9 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
|
||||||
} else if (rc == DSERR_ALLOCATED) {
|
} else if (rc == DSERR_ALLOCATED) {
|
||||||
trace(" Already In Use\n");
|
trace(" Already In Use\n");
|
||||||
return 1;
|
return 1;
|
||||||
|
} else if (rc == E_FAIL) {
|
||||||
|
trace(" No Device\n");
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
trace(" Testing the primary buffer\n");
|
trace(" Testing the primary buffer\n");
|
||||||
|
|
|
@ -793,6 +793,8 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
|
||||||
trace(" No Driver\n");
|
trace(" No Driver\n");
|
||||||
else if (rc == DSERR_ALLOCATED)
|
else if (rc == DSERR_ALLOCATED)
|
||||||
trace(" Already In Use\n");
|
trace(" Already In Use\n");
|
||||||
|
else if (rc == E_FAIL)
|
||||||
|
trace(" No Device\n");
|
||||||
else {
|
else {
|
||||||
test_block_align(lpGuid);
|
test_block_align(lpGuid);
|
||||||
test_primary(lpGuid);
|
test_primary(lpGuid);
|
||||||
|
|
|
@ -767,6 +767,8 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
|
||||||
trace(" No Driver\n");
|
trace(" No Driver\n");
|
||||||
else if (rc == DSERR_ALLOCATED)
|
else if (rc == DSERR_ALLOCATED)
|
||||||
trace(" Already In Use\n");
|
trace(" Already In Use\n");
|
||||||
|
else if (rc == E_FAIL)
|
||||||
|
trace(" No Device\n");
|
||||||
else {
|
else {
|
||||||
test_primary8(lpGuid);
|
test_primary8(lpGuid);
|
||||||
test_primary_secondary8(lpGuid);
|
test_primary_secondary8(lpGuid);
|
||||||
|
|
|
@ -51,6 +51,16 @@ DEFINE_GUID(DSPROPSETID_ZOOMFX_BufferProperties, \
|
||||||
|
|
||||||
typedef HRESULT (CALLBACK * MYPROC)(REFCLSID, REFIID, LPVOID *);
|
typedef HRESULT (CALLBACK * MYPROC)(REFCLSID, REFIID, LPVOID *);
|
||||||
|
|
||||||
|
static HRESULT (WINAPI *pDirectSoundCreate8)(LPCGUID,LPDIRECTSOUND8*,
|
||||||
|
LPUNKNOWN)=NULL;
|
||||||
|
static HRESULT (WINAPI *pDirectSoundCaptureCreate)(LPCGUID,
|
||||||
|
LPDIRECTSOUNDCAPTURE*,LPUNKNOWN)=NULL;
|
||||||
|
static HRESULT (WINAPI *pDirectSoundCaptureCreate8)(LPCGUID,
|
||||||
|
LPDIRECTSOUNDCAPTURE8*,LPUNKNOWN)=NULL;
|
||||||
|
static HRESULT (WINAPI *pDirectSoundFullDuplexCreate)(LPCGUID,LPCGUID,
|
||||||
|
LPCDSCBUFFERDESC,LPCDSBUFFERDESC,HWND,DWORD,LPDIRECTSOUNDFULLDUPLEX*,
|
||||||
|
LPDIRECTSOUNDCAPTUREBUFFER8*,LPDIRECTSOUNDBUFFER8*,LPUNKNOWN)=NULL;
|
||||||
|
|
||||||
BOOL CALLBACK callback(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA data,
|
BOOL CALLBACK callback(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA data,
|
||||||
LPVOID context)
|
LPVOID context)
|
||||||
{
|
{
|
||||||
|
@ -117,59 +127,67 @@ static void propset_private_tests()
|
||||||
"returned E_NOINTERFACE, returned: %s\n",DXGetErrorString8(rc));
|
"returned E_NOINTERFACE, returned: %s\n",DXGetErrorString8(rc));
|
||||||
|
|
||||||
/* and the direct sound 8 version */
|
/* and the direct sound 8 version */
|
||||||
rc = (fProc)(&CLSID_DirectSound8, &IID_IClassFactory, (void **)(&pcf));
|
if (pDirectSoundCreate8) {
|
||||||
ok(pcf!=0, "DllGetClassObject(CLSID_DirectSound8, IID_IClassFactory) "
|
rc = (fProc)(&CLSID_DirectSound8, &IID_IClassFactory, (void **)(&pcf));
|
||||||
"failed: %s\n",DXGetErrorString8(rc));
|
ok(pcf!=0, "DllGetClassObject(CLSID_DirectSound8, IID_IClassFactory) "
|
||||||
if (pcf==0)
|
"failed: %s\n",DXGetErrorString8(rc));
|
||||||
goto error;
|
if (pcf==0)
|
||||||
|
goto error;
|
||||||
|
|
||||||
/* direct sound 8 doesn't have an IKsPropertySet */
|
/* direct sound 8 doesn't have an IKsPropertySet */
|
||||||
rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet,
|
rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet,
|
||||||
(void **)(&pps));
|
(void **)(&pps));
|
||||||
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
|
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
|
||||||
"returned E_NOINTERFACE, returned: %s\n",DXGetErrorString8(rc));
|
"returned E_NOINTERFACE, returned: %s\n",DXGetErrorString8(rc));
|
||||||
|
}
|
||||||
|
|
||||||
/* try direct sound capture next */
|
/* try direct sound capture next */
|
||||||
rc = (fProc)(&CLSID_DirectSoundCapture, &IID_IClassFactory,
|
if (pDirectSoundCaptureCreate) {
|
||||||
(void **)(&pcf));
|
rc = (fProc)(&CLSID_DirectSoundCapture, &IID_IClassFactory,
|
||||||
ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundCapture, IID_IClassFactory) "
|
(void **)(&pcf));
|
||||||
"failed: %s\n",DXGetErrorString8(rc));
|
ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundCapture, IID_IClassFactory) "
|
||||||
if (pcf==0)
|
"failed: %s\n",DXGetErrorString8(rc));
|
||||||
goto error;
|
if (pcf==0)
|
||||||
|
goto error;
|
||||||
|
|
||||||
/* direct sound capture doesn't have an IKsPropertySet */
|
/* direct sound capture doesn't have an IKsPropertySet */
|
||||||
rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet,
|
rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet,
|
||||||
(void **)(&pps));
|
(void **)(&pps));
|
||||||
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
|
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
|
||||||
"returned E_NOINTERFACE,returned: %s\n",DXGetErrorString8(rc));
|
"returned E_NOINTERFACE,returned: %s\n",DXGetErrorString8(rc));
|
||||||
|
}
|
||||||
|
|
||||||
/* and the direct sound capture 8 version */
|
/* and the direct sound capture 8 version */
|
||||||
rc = (fProc)(&CLSID_DirectSoundCapture8, &IID_IClassFactory,
|
if (pDirectSoundCaptureCreate8) {
|
||||||
(void **)(&pcf));
|
rc = (fProc)(&CLSID_DirectSoundCapture8, &IID_IClassFactory,
|
||||||
ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundCapture8, "
|
(void **)(&pcf));
|
||||||
"IID_IClassFactory) failed: %s\n",DXGetErrorString8(rc));
|
ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundCapture8, "
|
||||||
if (pcf==0)
|
"IID_IClassFactory) failed: %s\n",DXGetErrorString8(rc));
|
||||||
goto error;
|
if (pcf==0)
|
||||||
|
goto error;
|
||||||
|
|
||||||
/* direct sound capture 8 doesn't have an IKsPropertySet */
|
/* direct sound capture 8 doesn't have an IKsPropertySet */
|
||||||
rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet,
|
rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet,
|
||||||
(void **)(&pps));
|
(void **)(&pps));
|
||||||
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
|
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
|
||||||
"returned E_NOINTERFACE, returned: %s\n",DXGetErrorString8(rc));
|
"returned E_NOINTERFACE, returned: %s\n",DXGetErrorString8(rc));
|
||||||
|
}
|
||||||
|
|
||||||
/* try direct sound full duplex next */
|
/* try direct sound full duplex next */
|
||||||
rc = (fProc)(&CLSID_DirectSoundFullDuplex, &IID_IClassFactory,
|
if (pDirectSoundFullDuplexCreate) {
|
||||||
(void **)(&pcf));
|
rc = (fProc)(&CLSID_DirectSoundFullDuplex, &IID_IClassFactory,
|
||||||
ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundFullDuplex, "
|
(void **)(&pcf));
|
||||||
"IID_IClassFactory) failed: %s\n",DXGetErrorString8(rc));
|
ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundFullDuplex, "
|
||||||
if (pcf==0)
|
"IID_IClassFactory) failed: %s\n",DXGetErrorString8(rc));
|
||||||
goto error;
|
if (pcf==0)
|
||||||
|
goto error;
|
||||||
|
|
||||||
/* direct sound full duplex doesn't have an IKsPropertySet */
|
/* direct sound full duplex doesn't have an IKsPropertySet */
|
||||||
rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet,
|
rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet,
|
||||||
(void **)(&pps));
|
(void **)(&pps));
|
||||||
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
|
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
|
||||||
"returned NOINTERFACE, returned: %s\n",DXGetErrorString8(rc));
|
"returned NOINTERFACE, returned: %s\n",DXGetErrorString8(rc));
|
||||||
|
}
|
||||||
|
|
||||||
/* try direct sound private last */
|
/* try direct sound private last */
|
||||||
rc = (fProc)(&CLSID_DirectSoundPrivate, &IID_IClassFactory,
|
rc = (fProc)(&CLSID_DirectSoundPrivate, &IID_IClassFactory,
|
||||||
|
@ -190,11 +208,14 @@ static void propset_private_tests()
|
||||||
rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
|
rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
|
||||||
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION,
|
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION,
|
||||||
&support);
|
&support);
|
||||||
ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
|
ok(rc==DS_OK||rc==E_INVALIDARG, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
|
||||||
"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION) failed: %s\n",
|
"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION) failed: %s\n",
|
||||||
DXGetErrorString8(rc));
|
DXGetErrorString8(rc));
|
||||||
if (rc!=DS_OK)
|
if (rc!=DS_OK) {
|
||||||
|
if (rc==E_INVALIDARG)
|
||||||
|
trace(" Not Supported\n");
|
||||||
goto error;
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
ok(support & KSPROPERTY_SUPPORT_GET,
|
ok(support & KSPROPERTY_SUPPORT_GET,
|
||||||
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION: "
|
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION: "
|
||||||
|
@ -263,13 +284,15 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
|
||||||
trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule);
|
trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule);
|
||||||
|
|
||||||
rc=DirectSoundCreate(lpGuid,&dso,NULL);
|
rc=DirectSoundCreate(lpGuid,&dso,NULL);
|
||||||
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
|
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
|
||||||
"DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
|
"DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
|
||||||
if (rc!=DS_OK) {
|
if (rc!=DS_OK) {
|
||||||
if (rc==DSERR_NODRIVER)
|
if (rc==DSERR_NODRIVER)
|
||||||
trace(" No Driver\n");
|
trace(" No Driver\n");
|
||||||
else if (rc == DSERR_ALLOCATED)
|
else if (rc == DSERR_ALLOCATED)
|
||||||
trace(" Already In Use\n");
|
trace(" Already In Use\n");
|
||||||
|
else if (rc == E_FAIL)
|
||||||
|
trace(" No Device\n");
|
||||||
goto EXIT;
|
goto EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -403,8 +426,21 @@ static void propset_buffer_tests()
|
||||||
|
|
||||||
START_TEST(propset)
|
START_TEST(propset)
|
||||||
{
|
{
|
||||||
|
HMODULE hDsound;
|
||||||
|
|
||||||
CoInitialize(NULL);
|
CoInitialize(NULL);
|
||||||
|
|
||||||
|
hDsound = LoadLibraryA("dsound.dll");
|
||||||
|
if (!hDsound) {
|
||||||
|
trace("dsound.dll not found\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
pDirectSoundCreate8 = (void*)GetProcAddress(hDsound, "DirectSoundCreate8");
|
||||||
|
pDirectSoundCaptureCreate=(void*)GetProcAddress(hDsound,"DirectSoundCaptureCreate");
|
||||||
|
pDirectSoundCaptureCreate8=(void*)GetProcAddress(hDsound,"DirectSoundCaptureCreate8");
|
||||||
|
pDirectSoundFullDuplexCreate=(void*)GetProcAddress(hDsound,"DirectSoundFullDuplexCreate");
|
||||||
|
|
||||||
propset_private_tests();
|
propset_private_tests();
|
||||||
propset_buffer_tests();
|
propset_buffer_tests();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue