Navigation Menu

Skip to content

Commit

Permalink
b4302 -- Устранение запроса повышения привилегий при посмотре файла н…
Browse files Browse the repository at this point in the history
…а флэшке с NTFS под Win Server 2008 R2 SP1
  • Loading branch information
w17 committed Mar 11, 2015
1 parent 1268b3d commit 49ab160
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
13 changes: 7 additions & 6 deletions far/cddrv.cpp
Expand Up @@ -38,6 +38,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "drivemix.hpp"
#include "flink.hpp"
#include "pathmix.hpp"
#include "elevation.hpp"

enum CDROM_DeviceCapabilities
{
Expand Down Expand Up @@ -440,20 +441,20 @@ UINT FAR_GetDriveType(const string& RootDir, DWORD Detect)
string drive = HasPathPrefix(strRootDir) ? strRootDir : L"\\\\?\\" + strRootDir;
DeleteEndSlash(drive);

SCOPED_ACTION(elevation::suppress);

DrvType = DRIVE_USBDRIVE; // default type if detection failed

api::fs::file Device;
if (Device.Open(drive, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, nullptr, OPEN_EXISTING))
{
DISK_GEOMETRY g;
DWORD dwOutBytes;
if (Device.IoControl(IOCTL_DISK_GET_DRIVE_GEOMETRY, nullptr, 0, &g, sizeof(g), &dwOutBytes, nullptr))
if ( g.MediaType == FixedMedia || g.MediaType == RemovableMedia )
DrvType = DRIVE_USBDRIVE;
if (g.MediaType != FixedMedia && g.MediaType != RemovableMedia)
DrvType = DRIVE_REMOVABLE;
}
}
// if((Detect&2) && IsDriveUsb(*LocalName,nullptr)) //DrvType == DRIVE_REMOVABLE
// DrvType=DRIVE_USBDRIVE;
// if((Detect&4) && GetSubstName(DrvType,LocalName,nullptr,0))
// DrvType=DRIVE_SUBSTITUTE;

return DrvType;
}
6 changes: 5 additions & 1 deletion far/changelog
@@ -1,4 +1,8 @@
w17 11.03.2015 13:20:04 +0300 - build 4301
w17 11.03.2015 15:50:45 +0300 - build 4302

1. Устранение запроса повышения привилегий при посмотре файла на флэшке с NTFS под Win Server 2008 R2 SP1

w17 11.03.2015 13:20:04 +0300 - build 4301

1. Уточнение 4279.

Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
@@ -1 +1 @@
m4_define(BUILD,4301)m4_dnl
m4_define(BUILD,4302)m4_dnl

0 comments on commit 49ab160

Please sign in to comment.