<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Hello,<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">On Tue, Jul 25, 2017 at 5:48 PM, Alistair Leslie-Hughes <span dir="ltr"><<a href="mailto:leslie_alistair@hotmail.com" target="_blank">leslie_alistair@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jefferson,<br>
><br>
> +typedef struct {<br>
> +    IWMReaderCallback IWMReaderCallback_iface;<br>
> +    LONG ref;<br>
> +    HRESULT (*onStatusCallback)(WMT_<wbr>STATUS, HRESULT, WMT_ATTR_DATATYPE, BYTE*, void*, void*);<br>
> +    HRESULT (*onSampleCallback)(DWORD, QWORD, QWORD, DWORD, INSSBuffer*, void*, void*);<br>
> +    void *pvCallbackContext;<br>
> +} TestWMReaderCallback;<br>
<br>
I'm still a little confused as to why you need this structure when the<br>
IWMReaderCallbackVtbl with a few globals would work just as well.<br></blockquote><div><br></div><div>Well, I it could be useful to only implement QueryInterface, AddRef, and Release once, and use dependency injection to supply the other methods to the vtable.  I wasn't sure whether I was over-engineering that, however.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> +static HRESULT onStatus_test_wmreader_play_<wbr>wma(<br>
> +    WMT_STATUS status,<br>
> +    HRESULT hr,<br>
> +    WMT_ATTR_DATATYPE dwType,<br>
> +    BYTE *pValue,<br>
> +    void *pvContext,<br>
> +    void *pvCallbackContext)<br>
> +{<br>
> +    struct callback_context_test_<wbr>wmreader_play_wma *pTestContext =<br>
> +        (struct callback_context_test_<wbr>wmreader_play_wma*)<wbr>pvCallbackContext;<br>
> +    DWORD *dwordValue;<br>
> +<br>
> +    CHECK_EXPECT(onStatus);<br>
> +    ok(status == onStatus_expected_statuses_<wbr>test_wmreader_play_wma[<wbr>pTestContext->onStatus_call_<wbr>count],<br>
> +       "onStatus called with unexpected status: %d\n", status);<br>
> +    if (status == WMT_OPENED) {<br>
> +        ok(pvContext == pTestContext->pvContextOpen,<br>
> +           "onStatus was not passed pvContext: expected %p, actual %p\n", pTestContext->pvContextOpen, pvContext);<br>
> +    }<br>
> +    else /* status == WMT_STARTED, or later */ {<br>
> +        ok(pvContext == pTestContext->pvContextStart,<br>
> +           "onStatus was not passed pvContext: expected %p, actual %p\n", pTestContext->pvContextStart, pvContext);<br>
> +    }<br>
> +    switch (status) {<br>
> +    case WMT_STARTED:<br>
> +        // MSDN says dwType is a QWORD, but it is actually a DWORD<br>
> +        ok(dwType == WMT_TYPE_DWORD, "onStatus pValue not WMT_TYPE_QWORD (%d), but %d\n", (int)WMT_TYPE_DWORD, dwType);<br>
WMT_TYPE_QWORD typo?<br>
<br>
> +        dwordValue = (DWORD*)pValue;<br>
> +        ok(*dwordValue == 0, "onStatus call for WMT_STARTED not passed correct starting timestamp: %u\n", *dwordValue);<br>
> +        SET_EXPECT(onSample);<br>
> +        break;<br>
> +    default:<br>
> +        break;<br>
> +    }<br>
The switch and if could be merged<br></blockquote><div><br></div><div>Very well.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
> +    /* Get format count. */<br>
> +    formatCount = 0;<br>
> +    hr = IWMReader_<wbr>GetOutputFormatCount(reader, 0, &formatCount);<br>
> +    todo_wine ok(hr == S_OK, "Failed to get output format count: 0x%08x\n", hr);<br>
formatCount should be checked<br>
<br></blockquote><div><br></div><div>Okay - I'll have the test check that formatCount is equal to 37.  That's the format count that I get on my windows machine.  The number 37 seems oddly specific; I'm not sure how much wiggle room wmvcore implementations have to provide varying sets of formats.  However it would be best if wine's were identical to the Windows behavior, obviously.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Best Regards<br>
<span class="HOEnZb"><font color="#888888"> Alistair Leslie-Hughes<br>
</font></span></blockquote></div><br></div></div>