天天看点

文件存储:File Systems 文件系统About File SystemsUsing File System FeaturesFile System Reference

  • Applications rely on file systems to store and retrieve information on mass storage devices. File systems provide the underlying support that applications need to create and access files and directories on the individual volumes associated with the devices.
  • Each file system consists of one or more drivers and supporting dynamic-link libraries that define the data formats and features of the file system. These determine the conventions used for file names, the level of security and recoverability available, and the general performance of input and output (I/O) operations.

About File Systems

Using File System Features

File System Reference

  • The following functions, interfaces, and structures are used with file systems:文件系统使用以下函数、接口和结构

File System Functions

  • The following functions are used with file systems.以下函数用于文件系统

CreateHardLink

  • Establishes an NTFS hard link between an existing file and a new file. 在现有文件和新文件之间建立NTFS硬链接。

GetCompressedFileSize

  • Retrieves the actual number of bytes of disk storage used to store a specified file.检索用于存储指定文件的磁盘存储的实际字节数。

GetDiskFreeSpace

  • Retrieves information about the specified disk, including the amount of free space on the disk. 检索有关指定磁盘的信息,包括磁盘上的可用空间量。

GetDiskFreeSpaceEx

  • Retrieves information about the specified disk, including the amount of free space on the disk.检索有关指定磁盘的信息,包括磁盘上的可用空间量

GetFileSize

  • Retrieves the size of a specified file. 检索指定文件的大小。

GetFileSizeEx

  • Retrieves the size of a specified file. 检索指定文件的大小。

GetLogicalDrives

  • Returns a bitmask representing the currently available disk drives. 返回表示当前可用磁盘驱动器的位掩码

GetLogicalDriveStrings

  • Fills a buffer with strings that specify valid drives in the system. 用指定系统中有效驱动器的字符串填充缓冲区。

GetVolumeInformation

  • Retrieves information about a file system and volume. 检索有关文件系统和卷的信息

SetVolumeLabel

  • Sets the label of a file system volume. 设置文件系统卷的标签
  • The following functions are used with the encrypted file system.以下函数用于加密的文件系统

AddUsersToEncryptedFile

  • Adds user keys to a specified encrypted file. 将用户密钥添加到指定的加密文件

DecryptFile

  • Decrypts an encrypted file or directory. 解密加密的文件或目录。

DuplicateEncryptionInfoFile

  • Copies the EFS metadata from one file or directory to another. 将EFS元数据从一个文件或目录复制到另一个文件或目录。

EncryptFile

  • Encrypts a file or directory. 加密文件或目录。

EncryptionDisable

  • Disables or enables encryption of the indicated directory and the files in it. 禁用或启用指定目录及其文件的加密

FileEncryptionStatus

  • Retrieves the encryption status of the specified file.检索指定文件的加密状态。

FreeEncryptionCertificateHashList

  • Frees a certificate hash list.

    释放证书哈希列表。

QueryRecoveryAgentsOnEncryptedFile

  • Retrieves a list of recovery agents for the specified file. 检索指定文件的恢复代理列表。

QueryUsersOnEncryptedFile

  • Retrieves a list of users for the specified file.检索指定文件的用户列表

RemoveUsersFromEncryptedFile

  • Removes specified certificate hashes from a specified file. 从指定文件中移除指定的证书散列

SetUserFileEncryptionKey

  • Sets the user’s current key to the specified certificate. 将用户的当前密钥设置为指定的证书
  • The following functions are used with volume mount points.以下函数用于卷挂载点。

DeleteVolumeMountPoint

  • Unmounts the volume from the specified volume mount point. 从指定的卷挂载点卸载卷

FindFirstVolume

  • Returns the name of a volume on a computer.返回计算机上卷的名称

FindFirstVolumeMountPoint

  • Returns the name of a volume mount point on the specified volume. 返回指定卷上的卷挂载点的名称。

