Skip to content

Commit

Permalink
Prevent QAAC from failing horribly with error "The process cannot acc…
Browse files Browse the repository at this point in the history
…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 ad1e0ea
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions win32util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ad1e0ea

Please sign in to comment.