Windows/C++: How do I determine the share name associated with a shared drive? | Let's say I have a drive such as **C:\**, and I want to find out if it's shared and what it's share name (e.g. **C$**) is.


To find out if it's shared, I can use [NetShareCheck](https://learn.microsoft.com/en-us/windows/desktop/api/Lmshare/nf-lmshare-netsharecheck).


How do I then map the drive to its share name? I thought that [NetShareGetInfo](https://learn.microsoft.com/en-us/windows/desktop/api/Lmshare/nf-lmshare-netsharegetinfo) would do it, but it looks like that takes the share name, not the local drive name, as an input.