I recently installed some VPN software to let me connect to my college's VPN so I could access the network resources, such as my personal folder. When the software is running, I can access the network resources as if I am part of the network, e.g. with the path \\somename\ it asks for my domain\username and password, and I can access the network resource.
I'm having a hard time thinking of good search terms to find how to do this, so how can I do this with the Windows API? How does it work?
Notice how the second parameter is a domain? That's the name of the authority that you tell this function to use in order to authenticate.
I've sort of done this before, at home I can VPN into my office and run an app that uses this function to log on to the work domain while the station I am running it from is logged into with a local account that would not have the permissions to do any of the things that I have that app doing. In that case the machine I am logging into already has an established domain trust, but that should not matter if you're using VPN.
I guess I wasn't clear enough. I want that this path:
\\my-test\
Does not exist yet, but when I run my program, it does exist and my program decides what appears in it. The whole logging on with credentials thing is just something I thought would be cool to mess with.
So, before I run this software my university provides, if I try to go to \\pc2\ I get an error. When I run the software my university provides, suddenly I have the ability to go to \\pc2\ and see various folders - it's connected to Unix systems located at my university. When I close the software I can't open \\pc2\ anymore.
When I'm opening or saving files, it's kind of slow because of course it's going across the internet, but I assumed it was also going through the software itself.
I mean, I want to write code to do that myself. I want to know which functions in the Windows API I have to use to get the same results. How can here be so much confusion here?
It doesn't help that when I try searching Google just about everything I get is about mounting network drives, which is completely unrelated to what I want.
It doesn't help that when I try searching Google just about everything I get is about mounting network drives, which is completely unrelated to what I want.
Looking at the example code for WNetAddConnection2 makes me say no, unfortunately. Maybe there's a misunderstanding in "map network folder"? I'm not talking about the commonly-known feature of mapping a drive letter to a network path, which is what all my search results explain and what the code example for WNetAddConnection2 does.