I am trying to get the connection target in my program, but the only way I did this is:
- Request backup privileges
- p-invoke CreateFile with special parameters to get the / dir file descriptor.
- Request DeviceIoControl to get the target.
The first step will not work with regular user accounts, because they do not have backup privileges, and I do not want to receive a UAC user consent window every time I do this.
I think this can be done anyway, because the normal command "dir / A: L" resolves the target of the links.
Zolka source
share