diff --git a/dlls/msi/source.c b/dlls/msi/source.c index d1845379a55..f7dcf265e2a 100644 --- a/dlls/msi/source.c +++ b/dlls/msi/source.c @@ -606,6 +606,9 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid, if (!szSource || !*szSource) return ERROR_INVALID_PARAMETER; + if (!(dwOptions & (MSISOURCETYPE_NETWORK | MSISOURCETYPE_URL))) + return ERROR_INVALID_PARAMETER; + if (dwOptions & MSICODE_PATCH) { FIXME("Unhandled options MSICODE_PATCH\n"); diff --git a/dlls/msi/tests/source.c b/dlls/msi/tests/source.c index d81a29aeea9..bbef689674a 100644 --- a/dlls/msi/tests/source.c +++ b/dlls/msi/tests/source.c @@ -594,18 +594,12 @@ static void test_MsiSourceListAddSourceEx(void) r = pMsiSourceListAddSourceExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, "source", 0); - todo_wine - { - ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); - } + ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); r = pMsiSourceListAddSourceExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PATCH, "source", 0); - todo_wine - { - ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); - } + ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); /* NULL szSource */ r = pMsiSourceListAddSourceExA(prodcode, usersid,