I am working on a simple device driver that I want to connect to the driver from user mode using IRP.
I have problems opening the device driver. Using DeviceTree , I can see the name of the device, for example, \ Device \ MyDevice.
But when I try to open it like this:
hand := CreateFile('\Device\MyDevice', GENERIC_WRITE, 0, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
I always get INVALID_HANDLE_VALUE and GetLastError (the system cannot find the path specified)
What am I doing wrong? I know that the driver works because I see it working and printing in DebugView. So any tips?

windows winapi driver
opc0de
source share