FindNextVolume

  • Continues a volume search started by a call to FindFirstVolume. 继续通过调用FindFirstVolume启动的卷搜索。

FindNextVolumeMountPoint

  • Continues a volume mount point search started by a call to FindFirstVolumeMountPoint. 继续通过调用FindFirstVolumeMountPoint启动的卷挂载点搜索。

FindVolumeClose

  • Closes the specified volume search handle. 关闭指定的卷搜索句柄。

FindVolumeMountPointClose

  • Closes the specified mount-point search handle. 关闭指定的挂载点搜索句柄。

GetVolumeNameForVolumeMountPoint

  • Takes a volume mount point or root directory and returns the corresponding unique volume name.获取卷挂载点或根目录,并返回相应的惟一卷名。

GetVolumePathName

  • Retrieves the volume mount point at which the specified path is mounted. 检索挂载指定路径的卷挂载点

GetVolumePathNamesForVolumeName

  • Retrieves a list of path names for the specified volume name. 检索指定卷名称的路径名称列表。

SetVolumeMountPoint

  • Mounts the specified volume at the specified volume mount point.在指定的卷装入点装入指定的卷。

File System Control Codes:

  • The following control codes are used with change journals.变更日志使用以下控制代码,参考:File Storage–》Change Journals

FSCTL_CREATE_USN_JOURNAL

  • Creates a change journal stream on a target volume or modifies an existing change journal stream. 在目标卷上创建更改日志流或修改现有更改日志流。

FSCTL_DELETE_USN_JOURNAL

  • Deletes a change journal on a volume or awaits notification of deletion of a change journal.删除卷上的更改日志或等待删除更改日志的通知。

FSCTL_ENUM_USN_DATA

  • Creates an enumeration that lists the change journal entries between two specified boundaries. 创建一个枚举,该枚举列出两个指定边界之间的更改日志项

FSCTL_MARK_HANDLE

  • Marks a specified file or directory and its change journal record with information about changes to that file or directory. 将指定的文件或目录及其更改日志记录标记为有关该文件或目录更改的信息。

FSCTL_QUERY_USN_JOURNAL

  • Queries for information on the current change journal, its records, and its capacity. 查询关于当前变更日志、其记录和容量的信息。

FSCTL_READ_USN_JOURNAL

  • Returns to the calling process the set of change journal records between two specified USN values. 返回调用进程两个指定USN值之间的更改日志记录集

FSCTL_WRITE_USN_CLOSE_RECORD

  • Generates a record in the change journal stream for the input file. This record will have the USN_REASON_CLOSE flag.在变更日志流中为输入文件生成一条记录。该记录将具有USN_REASON_CLOSE标志。
  • The following are defragmentation control codes.以下是碎片整理控制代码

FSCTL_GET_RETRIEVAL_POINTERS

  • Get information about a file’s cluster use.获取关于文件集群使用的信息。

FSCTL_GET_VOLUME_BITMAP

  • Get a bitmap of cluster allocation.获取集群分配的位图

FSCTL_MOVE_FILE

  • Move all or part of a file from one set of clusters to another within a volume. 将一个卷中的所有或部分文件从一组集群移动到另一组集群
  • The following control codes are used with file compression. 以下控制代码用于文件压缩

FSCTL_GET_COMPRESSION

  • Obtains the compression state of a file or directory 获取文件或目录的压缩状态

FSCTL_SET_COMPRESSION

  • Sets the compression state of a file or directory 设置文件或目录的压缩状态。
  • The following control codes are used with files.以下控制代码用于文件

FSCTL_ALLOW_EXTENDED_DASD_IO

  • Signals the file system driver not to perform any I/O boundary checks on partition read or write calls. Instead, boundary checks are performed by the device driver. 指示文件系统驱动程序不要对分区的读或写调用执行任何I/O边界检查。相反,边界检查由设备驱动程序执行。

