Signed-off-by: Esme Povirk esme@codeweavers.com --- Let's Build a Zoo on Steam creates a temporary file and expects to be able to delete it while playing it.
dlls/mfplat/main.c | 2 +- dlls/mfplat/tests/mfplat.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 37a66798b2f..c36a2069bd8 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -4407,7 +4407,7 @@ HRESULT WINAPI MFCreateFile(MF_FILE_ACCESSMODE accessmode, MF_FILE_OPENMODE open { DWORD capabilities = MFBYTESTREAM_IS_SEEKABLE | MFBYTESTREAM_DOES_NOT_USE_NETWORK; DWORD filecreation_disposition = 0, fileaccessmode = 0, fileattributes = 0; - DWORD filesharemode = FILE_SHARE_READ; + DWORD filesharemode = FILE_SHARE_READ | FILE_SHARE_DELETE; struct bytestream *object; FILETIME writetime; HANDLE file; diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 541459c715b..0f928284534 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -2077,10 +2077,14 @@ static void test_file_stream(void) hr = MFCreateFile(MF_ACCESSMODE_READ, MF_OPENMODE_FAIL_IF_NOT_EXIST, MF_FILEFLAGS_NONE, pathW, &bytestream); ok(FAILED(hr), "Unexpected hr %#x.\n", hr);
+ hr = MFCreateFile(MF_ACCESSMODE_READ, MF_OPENMODE_FAIL_IF_NOT_EXIST, MF_FILEFLAGS_NONE, filename, &bytestream); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(DeleteFileW(filename), "failed to delete file\n"); + IMFByteStream_Release(bytestream); + hr = MFShutdown(); ok(hr == S_OK, "Failed to shut down, hr %#x.\n", hr);
- DeleteFileW(filename); DeleteFileW(newfilename); }