Signed-off-by: Sergio Gómez Del Real sdelreal@codeweavers.com --- dlls/mfplat/main.c | 2 +- dlls/mfplat/tests/mfplat.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 923905399b..32f367a00e 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -901,7 +901,7 @@ static HRESULT mft_register_local(IClassFactory *factory, REFCLSID clsid, REFGUI
LIST_FOR_EACH_ENTRY(cur, &local_mfts, struct mft_registration, entry) { - if (cur->factory == factory) + if (factory && cur->factory == factory) { unreg_mft = cur; list_remove(&cur->entry); diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 007db891c1..4d3d4a72a0 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -4528,6 +4528,17 @@ static void test_MFTRegisterLocal(void)
hr = pMFTUnregisterLocalByCLSID(MFT_CATEGORY_OTHER); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + hr = pMFTRegisterLocalByCLSID(&MFT_CATEGORY_OTHER, &MFT_CATEGORY_OTHER, L"Local MFT name 1", 0, 1, input_types, + 0, NULL); + ok(hr == S_OK, "Failed to register MFT, hr %#x.\n", hr); + hr = pMFTRegisterLocalByCLSID(&MFT_CATEGORY_OTHER, &MFT_CATEGORY_OTHER, L"Local MFT name 2", 0, 1, input_types, + 0, NULL); + ok(hr == S_OK, "Failed to register MFT, hr %#x.\n", hr); + hr = pMFTEnumEx(MFT_CATEGORY_OTHER, MFT_ENUM_FLAG_LOCALMFT, NULL, NULL, &activate, &count); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(count == 2, "Unexpected count %u.\n", count); + CoTaskMemFree(activate); }
static void test_queue_com(void)