Windows Driver Development - symbolic link and device name

Equipment under windows is "\ Device \ [device name]" in the form of naming.

Such as device name of the C drive partition, D drive is

"\Device\HarddiskVolume2”
"\Device\HarddiskVolume3”。

You may not specify the device name, the I / O manager automatically assigns a name as a digital device. E.g

"\Device\00000001"

The device name is not easy to remember.

In the driver, you need to define the device object name begins with L "\\ device \\",

The definition of a symbolic link names need to "\\ dosDevices \\" begins with L, (note dosDevices the last character is s, then the function returns failure IoCreateSymbolicLink, for a long time could not find the cause);

Or start with L "\\ ?? \\" can be.

Symbolic links can be understood as an alias devices, more importantly, the device name can only be recognized by other drivers in kernel mode , and aliases can be identified in the user-mode applications . "C:" it is a symbolic link.

In the drive, the symbolic link name is written like this:

L”\\??\\c:”  ---> \??\c:
L"\\??\\HelloDDK" --->\??\HelloDDK L”\\DosDevices\\HelloDDK” ---> \DosDevices\HelloDDK

In kernel mode, it is a symbolic link "\ ?? \" at the beginning, such as the C drive is "\ ?? \ C:",

In user mode, symbolic links are "\\ \." At the beginning, such as the C drive is "\\ \ C:.".

Therefore, in the application, symbolic link:

L"\\\\.\\HelloDDK"-->\\.\HelloDDK

 

Guess you like

Origin www.cnblogs.com/a-s-m/p/12329836.html