diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index 7faccaf3afd..72e52afa87b 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -2277,6 +2277,12 @@ UINT WINAPI MsiGetFileHashW( LPCWSTR szFilePath, DWORD dwOptions, TRACE("%s %08x %p\n", debugstr_w(szFilePath), dwOptions, pHash ); + if (!szFilePath) + return ERROR_INVALID_PARAMETER; + + if (!*szFilePath) + return ERROR_PATH_NOT_FOUND; + if (dwOptions) return ERROR_INVALID_PARAMETER; if (!pHash) diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c index 40de221f226..2e5dc85ec46 100644 --- a/dlls/msi/tests/msi.c +++ b/dlls/msi/tests/msi.c @@ -287,17 +287,11 @@ static void test_MsiGetFileHash(void) /* szFilePath is NULL */ r = pMsiGetFileHashA(NULL, 0, &hash); - 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); /* szFilePath is empty */ r = pMsiGetFileHashA("", 0, &hash); - todo_wine - { - ok(r == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %d\n", r); - } + ok(r == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %d\n", r); /* szFilePath is nonexistent */ r = pMsiGetFileHashA(name, 0, &hash);