最終更新:2023-12-12 (火) 10:13:02 (133d)  

\\?\
Top / \\?\

To specify an extended-length path, use the "\\?\" prefix. For example, "\\?\D:\very long path".

パイプ

メモ

  • ファイル I/O の場合、パス文字列の "\\?\" プレフィックスは、すべての文字列解析を無効にし、その後に続く文字列をファイル システムに直接送信するように、Windows APIに指示します。
  • たとえば、ファイル システムが大きなパスとファイル名をサポートしている場合は、Windows API によって強制されるMAX_PATH制限を超えることができます。

Naming Files, Paths, and Namespaces

Maximum Path Length Limitation

  • The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters.
  • This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength? parameter of the GetVolumeInformation? function (this value is commonly 255 characters).
  • To specify an extended-length path, use the "\\?\" prefix. For example, "\\?\D:\very long path".

Win32 File Namespaces

  • For file I/O, the "\\?\" prefix to a path string tells the Windows APIs to disable all string parsing and to send the string that follows it straight to the file system.

Win32 Device Namespaces

  • The "\\.\" prefix will access the Win32 device namespace instead of the Win32 file namespace.

デバイスパス

  • \\?\hid#vid_046d&pid_c52b&mi_00#8&216d72e6&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
    \\?\hid#vid_046d&pid_c52b&mi_01&col01#8&269cadc&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
    \\?\hid#vid_046d&pid_c52b&mi_01&col02#8&269cadc&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  • RegisterDeviceNotification

メモ

  • \\?\から始まるパス名についてはサービス機能が次のように働かなくなる。
    • ディレクトリ区切り文字「/」が使用できない。
    • ディレクトリ区切り文字の重複「\\」(C/C++の文字列定数内では"\\\\")が許されない。
    • パス名の途中に \.\ を差し挟めない。
    • パス名の途中に \..\ を差し挟めない。
    • パス名の末尾の「.」や半角スペースが無視されない。

関連