有没有办法使用从 GetFileInformationByHandle() 获得的文件 id(FILE_ID_DESCRIPTOR) 打开共享文件夹中的文件

Is there a way to open a file in a shared folder using the file id(FILE_ID_DESCRIPTOR) obtained from GetFileInformationByHandle()

目前,我正在使用以下函数使用其 ID 打开文件。

volHandle = CreateFile(pVolName, ...);
fileHandle = OpenFileById(volHandle, &id, ...)

id(FILE_ID_DESCRIPTOR)是通过GetFinalPathNameByHandle()获取的。

这适用于本地文件,但当我在共享文件夹(来自 windows 或 unix 机器)中的文件上尝试时,我得到无效的 volHandle。

有没有办法使用文件 ID(FILE_ID_DESCRIPTOR) 打开共享文件夹中的文件?

来自 documentation for OpenFileById,强调我的:

In Windows 8 and Windows Server 2012, this function is supported by the following technologies.

Technology Supported

Server Message Block (SMB) 3.0 protocol - No

换句话说,您不能通过网络通过 ID 号打开文件,只能在本地文件系统上打开。