James Hawkins : msi: Verify the szFilePath parameter of MsiGetFileHash.
Alexandre Julliard
julliard at winehq.org
Mon Nov 26 08:16:17 CST 2007
Module: wine
Branch: master
Commit: e10028893472cbc63489515222b5d7d67d505c74
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e10028893472cbc63489515222b5d7d67d505c74
Author: James Hawkins <truiken at gmail.com>
Date: Sun Nov 25 17:58:57 2007 -0600
msi: Verify the szFilePath parameter of MsiGetFileHash.
---
dlls/msi/msi.c | 6 ++++++
dlls/msi/tests/msi.c | 10 ++--------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c
index 7faccaf..72e52af 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 40de221..2e5dc85 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);
More information about the wine-cvs
mailing list