예제 #1
0
파일: oleobj.c 프로젝트: AmesianX/wine
static void test_wmp_ifaces(IOleObject *oleobj)
{
    IWMPSettings *settings, *settings_qi;
    IWMPPlayer4 *player4;
    HRESULT hres;

    hres = IOleObject_QueryInterface(oleobj, &IID_IWMPPlayer4, (void**)&player4);
    ok(hres == S_OK, "Could not get IWMPPlayer4 iface: %08x\n", hres);

    settings = NULL;
    hres = IWMPPlayer4_get_settings(player4, &settings);
    ok(hres == S_OK, "get_settings failed: %08x\n", hres);
    ok(settings != NULL, "settings = NULL\n");

    hres = IOleObject_QueryInterface(oleobj, &IID_IWMPSettings, (void**)&settings_qi);
    ok(hres == S_OK, "Could not get IWMPSettings iface: %08x\n", hres);
    ok(settings == settings_qi, "settings != settings_qi\n");
    IWMPSettings_Release(settings_qi);

    IWMPSettings_Release(settings);
    IWMPPlayer4_Release(player4);
}
예제 #2
0
파일: oleobj.c 프로젝트: ccpgames/wine
static void test_wmp_ifaces(IOleObject *oleobj)
{
    IWMPSettings *settings, *settings_qi;
    IWMPPlayer4 *player4;
    IWMPPlayer *player;
    IWMPMedia *media;
    IWMPControls *controls;
    VARIANT_BOOL vbool;
    IWMPNetwork *network;
    HRESULT hres;
    BSTR filename;
    BSTR url;

    hres = IOleObject_QueryInterface(oleobj, &IID_IWMPPlayer4, (void**)&player4);
    ok(hres == S_OK, "Could not get IWMPPlayer4 iface: %08x\n", hres);

    controls = NULL;
    hres = IWMPPlayer4_get_controls(player4, &controls);
    ok(hres == S_OK, "get_controls failed: %08x\n", hres);
    ok(controls != NULL, "controls = NULL\n");

    player = NULL;
    hres = IWMPControls_QueryInterface(controls, &IID_IWMPPlayer, (void**)&player);
    ok(hres != S_OK, "Getting IWMPPlayer from IWMPControls SUCCEEDED\n");
    ok(player == NULL, "player != NULL\n");

    IWMPControls_Release(controls);

    /* IWPNetwork */
    network = NULL;
    hres = IWMPPlayer4_get_network(player4, &network);
    ok(hres == S_OK, "get_network failed: %08x\n", hres);
    ok(network != NULL, "network = NULL\n");

    player = NULL;
    hres = IWMPNetwork_QueryInterface(network, &IID_IWMPPlayer, (void**)&player);
    ok(hres != S_OK, "Getting IWMPPlayer from IWMPNetwork SUCCEEDED\n");
    ok(player == NULL, "player != NULL\n");

    IWMPNetwork_Release(network);

    media = NULL;
    hres = IWMPPlayer4_QueryInterface(player4, &IID_IWMPMedia, (void**)&media);
    ok(hres == E_NOINTERFACE, "get_currentMedia SUCCEEDED: %08x\n", hres);
    ok(media == NULL, "media != NULL\n");

    /* Test media put/get */
    media = NULL;
    hres = IWMPPlayer4_get_currentMedia(player4, &media);
    ok(hres == S_FALSE, "get_currentMedia SUCCEEDED\n");
    ok(media == NULL, "media != NULL\n");

    filename = SysAllocString(load_resource(mp3file));

    SET_EXPECT(GetContainer);
    SET_EXPECT(Invoke_USERMODE);
    hres = IWMPPlayer4_put_URL(player4, filename);
    ok(hres == S_OK, "IWMPPlayer4_put_URL failed: %08x\n", hres);
    todo_wine CHECK_CALLED_OR_BROKEN(GetContainer);
    todo_wine CHECK_CALLED(Invoke_USERMODE);

    url = NULL;
    SET_EXPECT(Invoke_USERMODE);
    hres = IWMPPlayer4_get_URL(player4, &url);
    ok(hres == S_OK, "IWMPPlayer4_get_URL failed: %08x\n", hres);
    ok(0 == lstrcmpW(url, filename), "%s != %s\n", wine_dbgstr_w(url), wine_dbgstr_w(filename));
    todo_wine CHECK_CALLED(Invoke_USERMODE);
    SysFreeString(url);

    hres = IWMPPlayer4_get_currentMedia(player4, &media);
    ok(hres == S_OK, "get_currentMedia failed: %08x\n", hres);
    ok(media != NULL, "media = (%p)\n", media);

    url = NULL;
    hres = IWMPMedia_get_sourceURL(media, &url);
    ok(hres == S_OK, "IWMPMedia_get_sourceURL failed: %08x\n", hres);
    ok(0 == lstrcmpW(url, filename), "%s != %s\n", wine_dbgstr_w(url), wine_dbgstr_w(filename));
    SysFreeString(url);

    SET_EXPECT(GetContainer);
    hres = IWMPPlayer4_put_currentMedia(player4, media);
    ok(hres == S_OK, "put_currentMedia failed: %08x\n", hres);
    todo_wine CHECK_CALLED_OR_BROKEN(GetContainer);

    IWMPMedia_Release(media);

    hres = IWMPPlayer4_get_currentMedia(player4, &media);
    ok(hres == S_OK, "get_currentMedia failed: %08x\n", hres);
    ok(media != NULL, "media = (%p)\n", media);

    IWMPMedia_Release(media);

    settings = NULL;
    hres = IWMPPlayer4_get_settings(player4, &settings);
    ok(hres == S_OK, "get_settings failed: %08x\n", hres);
    ok(settings != NULL, "settings = NULL\n");

    hres = IOleObject_QueryInterface(oleobj, &IID_IWMPSettings, (void**)&settings_qi);
    ok(hres == S_OK, "Could not get IWMPSettings iface: %08x\n", hres);
    ok(settings == settings_qi, "settings != settings_qi\n");
    IWMPSettings_Release(settings_qi);

    /* Test few settings put/gets */
    hres = IWMPSettings_get_autoStart(settings, &vbool);
    ok(hres == S_OK, "Could not get autoStart from IWMPSettings: %08x\n", hres);
    ok(vbool == VARIANT_TRUE, "autoStart = %x\n", vbool);
    hres = IWMPSettings_put_autoStart(settings, VARIANT_FALSE);
    ok(hres == S_OK, "Could not put autoStart in IWMPSettings: %08x\n", hres);
    hres = IWMPSettings_get_autoStart(settings, &vbool);
    ok(hres == S_OK, "Could not get autoStart from IWMPSettings: %08x\n", hres);
    ok(!vbool, "autoStart = %x\n", vbool);

    hres = IWMPSettings_get_invokeURLs(settings, &vbool);
    ok(hres == S_OK, "Could not get invokeURLs from IWMPSettings: %08x\n", hres);
    ok(vbool == VARIANT_TRUE, "invokeURLs = %x\n", vbool);
    hres = IWMPSettings_put_invokeURLs(settings, VARIANT_FALSE);
    ok(hres == S_OK, "Could not put invokeURLs in IWMPSettings: %08x\n", hres);
    hres = IWMPSettings_get_invokeURLs(settings, &vbool);
    ok(hres == S_OK, "Could not get invokeURLs from IWMPSettings: %08x\n", hres);
    ok(!vbool, "invokeURLs = %x\n", vbool);

    hres = IWMPSettings_get_enableErrorDialogs(settings, &vbool);
    ok(hres == S_OK, "Could not get enableErrorDialogs from IWMPSettings: %08x\n", hres);
    ok(vbool == VARIANT_FALSE, "enableErrorDialogs = %x\n", vbool);
    hres = IWMPSettings_put_enableErrorDialogs(settings, VARIANT_TRUE);
    ok(hres == S_OK, "Could not put enableErrorDialogs in IWMPSettings: %08x\n", hres);
    hres = IWMPSettings_get_enableErrorDialogs(settings, &vbool);
    ok(hres == S_OK, "Could not get enableErrorDialogs from IWMPSettings: %08x\n", hres);
    ok(vbool == VARIANT_TRUE, "enableErrorDialogs = %x\n", vbool);

    IWMPSettings_Release(settings);
    IWMPPlayer4_Release(player4);

    hres = IOleObject_QueryInterface(oleobj, &IID_IWMPPlayer, (void**)&player);
    ok(hres == S_OK, "Could not get IWMPPlayer iface: %08x\n", hres);

    settings = NULL;
    hres = IWMPPlayer_get_settings(player, &settings);
    ok(hres == S_OK, "get_settings failed: %08x\n", hres);
    ok(settings != NULL, "settings = NULL\n");

    hres = IOleObject_QueryInterface(oleobj, &IID_IWMPSettings, (void**)&settings_qi);
    ok(hres == S_OK, "Could not get IWMPSettings iface: %08x\n", hres);
    ok(settings == settings_qi, "settings != settings_qi\n");
    IWMPSettings_Release(settings_qi);

    IWMPSettings_Release(settings);
    IWMPPlayer_Release(player);
    DeleteFileW(filename);
    SysFreeString(filename);
}