FSCTL_RECALL_FILE

  • Recalls a file from storage media managed by Remote Storage, the hierarchical storage management software. 从由分层存储管理软件远程存储管理的存储介质中检索文件。
  • The following control codes are used with object identifiers.下面的控制代码用于对象标识符

FSCTL_CREATE_OR_GET_OBJECT_ID

  • Creates or retrieves a file system object identifier for an existing, open object. 为已存在的打开对象创建或检索文件系统对象标识符。

FSCTL_DELETE_OBJECT_ID

  • Removes a file system object identifier from an existing, open object. 从现有的打开对象中移除文件系统对象标识符

FSCTL_GET_OBJECT_ID

  • Retrieves the object identifier for an existing, open object. 检索现有打开对象的对象标识符。

FSCTL_SET_OBJECT_ID

  • Sets a file system object identifier for an existing, open object. 为已存在的打开对象设置文件系统对象标识符。

FSCTL_SET_OBJECT_ID_EXTENDED

  • Modifies user data in the object identifier of an existing, open object. 修改现有打开对象的对象标识符中的用户数据。
  • The following control codes are used with opportunistic locks.下面的控制代码用于机会锁。

FSCTL_OPBATCH_ACK_CLOSE_PENDING

  • Notifies a server that a client application is about to close a file. An application uses this operation following notification that an opportunistic lock on the file is about to be broken.

FSCTL_OPLOCK_BREAK_ACK_NO_2

  • Responds to notification that an opportunistic lock on a file is about to be broken. An application uses this operation to loose all opportunistic locks on the file but keep the file open.

FSCTL_OPLOCK_BREAK_ACKNOWLEDGE

  • Responds to notification that an exclusive opportunistic lock on a file is about to be broken. An application uses this operation to indicate that the file should receive a level 2 opportunistic lock.

FSCTL_OPLOCK_BREAK_NOTIFY

  • Allows the calling application to wait for completion of an opportunistic lock break. 允许调用应用程序等待机会性锁中断的完成。

FSCTL_REQUEST_BATCH_OPLOCK

  • Requests a batch opportunistic lock on a file. 请求对文件进行批量机会锁定。

FSCTL_REQUEST_FILTER_OPLOCK

  • Requests a filter opportunistic lock on a file. 请求文件上的过滤机会锁定

FSCTL_REQUEST_OPLOCK_LEVEL_1

  • Requests a level 1 opportunistic lock on a file. 请求文件的一级机会锁。

FSCTL_REQUEST_OPLOCK_LEVEL_2

  • Requests a level 2 opportunistic lock on a file.请求文件的二级机会锁
  • The following control codes are used with reparse points. 下面的控制代码用于重新解析点

FSCTL_DELETE_REPARSE_POINT

  • Deletes a reparse point for a file or directory. 删除文件或目录的重新解析点。

FSCTL_GET_REPARSE_POINT

  • Returns reparse point data for a file or directory. 返回文件或目录的重新解析点数据。

FSCTL_SET_REPARSE_POINT

  • Sets a reparse point on a file or directory. 设置文件或目录上的重新解析点
  • The following control codes are used with sparse files.下面的控制代码用于稀疏文件

FSCTL_QUERY_ALLOCATED_RANGES

  • Scans a file for ranges of the file for which disk space is allocated. 扫描文件,查找分配磁盘空间的文件的范围

FSCTL_SET_SPARSE

  • Marks a file as a sparse file. 将文件标记为稀疏文件。

FSCTL_SET_ZERO_DATA

  • Sets a range of a files bytes to zeroes. 将文件字节的范围设置为零
  • The following control codes are used with volumes.

FSCTL_DISMOUNT_VOLUME

  • Dismounts a volume. 下一个卷。

FSCTL_LOCK_VOLUME

  • Locks a volume. 锁一个卷。

FSCTL_READ_FROM_PLEX

  • Reads from the specified plex. 从指定的丛中读取。

