Check for existence if MMIO_EXIST is passed to MMIO_Open.

This commit is contained in:
Ulrich Czekalla 2000-03-07 12:23:11 +00:00 committed by Alexandre Julliard
parent 7d50ae6f80
commit 1e899dfa2e
1 changed files with 3 additions and 1 deletions

View File

@ -345,11 +345,13 @@ static HMMIO16 MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlag
TRACE("('%s', %p, %08lX, %d);\n", szFileName, refmminfo, dwOpenFlags, b32bit?32:16);
if (dwOpenFlags & MMIO_PARSE) {
if (dwOpenFlags & (MMIO_PARSE|MMIO_EXIST)) {
char buffer[MAX_PATH];
if (GetFullPathNameA(szFileName, sizeof(buffer), buffer, NULL) >= sizeof(buffer))
return (HMMIO16)FALSE;
if ((dwOpenFlags&MMIO_EXIST)&&(GetFileAttributesA(buffer)==-1))
return (HMMIO16)FALSE;
strcpy(szFileName, buffer);
return (HMMIO16)TRUE;
}