What's the difference \\.\C: and \\.\C:\
In MSDN,
String Meani开发者_开发技巧ng
\\.\C: Opens the C: volume. \\.\C:\ Opens the file system of the C: volume.
I could open \\.\C: volume device.
But I couldn't open \\.\C:\ directory by CreateFile.How can I open the directory by CreateFile with \\.\ prefix.
And if I open the directory, what can I do by using the handle.Are C:\ and \\.\C:\ same?
From the same MSDN page:
When opening a volume or removable media drive (for example, a floppy disk drive or flash memory thumb drive), the lpFileName string should be the following form: \.\X:. Do not use a trailing backslash (), which indicates the root directory of a drive. The following table shows some examples of drive strings.
Most likely since the WinAPI does not support the trailing backslash they mean the same but behave differently
精彩评论