FSCTL_UNLOCK_VOLUME

  • Unlocks a volume. 解锁一个卷。

Obsolete Control Codes:过时的控制代码 FSCTL_QUERY_FAT_BPB

File System Interfaces:以下接口用于文件系统

IDiskQuotaControl

IDiskQuotaEvents

IDiskQuotaUser

IDiskQuotaUserBatch

IEnumDiskQuotaUsers

File System Structures:以下结构用于文件系统

CREATE_USN_JOURNAL_DATA

DELETE_USN_JOURNAL_DATA

DISKQUOTA_USER_INFORMATION

EFS_CERTIFICATE_BLOB

EFS_HASH_BLOB

ENCRYPTION_CERTIFICATE

ENCRYPTION_CERTIFICATE_HASH

ENCRYPTION_CERTIFICATE_HASH_LIST

ENCRYPTION_CERTIFICATE_LIST

FILE_ALLOCATED_RANGE_BUFFER

FILE_OBJECTID_BUFFER

FILE_ZERO_DATA_INFORMATION

FSCTL_QUERY_FAT_BPB_BUFFER

MARK_HANDLE_INFO

MFT_ENUM_DATA

MOVE_FILE_DATA

PLEX_READ_DATA_REQUEST

READ_USN_JOURNAL_DATA

REPARSE_GUID_DATA_BUFFER

RETRIEVAL_POINTERS_BUFFER

STARTING_LCN_INPUT_BUFFER

STARTING_VCN_INPUT_BUFFER

USN_JOURNAL_DATA

USN_RECORD

VOLUME_BITMAP_BUFFER

File System Macros:The following macros are used with file systems.以下宏用于文件系统

IsReparseTagMicrosoft

/*The IsReparseTagMicrosoft macro determines whether a reparse point tag indicates a Microsoft reparse point.issetagmicrosoft宏确定reparse点标记是否表示Microsoft reparse点。
  Return Values:The return value is a ULONG that must be treated as zero or nonzero. A nonzero return value indicates that the tag is a Microsoft tag. A zero return value indicates that the tag is not a Microsoft tag. Only software developed by Microsoft or in partnership with Microsoft can use Microsoft tags. All other software must use non-Microsoft tags.返回值是一个必须被视为零或非零的ULONG。非零返回值表示标记是Microsoft标记。零返回值表示标记不是Microsoft标记。只有微软开发的软件或与微软合作开发的软件才能使用微软的标签。所有其他软件必须使用非微软标签。
  Remarks:If the Microsoft tag bit is set, Microsoft provides the tag. All other tags must use zero for this bit.如果设置了Microsoft标记位,则Microsoft提供标记。所有其他标记都必须为这个位使用0。
  Header: Declared in Winnt.h; include Windows.h*/
  
ULONG IsReparseTagMicrosoft(
  ULONG _tag  // tag to be tested  \Reparse point tag to be tested.
);
           

IsReparseTagNameSurrogate

/*The IsReparseTagNameSurrogate macro determines whether a tag's associated reparse point is a surrogate for another named entity, for example a mount volume point.确定标记关联的重新解析点是否为另一个命名实体(例如挂载卷点)的代理。
  Return Values:The return value is a ULONG that must be treated as zero or nonzero. A nonzero return value means that the tag indicates a surrogate reparse point. A zero return value means that the tag does not indicate a surrogate reparse point.返回值是一个必须被视为零或非零的ULONG。非零返回值意味着标记指示代理重新解析点。零返回值意味着标记不指示代理重新解析点。
  Remarks:If the surrogacy bit is set, the file or directory represents another named entity in the system, such as a volume mounted at this directory. For more information on volume mounting, 请查阅URL: File Storage--》Volume Mount Points. 
  Header: Declared in Winnt.h; include Windows.h*/
  
ULONG IsReparseTagNameSurrogate(
  ULONG _tag  // tag to be tested \Reparse point tag to be tested for surrogacy. 
);