fs-nt.cpp revision 5bf0ee311caa414469f26237ff607cb1b3591508
/* $Id$ */
/** @file
* IPRT - File System, Native NT.
*/
/*
* Copyright (C) 2006-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define LOG_GROUP RTLOGGROUP_FS
#include "internal-r3-nt.h"
{
/*
*/
&hFile,
NULL);
if (RT_SUCCESS(rc))
{
/*
* Get the volume information.
*/
NTSTATUS rcNt = NtQueryVolumeInformationFile(hFile, &Ios, &FsSizeInfo, sizeof(FsSizeInfo), FileFsSizeInformation);
if (NT_SUCCESS(rcNt))
{
/*
* Calculate the return values.
*/
if (pcbTotal)
{
*pcbTotal = UINT64_MAX;
}
if (pcbFree)
{
*pcbFree = UINT64_MAX;
}
if (pcbBlock)
{
}
if (pcbSector)
}
else
}
return rc;
}
{
/*
* Validate & get valid root path.
*/
/*
*/
&hFile,
NULL);
if (RT_SUCCESS(rc))
{
/*
* Get the volume information.
*/
union
{
} u;
if (NT_SUCCESS(rcNt))
else
}
return rc;
}
{
/*
* Validate & get valid root path.
*/
/*
*/
&hFile,
NULL);
if (RT_SUCCESS(rc))
{
/*
* Get the volume information.
*/
union
{
} u;
NTSTATUS rcNt = NtQueryVolumeInformationFile(hFile, &Ios, &u, sizeof(u), FileFsAttributeInformation);
if (NT_SUCCESS(rcNt))
{
rcNt = NtQueryVolumeInformationFile(hFile, &Ios, &FsDevInfo, sizeof(FsDevInfo), FileFsDeviceInformation);
if (NT_SUCCESS(rcNt))
{
/*
* Fill in the return structure.
*/
/** @todo r=bird: What about FILE_CASE_SENSITIVE_SEARCH ? Is this set for NTFS
* as well perchance? If so, better mention it instead of just setting
* fCaseSensitive to false. */
/* figure the remote stuff */
}
else
}
else
}
return rc;
}
/**
* Internal helper for comparing a WCHAR string with a char string.
*
* @returns @c true if equal, @c false if not.
* @param pwsz1 The first string.
* @param cb1 The length of the first string, in bytes.
* @param psz2 The second string.
* @param cch2 The length of the second string.
*/
{
return false;
while (cch2-- > 0)
{
return false;
}
return true;
}
{
/*
* Validate input.
*/
/*
*/
&hFile,
NULL);
if (RT_SUCCESS(rc))
{
/*
* Get the file system name.
*/
union
{
} u;
NTSTATUS rcNt = NtQueryVolumeInformationFile(hFile, &Ios, &u, sizeof(u), FileFsAttributeInformation);
if (NT_SUCCESS(rcNt))
{
rtFsCompWideStrAndAscii(u.FsAttrInfo.FileSystemName, u.FsAttrInfo.FileSystemNameLength, RT_STR_TUPLE(a_szName))
if (IS_FS("NTFS"))
else if (IS_FS("FAT"))
*penmType = RTFSTYPE_FAT;
else if (IS_FS("FAT32"))
*penmType = RTFSTYPE_FAT;
else if (IS_FS("VBoxSharedFolderFS"))
}
else
}
return rc;
}