[core] relax the FILE_SHARE_WRITE rules during enumeration

* Should allow enumeration of drives, that other process have open
  with RW access, back again (looking at you, Paragon!!!)
This commit is contained in:
Pete Batard 2017-05-02 00:56:07 +01:00
parent 3b4b742772
commit 23390bf911
5 changed files with 18 additions and 19 deletions

View file

@ -654,8 +654,8 @@ BOOL GetDevices(DWORD devnum)
continue;
}
hDrive = CreateFileA(devint_detail_data->DevicePath, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
hDrive = CreateFileA(devint_detail_data->DevicePath, GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if(hDrive == INVALID_HANDLE_VALUE) {
uprintf("Could not open '%s': %s\n", devint_detail_data->DevicePath, WindowsErrorString());
continue;