[PATCH 1/4] winmm: Set error when mmioOpen(MMIO_EXIST) is called with non-existant path.

Gijs Vermeulen gijsvrm at gmail.com
Mon Jan 18 14:45:31 CST 2021


Signed-off-by: Gijs Vermeulen <gijsvrm at gmail.com>
---
 dlls/winmm/mmio.c       | 3 +++
 dlls/winmm/tests/mmio.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/winmm/mmio.c b/dlls/winmm/mmio.c
index 1255cf69da2..1d755ea82b8 100644
--- a/dlls/winmm/mmio.c
+++ b/dlls/winmm/mmio.c
@@ -650,7 +650,10 @@ static HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlags,
 	if (GetFullPathNameA(szFileName, sizeof(buffer), buffer, NULL) >= sizeof(buffer))
 	    return (HMMIO)FALSE;
 	if ((dwOpenFlags & MMIO_EXIST) && (GetFileAttributesA(buffer) == INVALID_FILE_ATTRIBUTES))
+	{
+	    refmminfo->wErrorRet = MMIOERR_FILENOTFOUND;
 	    return (HMMIO)FALSE;
+	}
 	strcpy(szFileName, buffer);
 	return (HMMIO)TRUE;
     }
diff --git a/dlls/winmm/tests/mmio.c b/dlls/winmm/tests/mmio.c
index a232070064c..cfe917e8b38 100644
--- a/dlls/winmm/tests/mmio.c
+++ b/dlls/winmm/tests/mmio.c
@@ -565,7 +565,7 @@ static void test_mmioOpen_create(void)
     info.wErrorRet = 0xdead;
     hmmio = mmioOpenW(buffer, &info, MMIO_EXIST);
     ok(hmmio == (HMMIO)FALSE, "file should exist\n");
-    todo_wine ok(info.wErrorRet == MMIOERR_FILENOTFOUND, "got error %#x\n", info.wErrorRet);
+    ok(info.wErrorRet == MMIOERR_FILENOTFOUND, "got error %#x\n", info.wErrorRet);
 
     ret = DeleteFileA("test_mmio_path");
     ok(!ret, "expected failure\n");
-- 
2.30.0




More information about the wine-devel mailing list