I have a strange problem using WNetAddConnection2. First of all, I am connecting to the WebDAV folder with the correct server name, username and password. The connection is established as expected, and I see a mapped drive with Windows Explorer.
After that, I call WNetCancelConnection2 to remove the installed drive. Works great and it disappears from the conductor.
Now comes the strange behavior. If I try to connect to the server again, it does not matter what password I use, I can accept the completely wrong option, and the drive will reconnect without any problems. Windows seems to cache the connection.
I found out that it takes exactly one minute, and after that time an attempt to connect will result in the expected error message.
My question is whether this 60 second timeframe is adjustable or what else can I do to avoid this behavior.
Thanks in advance for your help.
source
share