Ignore:
Timestamp:
Sep 27, 2002, 3:58:24 PM (23 years ago)
Author:
sandervl
Message:

Disable physical disk & volume access by default; call EnablePhysicalDiskAccess to enable it (custom build)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/hmdisk.cpp

    r9300 r9302  
    1 /* $Id: hmdisk.cpp,v 1.54 2002-09-27 13:42:48 sandervl Exp $ */
     1/* $Id: hmdisk.cpp,v 1.55 2002-09-27 13:58:24 sandervl Exp $ */
    22
    33/*
     
    2525#include "oslibcdio.h"
    2626#include "asmutil.h"
     27#include <custombuild.h>
    2728
    2829#define DBG_LOCALLOG    DBG_hmdisk
     
    6263} DRIVE_INFO;
    6364
     65static BOOL fPhysicalDiskAccess = FALSE;
     66
     67//******************************************************************************
     68//******************************************************************************
     69void WIN32API EnablePhysicalDiskAccess(BOOL fEnable)
     70{
     71    fPhysicalDiskAccess = fEnable;
     72}
     73//******************************************************************************
     74//******************************************************************************
    6475HMDeviceDiskClass::HMDeviceDiskClass(LPCSTR lpDeviceName) : HMDeviceKernelObjectClass(lpDeviceName)
    6576{
     
    155166        int length;
    156167
    157         if(!VERSION_IS_WIN2000_OR_HIGHER()) {
     168        if(!VERSION_IS_WIN2000_OR_HIGHER() || !fPhysicalDiskAccess) {
    158169            return ERROR_FILE_NOT_FOUND;    //not allowed
    159170        }
     
    201212    if(strncmp(lpFileName, "\\\\.\\PHYSICALDRIVE", 17) == 0)
    202213    {
     214        if(!fPhysicalDiskAccess) {
     215            return ERROR_FILE_NOT_FOUND;    //not allowed
     216        }
     217
    203218        //Note: this only works on Warp 4.5 and up
    204219        sprintf(szDiskName, "\\\\.\\Physical_Disk%c", lpFileName[17]+1);
Note: See TracChangeset for help on using the changeset viewer.