简体   繁体   English

这个字符串的含义\\\\。\\ c:

[英]Meaning of this string \\.\c:

I'm reading this . 我正在读这个 Here I've found some code lines, for example: wsprintf(szDrive, "\\\\\\\\.\\\\%c:", *lpszSrc); 在这里,我发现了一些代码行,例如: wsprintf(szDrive, "\\\\\\\\.\\\\%c:", *lpszSrc); I want to ask, what does this string give? 我想问一下,这个字符串给出了什么?

I tried to look for information but all that I've found is: 我试图寻找信息,但我发现的所有信息都是:

In the ANSI version of this function, the name is limited to MAX_PATH characters. 在此函数的ANSI版本中,名称仅限于MAX_PATH字符。 To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\\\?\\" to the path. 要将此限制扩展为32,767个宽字符,请调用该函数的Unicode版本并在路径前加上"\\\\?\\" For more information, see Naming Files, Paths, and Namespaces. 有关更多信息,请参阅命名文件,路径和命名空间。

and this do not answer into my question, so asking here. 这不回答我的问题,所以问这里。 As I think it should be connected with windows specific or NTFS but not sure about that. 我认为它应该与Windows特定或NTFS连接但不确定。

The %c is the single character format specifier for wsprintf . %cwsprintf的单字符格式说明wsprintf

The code is used to generate path names of this form: 该代码用于生成此表单的路径名:

\\.\C:

This is the path to a physical volume. 这是物理卷的路径。 You use such a path when performing file operations directly on a volume, bypassing the file system. 在绕过文件系统直接在卷上执行文件操作时,可以使用此类路径。 So you'd use such a path when implementing raw disk copy, for example. 例如,在实现原始磁盘复制时,您将使用这样的路径。 The documentation for CreateFile has more detail. CreateFile的文档有更多细节。

This all ties in with the fact that the code you found this in performs a raw disk copy. 这一切都与您在此处找到的代码执行原始磁盘副本的事实相关。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM