Changeset 8397 for trunk/src


Ignore:
Timestamp:
May 9, 2002, 3:55:35 PM (23 years ago)
Author:
sandervl
Message:

volume api updates (LVM)

Location:
trunk/src/kernel32
Files:
2 added
10 edited

Legend:

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

    r7886 r8397  
    1 /* $Id: dbglocal.cpp,v 1.23 2002-02-12 12:00:41 sandervl Exp $ */
     1/* $Id: dbglocal.cpp,v 1.24 2002-05-09 13:55:32 sandervl Exp $ */
    22
    33/*
     
    136136"system",
    137137"string",
    138 "char"
     138"char",
     139"osliblvm"
    139140};
    140141//******************************************************************************
  • trunk/src/kernel32/dbglocal.h

    r7886 r8397  
    134134#define DBG_string         114
    135135#define DBG_char           115
    136 #define DBG_MAXFILES       116
     136#define DBG_osliblvm       116
     137#define DBG_MAXFILES       117
    137138
    138139extern USHORT DbgEnabledKERNEL32[DBG_MAXFILES];
  • trunk/src/kernel32/dbgwrap.cpp

    r8392 r8397  
    656656
    657657
    658 NODEF_DEBUGWRAP8(FindFirstVolumeA);
    659 NODEF_DEBUGWRAP8(FindFirstVolumeW);
    660 NODEF_DEBUGWRAP12(FindNextVolumeA);
    661 NODEF_DEBUGWRAP12(FindNextVolumeW);
    662 NODEF_DEBUGWRAP4(FindVolumeClose);
    663 
    664 NODEF_DEBUGWRAP12(FindFirstVolumeMountPointA);
    665 NODEF_DEBUGWRAP12(FindFirstVolumeMountPointW);
    666 NODEF_DEBUGWRAP12(FindNextVolumeMountPointA);
    667 NODEF_DEBUGWRAP12(FindNextVolumeMountPointW);
    668 NODEF_DEBUGWRAP4(FindVolumeMountPointClose);
    669  
    670 NODEF_DEBUGWRAP12(GetVolumeNameForVolumeMountPointA);
    671 NODEF_DEBUGWRAP12(GetVolumeNameForVolumeMountPointW);
     658DEBUGWRAP8(FindFirstVolumeA);
     659DEBUGWRAP8(FindFirstVolumeW);
     660DEBUGWRAP12(FindNextVolumeA);
     661DEBUGWRAP12(FindNextVolumeW);
     662DEBUGWRAP4(FindVolumeClose);
     663DEBUGWRAP12(FindFirstVolumeMountPointA);
     664DEBUGWRAP12(FindFirstVolumeMountPointW);
     665DEBUGWRAP12(FindNextVolumeMountPointA);
     666DEBUGWRAP12(FindNextVolumeMountPointW);
     667DEBUGWRAP4(FindVolumeMountPointClose);
     668DEBUGWRAP12(GetVolumeNameForVolumeMountPointA);
     669DEBUGWRAP12(GetVolumeNameForVolumeMountPointW);
    672670
    673671#undef DBG_LOCALLOG
  • trunk/src/kernel32/disk.cpp

    r8392 r8397  
    1 /* $Id: disk.cpp,v 1.34 2002-05-08 15:02:58 sandervl Exp $ */
     1/* $Id: disk.cpp,v 1.35 2002-05-09 13:55:33 sandervl Exp $ */
    22
    33/*
     
    1717
    1818#include <os2win.h>
     19#include <stdio.h>
    1920#include <stdlib.h>
    2021#include <string.h>
     22#include <versionos2.h>
    2123#include "unicode.h"
    2224#include "oslibdos.h"
     25#include "osliblvm.h"
    2326#include "exceptutil.h"
    2427#include "profile.h"
     28#include "hmdisk.h"
    2529
    2630#define DBG_LOCALLOG  DBG_disk
     
    2933
    3034ODINDEBUGCHANNEL(KERNEL32-DISK)
     35
    3136
    3237//******************************************************************************
     
    225230    }
    226231    else {
     232        //Volume functions only available in Windows 2000 and up
     233        if(VERSION_IS_WIN2000_OR_HIGHER() && !strncmp(lpszDrive, VOLUME_NAME_PREFIX, sizeof(VOLUME_NAME_PREFIX)-1))
     234        {
     235            char *pszVolume;
     236            int   length;
     237
     238            //strip volume name prefix (\\\\?\\Volume\\)
     239            length = strlen(lpszDrive);
     240            pszVolume = (char *)alloca(length);
     241
     242            strcpy(pszVolume, &lpszDrive[sizeof(VOLUME_NAME_PREFIX)-1+1]);  //-zero term + starting '{'
     243            length -= sizeof(VOLUME_NAME_PREFIX)-1+1;
     244            if(pszVolume[length-2] == '}') {
     245                pszVolume[length-2] = 0;
     246                rc = OSLibLVMGetDriveType(pszVolume);
     247                dprintf(("KERNEL32:  GetDriveType %s = %d (LVM)", lpszDrive, rc));
     248                return rc;
     249            }
     250        }
    227251        return DRIVE_NO_ROOT_DIR;   //return value checked in NT4, SP6 (GetDriveType(""), GetDriveType("4");
    228252    }
     
    263287   CHAR   szOrgFileSystemName[256] = "";
    264288   ULONG  drive;
    265    BOOL   rc;
     289   BOOL   rc, fVolumeName = FALSE;
     290   char   *pszVolume;
    266291
    267292    dprintf(("GetVolumeInformationA %s", lpRootPathName));
     
    280305    }
    281306    else {
     307        //Volume functions only available in Windows 2000 and up
     308        if(LOBYTE(GetVersion()) >= 5 && !strncmp(lpRootPathName, VOLUME_NAME_PREFIX, sizeof(VOLUME_NAME_PREFIX)-1))
     309        {
     310            int   length;
     311
     312            //strip volume name prefix (\\\\?\\Volume\\)
     313            length = strlen(lpRootPathName);
     314            pszVolume = (char *)alloca(length);
     315
     316            strcpy(pszVolume, &lpRootPathName[sizeof(VOLUME_NAME_PREFIX)-1]);
     317            length -= sizeof(VOLUME_NAME_PREFIX)-1;
     318            if(pszVolume[length-1] == '}') {
     319                fVolumeName = TRUE;
     320                goto proceed;
     321            }
     322        }
    282323        SetLastError(ERROR_INVALID_PARAMETER);
    283324        return FALSE;
    284325    }
     326proceed:
    285327
    286328    if(lpVolumeSerialNumber || lpVolumeNameBuffer) {
    287         rc = OSLibDosQueryVolumeSerialAndName(drive, lpVolumeSerialNumber, lpVolumeNameBuffer, nVolumeNameSize);
     329        if(fVolumeName) {
     330             rc = OSLibLVMQueryVolumeSerialAndName(pszVolume, lpVolumeSerialNumber, lpVolumeNameBuffer, nVolumeNameSize);
     331        }
     332        else rc = OSLibDosQueryVolumeSerialAndName(drive, lpVolumeSerialNumber, lpVolumeNameBuffer, nVolumeNameSize);
    288333        if(lpVolumeSerialNumber) {
    289334            dprintf2(("Volume serial number: %x", *lpVolumeSerialNumber));
     
    299344            nFileSystemNameSize    = sizeof(tmpstring);
    300345        }
    301         rc = OSLibDosQueryVolumeFS(drive, lpFileSystemNameBuffer, nFileSystemNameSize);
     346        if(fVolumeName) {
     347             rc = OSLibLVMQueryVolumeFS(pszVolume, lpFileSystemNameBuffer, nFileSystemNameSize);
     348        }
     349        else rc = OSLibDosQueryVolumeFS(drive, lpFileSystemNameBuffer, nFileSystemNameSize);
     350
    302351        //save original file system name
    303352        if(rc == ERROR_SUCCESS) strcpy(szOrgFileSystemName, lpFileSystemNameBuffer);
     
    435484}
    436485//******************************************************************************
     486typedef struct {
     487    HANDLE hLVMVolumeControlData;
     488    DWORD  lastvol;
     489} VOLINFO;
    437490//******************************************************************************
    438491HANDLE WIN32API FindFirstVolumeA(LPTSTR lpszVolumeName, DWORD cchBufferLength)
    439492{
     493    HANDLE   hVolume;
     494    VOLINFO *pVolInfo;
     495    char     szdrive[3];
     496    char     szVolume[256];
     497
     498    if(!VERSION_IS_WIN2000_OR_HIGHER()) {
     499        SetLastError(ERROR_NOT_SUPPORTED);
     500        return FALSE;
     501    }
     502
     503    hVolume = GlobalAlloc(0, sizeof(VOLINFO));
     504    if(hVolume == 0) {
     505        dprintf(("ERROR: FindFirstVolumeA: out of memory!!"));
     506        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
     507        return 0;
     508    }
     509    pVolInfo = (VOLINFO *)GlobalLock(hVolume);
     510    pVolInfo->hLVMVolumeControlData = OSLibLVMQueryVolumeControlData();
     511    pVolInfo->lastvol               = 0;
     512
     513    if(OSLibLVMQueryVolumeName(pVolInfo->hLVMVolumeControlData, pVolInfo->lastvol, szVolume, sizeof(szVolume)) == FALSE) {
     514        SetLastError(ERROR_NO_MORE_FILES);
     515        goto fail;
     516    }
     517    if(strlen(szVolume) + 14 + 1 > cchBufferLength) {
     518        SetLastError(ERROR_INSUFFICIENT_BUFFER);
     519        goto fail;
     520    }
     521    sprintf(lpszVolumeName, VOLUME_NAME_PREFIX"{%s}\\", szVolume);
     522    dprintf(("FindFirstVolumeA returned %s", lpszVolumeName));
     523    pVolInfo->lastvol++;
     524    GlobalUnlock(hVolume);
     525    SetLastError(ERROR_SUCCESS);
     526    return hVolume;
     527
     528fail:
     529    GlobalUnlock(hVolume);
     530    GlobalFree(hVolume);
    440531    return 0;
    441532}
     
    444535HANDLE WIN32API FindFirstVolumeW(LPWSTR lpszVolumeName, DWORD cchBufferLength)
    445536{
    446     return 0;
     537    LPSTR  pszvolname = NULL;
     538    HANDLE hVolume;
     539
     540    if(!VERSION_IS_WIN2000_OR_HIGHER()) {
     541        SetLastError(ERROR_NOT_SUPPORTED);
     542        return FALSE;
     543    }
     544
     545    if(cchBufferLength) {
     546        pszvolname = (char *)alloca(cchBufferLength);
     547    }
     548    hVolume = FindFirstVolumeA(pszvolname, cchBufferLength);
     549    if(hVolume) {
     550        int len = MultiByteToWideChar( CP_ACP, 0, pszvolname, -1, NULL, 0);
     551        MultiByteToWideChar(CP_ACP, 0, pszvolname, -1, lpszVolumeName, len);
     552    }
     553    return hVolume;
    447554}
    448555//******************************************************************************
     
    451558                              DWORD cchBufferLength)
    452559{
    453     return FALSE;
     560    VOLINFO *pVolInfo;
     561    char     szdrive[3];
     562    DWORD    DeviceType;
     563    char     szVolume[256];
     564
     565    if(!VERSION_IS_WIN2000_OR_HIGHER()) {
     566        SetLastError(ERROR_NOT_SUPPORTED);
     567        return FALSE;
     568    }
     569
     570    pVolInfo = (VOLINFO *)GlobalLock(hFindVolume);
     571    if(pVolInfo == NULL) {
     572        SetLastError(ERROR_INVALID_PARAMETER);
     573        return FALSE;
     574    }
     575    if(OSLibLVMQueryVolumeName(pVolInfo->hLVMVolumeControlData, pVolInfo->lastvol,
     576                               szVolume, sizeof(szVolume)) == FALSE) {
     577        SetLastError(ERROR_NO_MORE_FILES);
     578        GlobalUnlock(hFindVolume);
     579        return FALSE;
     580    }
     581    if(strlen(szVolume) + 14 + 1 > cchBufferLength) {
     582        SetLastError(ERROR_INSUFFICIENT_BUFFER);
     583        GlobalUnlock(hFindVolume);
     584        return FALSE;
     585    }
     586    sprintf(lpszVolumeName, VOLUME_NAME_PREFIX"{%s}\\", szVolume);
     587    dprintf(("FindNextVolumeA returned %s", lpszVolumeName));
     588    pVolInfo->lastvol++;
     589    GlobalUnlock(hFindVolume);
     590    SetLastError(ERROR_SUCCESS);
     591    return TRUE;
    454592}
    455593//******************************************************************************
     
    458596                              DWORD cchBufferLength)
    459597{
     598    LPSTR  pszvolnameA = NULL;
     599    BOOL   ret;
     600
     601    if(!VERSION_IS_WIN2000_OR_HIGHER()) {
     602        SetLastError(ERROR_NOT_SUPPORTED);
     603        return FALSE;
     604    }
     605
     606    if(cchBufferLength) {
     607        pszvolnameA = (char *)alloca(cchBufferLength);
     608    }
     609    ret = FindNextVolumeA(hFindVolume, pszvolnameA, cchBufferLength);
     610    if(ret) {
     611        int len = MultiByteToWideChar( CP_ACP, 0, pszvolnameA, -1, NULL, 0);
     612        MultiByteToWideChar(CP_ACP, 0, pszvolnameA, -1, lpszVolumeName, len);
     613    }
     614    return ret;
     615}
     616//******************************************************************************
     617//******************************************************************************
     618BOOL WIN32API FindVolumeClose(HANDLE hFindVolume)
     619{
     620    VOLINFO *pVolInfo;
     621
     622    if(!VERSION_IS_WIN2000_OR_HIGHER()) {
     623        SetLastError(ERROR_NOT_SUPPORTED);
     624        return FALSE;
     625    }
     626
     627    if(hFindVolume) {
     628        pVolInfo = (VOLINFO *)GlobalLock(hFindVolume);
     629        OSLibLVMFreeVolumeControlData(pVolInfo->hLVMVolumeControlData);
     630        GlobalUnlock(hFindVolume);
     631        GlobalFree(hFindVolume);
     632        return TRUE;
     633    }
    460634    return FALSE;
    461 }
    462 //******************************************************************************
    463 //******************************************************************************
    464 BOOL WIN32API FindVolumeClose(HANDLE hFindVolume)
    465 {
    466     return TRUE;
    467635}
    468636//******************************************************************************
     
    472640                                           DWORD cchBufferLength)
    473641{
     642    if(!VERSION_IS_WIN2000_OR_HIGHER()) {
     643        SetLastError(ERROR_NOT_SUPPORTED);
     644        return FALSE;
     645    }
     646   
     647    SetLastError(ERROR_NO_MORE_FILES);
    474648    return 0;
    475649}
     
    480654                                           DWORD cchBufferLength)
    481655{
    482     return 0;
     656    LPSTR  pszmountpointnameA = NULL;
     657    LPSTR  pszrootA = NULL;
     658    HANDLE hVolume;
     659
     660    if(!VERSION_IS_WIN2000_OR_HIGHER()) {
     661        SetLastError(ERROR_NOT_SUPPORTED);
     662        return FALSE;
     663    }
     664
     665    if(cchBufferLength) {
     666        pszmountpointnameA = (char *)alloca(cchBufferLength);
     667    }
     668    if(lpszRootPathName) {
     669        pszrootA = (char *)alloca(lstrlenW(lpszRootPathName)+1);
     670
     671        int len = WideCharToMultiByte( CP_ACP, 0, lpszRootPathName, -1, NULL, 0, 0, NULL);
     672        WideCharToMultiByte(CP_ACP, 0, lpszRootPathName, -1, pszrootA, len, 0, NULL);
     673    }
     674
     675    hVolume = FindFirstVolumeMountPointA(pszrootA, pszmountpointnameA, cchBufferLength);
     676    if(hVolume) {
     677        int len = MultiByteToWideChar( CP_ACP, 0, pszmountpointnameA, -1, NULL, 0);
     678        MultiByteToWideChar(CP_ACP, 0, pszmountpointnameA, -1, lpszVolumeMountPoint, len);
     679    }
     680    return hVolume;
    483681}
    484682//******************************************************************************
     
    488686                                        DWORD cchBufferLength)
    489687{
     688    if(!VERSION_IS_WIN2000_OR_HIGHER()) {
     689        SetLastError(ERROR_NOT_SUPPORTED);
     690        return FALSE;
     691    }
     692    SetLastError(ERROR_NO_MORE_FILES);
    490693    return FALSE;
    491694}
     
    496699                                        DWORD cchBufferLength)
    497700{
     701    LPSTR  pszmoutpointnameA = NULL;
     702    BOOL   ret;
     703
     704    if(!VERSION_IS_WIN2000_OR_HIGHER()) {
     705        SetLastError(ERROR_NOT_SUPPORTED);
     706        return FALSE;
     707    }
     708
     709    if(cchBufferLength) {
     710        pszmoutpointnameA = (char *)alloca(cchBufferLength);
     711    }
     712    ret = FindFirstVolumeA(pszmoutpointnameA, cchBufferLength);
     713    if(ret) {
     714        int len = MultiByteToWideChar( CP_ACP, 0, pszmoutpointnameA, -1, NULL, 0);
     715        MultiByteToWideChar(CP_ACP, 0, pszmoutpointnameA, -1, lpszVolumeMountPoint, len);
     716    }
     717    return ret;
     718}
     719//******************************************************************************
     720//******************************************************************************
     721BOOL WIN32API FindVolumeMountPointClose(HANDLE hFindVolumeMountPoint)
     722{
     723    if(!VERSION_IS_WIN2000_OR_HIGHER()) {
     724        SetLastError(ERROR_NOT_SUPPORTED);
     725        return FALSE;
     726    }
     727
     728    if(hFindVolumeMountPoint) {
     729        GlobalFree(hFindVolumeMountPoint);
     730        return TRUE;
     731    }
    498732    return FALSE;
    499 }
    500 //******************************************************************************
    501 //******************************************************************************
    502 BOOL WIN32API FindVolumeMountPointClose(HANDLE hFindVolumeMountPoint)
    503 {
    504     return TRUE;
    505733}
    506734//******************************************************************************
     
    510738                                                DWORD cchBufferLength)
    511739{
     740    if(!VERSION_IS_WIN2000_OR_HIGHER()) {
     741        SetLastError(ERROR_NOT_SUPPORTED);
     742        return FALSE;
     743    }
     744
     745    dprintf(("GetVolumeNameForVolumeMountPointA: %s", lpszVolumeMountPoint));
     746    if(OSLibLVMGetVolumeNameForVolumeMountPoint(lpszVolumeMountPoint, lpszVolumeName,
     747                                                cchBufferLength) == TRUE)
     748    {
     749        SetLastError(ERROR_SUCCESS);
     750        return TRUE;
     751    }
     752    SetLastError(ERROR_FILE_NOT_FOUND);
    512753    return FALSE;
    513754}
     
    518759                                                DWORD cchBufferLength)
    519760{
    520     return FALSE;
    521 }
    522 //******************************************************************************
    523 //******************************************************************************
     761    LPSTR  pszmoutpointnameA = NULL;
     762    LPSTR  pszvolumenameA = NULL;
     763    BOOL   ret;
     764    int    len;
     765
     766    if(!VERSION_IS_WIN2000_OR_HIGHER()) {
     767        SetLastError(ERROR_NOT_SUPPORTED);
     768        return FALSE;
     769    }
     770    len = WideCharToMultiByte( CP_ACP, 0, lpszVolumeMountPoint, -1, NULL, 0, 0, NULL);
     771    pszmoutpointnameA = (char *)alloca(len+1);
     772    WideCharToMultiByte(CP_ACP, 0, lpszVolumeMountPoint, -1, pszmoutpointnameA, len, 0, NULL);
     773
     774    if(cchBufferLength && lpszVolumeName) {
     775        pszvolumenameA = (char *)alloca(cchBufferLength);
     776    }
     777    ret = GetVolumeNameForVolumeMountPointA(pszmoutpointnameA, pszvolumenameA, cchBufferLength);
     778    if(ret) {
     779        int len = MultiByteToWideChar( CP_ACP, 0, pszvolumenameA, -1, NULL, 0);
     780        MultiByteToWideChar(CP_ACP, 0, pszvolumenameA, -1, lpszVolumeName, len);
     781    }
     782    return ret;
     783}
     784//******************************************************************************
     785//******************************************************************************
  • trunk/src/kernel32/hmdisk.cpp

    r8258 r8397  
    1 /* $Id: hmdisk.cpp,v 1.42 2002-04-13 06:21:39 bird Exp $ */
     1/* $Id: hmdisk.cpp,v 1.43 2002-05-09 13:55:33 sandervl Exp $ */
    22
    33/*
     
    1212#include <os2win.h>
    1313#include <string.h>
     14#include <versionos2.h>
    1415
    1516#include <misc.h>
    1617#include "hmdisk.h"
    1718#include "mmap.h"
    18 #include "oslibdos.h"
    1919#include <win\winioctl.h>
    2020#include <win\ntddscsi.h>
    2121#include <win\wnaspi32.h>
    2222#include <win\aspi.h>
     23#include "oslibdos.h"
     24#include "osliblvm.h"
    2325
    2426#define DBG_LOCALLOG    DBG_hmdisk
     
    5052{
    5153    HMDeviceRegisterEx("\\\\.\\PHYSICALDRIVE", this, NULL);
     54    HMDeviceRegisterEx(VOLUME_NAME_PREFIX, this, NULL);
    5255}
    5356
     
    8386    //\\.\PHYSICALDRIVEn    -> length 18
    8487    if(namelength != 6 && namelength != 18) {
     88        if(VERSION_IS_WIN2000_OR_HIGHER()) {
     89            if(!strncmp(lpDeviceName, VOLUME_NAME_PREFIX, sizeof(VOLUME_NAME_PREFIX)-1)) {
     90                return TRUE;
     91            }
     92        }
    8593        return FALSE;
    8694    }
     
    124132
    125133    char szDrive[4];
    126     szDrive[0] = *lpFileName;
    127134    szDrive[1] = ':';
    128135    szDrive[2] = '\0';
     136
     137    //if volume name, query
     138    if(VERSION_IS_WIN2000_OR_HIGHER() && !strncmp(lpFileName, VOLUME_NAME_PREFIX, sizeof(VOLUME_NAME_PREFIX)-1)) {
     139        char *pszVolume;
     140        int   length;
     141
     142        //strip volume name prefix (\\\\?\\Volume\\)
     143        length = strlen(lpFileName);
     144        pszVolume = (char *)alloca(length);
     145
     146        strcpy(pszVolume, &lpFileName[sizeof(VOLUME_NAME_PREFIX)-1+1]);  //-zero term + starting '{'
     147        length -= sizeof(VOLUME_NAME_PREFIX)-1+1;
     148        if(pszVolume[length-2] == '}') {
     149            pszVolume[length-2] = 0;
     150            szDrive[0] = OSLibLVMQueryDriveFromVolumeName(pszVolume);
     151        }
     152        else return ERROR_FILE_NOT_FOUND;
     153
     154    }
     155    else {
     156        szDrive[0] = *lpFileName;
     157    }
    129158    dwDriveType = GetDriveTypeA(szDrive);
    130159
     
    550579        msg = "IOCTL_CDROM_FIND_NEW_DEVICES";
    551580        break;
     581    case IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS:
     582        msg = "IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS";
     583        break;
    552584    }
    553585    if(msg) {
     
    713745
    714746    case IOCTL_DISK_GET_PARTITION_INFO:
     747    {
     748        PPARTITION_INFORMATION pPartition = (PPARTITION_INFORMATION)lpOutBuffer;
     749        if(nOutBufferSize < sizeof(PARTITION_INFORMATION) || !pPartition) {
     750            SetLastError(ERROR_INSUFFICIENT_BUFFER);
     751            return FALSE;
     752        }
     753        if(lpBytesReturned) {
     754            *lpBytesReturned = sizeof(PARTITION_INFORMATION);
     755        }
     756        if(OSLibLVMGetPartitionInfo(drvInfo->driveLetter, pPartition)) {
     757            SetLastError(ERROR_NOT_ENOUGH_MEMORY); //wrong error, but who cares
     758            return FALSE;
     759        }
     760
     761        SetLastError(ERROR_SUCCESS);
     762        return TRUE;
     763    }
     764
    715765    case IOCTL_DISK_LOAD_MEDIA:
    716766    case IOCTL_DISK_MEDIA_REMOVAL:
     
    723773        break;
    724774
     775
     776    case IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS:
     777    {
     778        PVOLUME_DISK_EXTENTS pVolExtent = (PVOLUME_DISK_EXTENTS)lpOutBuffer;
     779        if(nOutBufferSize < sizeof(VOLUME_DISK_EXTENTS) || !pVolExtent) {
     780            SetLastError(ERROR_INSUFFICIENT_BUFFER);
     781            return FALSE;
     782        }
     783        if(OSLibLVMGetVolumeExtents(drvInfo->driveLetter, pVolExtent)) {
     784            SetLastError(ERROR_NOT_ENOUGH_MEMORY); //wrong error, but who cares
     785            return FALSE;
     786        }
     787
     788        if(lpBytesReturned) {
     789            *lpBytesReturned = sizeof(VOLUME_DISK_EXTENTS);
     790        }
     791        SetLastError(ERROR_SUCCESS);
     792        return TRUE;
     793    }
    725794
    726795    // -----------
  • trunk/src/kernel32/hmdisk.h

    r7549 r8397  
    1 /* $Id: hmdisk.h,v 1.8 2001-12-05 14:16:01 sandervl Exp $ */
     1/* $Id: hmdisk.h,v 1.9 2002-05-09 13:55:33 sandervl Exp $ */
    22
    33#ifndef __HMDISK_H__
     
    1111#include "HMDevice.h"
    1212#include "HMObjects.h"
     13
     14#define VOLUME_NAME_PREFIX  "\\\\?\\Volume\\"
    1315
    1416/*****************************************************************************
  • trunk/src/kernel32/initkernel32.cpp

    r8340 r8397  
    1 /* $Id: initkernel32.cpp,v 1.16 2002-04-30 09:54:44 sandervl Exp $
     1/* $Id: initkernel32.cpp,v 1.17 2002-05-09 13:55:33 sandervl Exp $
    22 *
    33 * KERNEL32 DLL entry point
     
    5252#include <exitlist.h>
    5353#include "oslibdos.h"
     54#include "osliblvm.h"
    5455#include <cpuhlp.h>
    5556#include <Win32k.h>
     
    191192            InitDynamicRegistry();
    192193
     194            //Load LVM subsystem for volume/mountpoint win32 functions
     195            OSLibLVMInit();
     196
    193197            //Set the process affinity mask to the system affinity mask
    194198            DWORD dwProcessAffinityMask, dwSystemAffinityMask;
     
    225229
    226230    WriteOutProfiles();
     231    //Unload LVM subsystem for volume/mountpoint win32 functions
     232    OSLibLVMExit();
     233
    227234    DestroyTIB();
    228235    DestroySharedHeap();
  • trunk/src/kernel32/kernel32.mak

    r8339 r8397  
    1 # $Id: kernel32.mak,v 1.28 2002-04-30 09:36:09 sandervl Exp $
     1# $Id: kernel32.mak,v 1.29 2002-05-09 13:55:33 sandervl Exp $
    22
    33#
     
    118118$(OBJDIR)\atom.obj \
    119119$(OBJDIR)\disk.obj \
     120$(OBJDIR)\osliblvm.obj \
    120121$(OBJDIR)\directory.obj \
    121122$(OBJDIR)\hmmmap.obj \
  • trunk/src/kernel32/oslibdos.cpp

    r8273 r8397  
    1 /* $Id: oslibdos.cpp,v 1.100 2002-04-16 00:21:04 bird Exp $ */
     1/* $Id: oslibdos.cpp,v 1.101 2002-05-09 13:55:34 sandervl Exp $ */
    22/*
    33 * Wrappers for OS/2 Dos* API
     
    33953395//******************************************************************************
    33963396//******************************************************************************
     3397DWORD OSLibDosGetNumPhysDrives()
     3398{
     3399    USHORT  usNumDrives  = 0;                  /* Data return buffer        */
     3400    ULONG   ulDataLen    = sizeof(USHORT);     /* Data return buffer length */
     3401    APIRET  rc           = NO_ERROR;           /* Return code               */
     3402
     3403    /* Request a count of the number of partitionable disks in the system */
     3404
     3405    rc = DosPhysicalDisk(INFO_COUNT_PARTITIONABLE_DISKS,
     3406                         &usNumDrives,
     3407                         ulDataLen,
     3408                         NULL,         /* No parameter for this function */
     3409                         0L);
     3410
     3411    if (rc != NO_ERROR) {
     3412        dprintf(("DosPhysicalDisk error: return code = %u\n", rc));
     3413        return 0;
     3414    }
     3415    else {
     3416        dprintf(("DosPhysicalDisk:  %u partitionable disk(s)\n",usNumDrives));
     3417    }
     3418    return usNumDrives;
     3419}
     3420//******************************************************************************
     3421//******************************************************************************
     3422
  • trunk/src/kernel32/oslibdos.h

    r8030 r8397  
    1 /* $Id: oslibdos.h,v 1.44 2002-02-28 19:27:48 sandervl Exp $ */
     1/* $Id: oslibdos.h,v 1.45 2002-05-09 13:55:34 sandervl Exp $ */
    22
    33/*
     
    390390DWORD OSLibDosSetPriority(ULONG tid, int priority);
    391391
     392//functions for physical disk & partition information
     393DWORD OSLibDosGetNumPhysDrives();
     394
    392395#endif //__OSLIBDOS_H__
    393396
Note: See TracChangeset for help on using the changeset viewer.