mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-20 18:05:21 -04:00
[core] fix "Requesting Disk Access" issue with Syslinux/NTFS
* See http://reboot.pro/topic/17902-rufus-v130-has-been-released/?p=190958 * Also fix non continuation of format operation after Syslinux has been downloaded * Also fix missing Syslinux installation for ReactOS
This commit is contained in:
parent
d22933636c
commit
785150dcb2
5 changed files with 40 additions and 84 deletions
|
@ -93,52 +93,6 @@ DWORD M_NTFSSECT_API NtfsSectGetFileVcnExtent(
|
|||
return rc;
|
||||
}
|
||||
|
||||
/* Internal use only */
|
||||
static DWORD NtfsSectGetVolumeHandle(
|
||||
CHAR * VolumeName,
|
||||
S_NTFSSECT_VOLINFO * VolumeInfo
|
||||
) {
|
||||
#define M_VOL_PREFIX "\\\\.\\"
|
||||
CHAR volname[sizeof M_VOL_PREFIX - 1 + MAX_PATH + 1] = M_VOL_PREFIX;
|
||||
CHAR * const volname_short = volname + sizeof M_VOL_PREFIX - 1;
|
||||
CHAR * c;
|
||||
DWORD rc;
|
||||
|
||||
/* Prefix "\\.\" onto the passed volume name */
|
||||
strcpy(volname + sizeof M_VOL_PREFIX - 1, VolumeName);
|
||||
|
||||
/* Find the last non-null character */
|
||||
for (c = volname_short; *c; ++c)
|
||||
;
|
||||
|
||||
/* Remove trailing back-slash */
|
||||
if (c[-1] == '\\')
|
||||
c[-1] = 0;
|
||||
|
||||
/* Open the volume */
|
||||
VolumeInfo->Handle = CreateFileA(
|
||||
volname,
|
||||
GENERIC_READ,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||
NULL,
|
||||
OPEN_EXISTING,
|
||||
0,
|
||||
NULL
|
||||
);
|
||||
rc = GetLastError();
|
||||
if (VolumeInfo->Handle == INVALID_HANDLE_VALUE) {
|
||||
M_ERR("Unable to open volume handle!");
|
||||
goto err_handle;
|
||||
}
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
|
||||
CloseHandle(VolumeInfo->Handle);
|
||||
err_handle:
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
DWORD M_NTFSSECT_API NtfsSectGetVolumeInfo(
|
||||
CHAR * VolumeName,
|
||||
S_NTFSSECT_VOLINFO * VolumeInfo
|
||||
|
@ -150,10 +104,6 @@ DWORD M_NTFSSECT_API NtfsSectGetVolumeInfo(
|
|||
if (!VolumeName || !VolumeInfo)
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
|
||||
rc = NtfsSectGetVolumeHandle(VolumeName, VolumeInfo);
|
||||
if (rc != ERROR_SUCCESS)
|
||||
goto err_handle;
|
||||
|
||||
rc = NtfsSectLoadXpFuncs(&xp_funcs);
|
||||
if (rc != ERROR_SUCCESS)
|
||||
goto err_xp_funcs;
|
||||
|
@ -189,7 +139,6 @@ DWORD M_NTFSSECT_API NtfsSectGetVolumeInfo(
|
|||
CloseHandle(VolumeInfo->Handle);
|
||||
VolumeInfo->Handle = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
err_handle:
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue