Permalink
Browse files

Prevent QAAC from failing horribly with error "The process cannot acc…

…ess the file because it is being used by another process." when the "--artwork" option is used and the specified artwork file is currently open for **READING** by another application.
  • Loading branch information...
lordmulder committed Dec 25, 2014
1 parent 4108c21 commit ad1e0ea9daed076531e96cfa3b82f290ba9eeb20
Showing with 1 addition and 2 deletions.
  1. +1 −2 win32util.cpp
View
@@ -60,8 +60,7 @@ namespace win32 {
char *load_with_mmap(const wchar_t *path, uint64_t *size)
{
std::wstring fullpath = prefixed_path(path);
- HANDLE hFile = CreateFileW(fullpath.c_str(), GENERIC_READ,
- 0, 0, OPEN_EXISTING, 0, 0);
+ HANDLE hFile = CreateFileW(fullpath.c_str(), GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
if (hFile == INVALID_HANDLE_VALUE)
throw_error(fullpath, GetLastError());
DWORD sizeHi, sizeLo;

0 comments on commit ad1e0ea

Please sign in to comment.