mmdevapi/tests: Fix tests on win8

André Hentschel nerv at dawncrow.de
Thu Dec 6 05:54:44 CST 2012


---
 dlls/mmdevapi/tests/capture.c | 2 +-
 dlls/mmdevapi/tests/render.c  | 8 ++++----
 include/audioclient.idl       | 6 ++++++
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/dlls/mmdevapi/tests/capture.c b/dlls/mmdevapi/tests/capture.c
index d64b6a3..feedfde 100644
--- a/dlls/mmdevapi/tests/capture.c
+++ b/dlls/mmdevapi/tests/capture.c
@@ -559,7 +559,7 @@ static void test_audioclient(void)
     ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Initialize with invalid sharemode returns %08x\n", hr);
 
     hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0xffffffff, 5000000, 0, pwfx, NULL);
-    ok(hr == E_INVALIDARG, "Initialize with invalid flags returns %08x\n", hr);
+    ok(hr == E_INVALIDARG || hr == AUDCLNT_E_INVALID_STREAM_FLAG, "Initialize with invalid flags returns %08x\n", hr);
 
     /* A period != 0 is ignored and the call succeeds.
      * Since we can only initialize successfully once, skip those tests.
diff --git a/dlls/mmdevapi/tests/render.c b/dlls/mmdevapi/tests/render.c
index 9d9478a..efe9729 100644
--- a/dlls/mmdevapi/tests/render.c
+++ b/dlls/mmdevapi/tests/render.c
@@ -249,7 +249,7 @@ static void test_audioclient(void)
     ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Initialize with invalid sharemode returns %08x\n", hr);
 
     hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0xffffffff, 5000000, 0, pwfx, NULL);
-    ok(hr == E_INVALIDARG, "Initialize with invalid flags returns %08x\n", hr);
+    ok(hr == E_INVALIDARG || hr == AUDCLNT_E_INVALID_STREAM_FLAG, "Initialize with invalid flags returns %08x\n", hr);
 
     /* A period != 0 is ignored and the call succeeds.
      * Since we can only initialize successfully once, skip those tests.
@@ -449,9 +449,9 @@ static void test_formats(AUDCLNT_SHAREMODE mode)
              * Some cards Initialize 44100|48000x16x1 yet claim no support;
              * F. Gouget's w7 bots do that for 12000|96000x8|16x1|2 */
             ok(hrs == S_OK ? hr == S_OK || broken(hr == AUDCLNT_E_ENDPOINT_CREATE_FAILED)
-               : hr == AUDCLNT_E_ENDPOINT_CREATE_FAILED || broken(hr == S_OK &&
-                   ((fmt.nChannels == 1 && fmt.wBitsPerSample == 16) ||
-                    (fmt.nSamplesPerSec == 12000 || fmt.nSamplesPerSec == 96000))),
+               : hr == AUDCLNT_E_ENDPOINT_CREATE_FAILED || hr == AUDCLNT_E_UNSUPPORTED_FORMAT ||
+               broken(hr == S_OK && ((fmt.nChannels == 1 && fmt.wBitsPerSample == 16) ||
+               (fmt.nSamplesPerSec == 12000 || fmt.nSamplesPerSec == 96000))),
                "Initialize(exclus., %ux%2ux%u) returns %08x\n",
                fmt.nSamplesPerSec, fmt.wBitsPerSample, fmt.nChannels, hr);
 
diff --git a/include/audioclient.idl b/include/audioclient.idl
index 8050ea6..a755604 100644
--- a/include/audioclient.idl
+++ b/include/audioclient.idl
@@ -315,6 +315,12 @@ cpp_quote("#define AUDCLNT_E_BUFFER_ERROR AUDCLNT_ERR(0x18)")
 cpp_quote("#define AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED AUDCLNT_ERR(0x19)")
 /* Hex fail */
 cpp_quote("#define AUDCLNT_E_INVALID_DEVICE_PERIOD AUDCLNT_ERR(0x20)")
+cpp_quote("#define AUDCLNT_E_INVALID_STREAM_FLAG AUDCLNT_ERR(0x021)")
+cpp_quote("#define AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE AUDCLNT_ERR(0x022)")
+cpp_quote("#define AUDCLNT_E_OUT_OF_OFFLOAD_RESOURCES AUDCLNT_ERR(0x023)")
+cpp_quote("#define AUDCLNT_E_OFFLOAD_MODE_ONLY AUDCLNT_ERR(0x024)")
+cpp_quote("#define AUDCLNT_E_NONOFFLOAD_MODE_ONLY AUDCLNT_ERR(0x025)")
+cpp_quote("#define AUDCLNT_E_RESOURCES_INVALIDATED AUDCLNT_ERR(0x026)")
 
 cpp_quote("#define AUDCLNT_S_BUFFER_EMPTY AUDCLNT_SUCCESS(0x1)")
 cpp_quote("#define AUDCLNT_S_THREAD_ALREADY_REGISTERED AUDCLNT_SUCCESS(0x2)")
-- 
1.8.0



-- 

Best Regards, André Hentschel


More information about the wine-patches mailing list