Access to network resources

I am currently trying to access a network share from my machine program using vC ++ 6.0. I am using WNetAddConnection2 to connect to a share using my credentials.

I faced the following problem: Consider a case where 2 users are trying to access the same remote resource from one computer one after the other. Now, when a user logs in, another user cannot log in to the share using their credentials until the first users log out.

Also, if the first user logs on to the root resource of the remote computer, then another user cannot access another resource on that computer.

Please let me know if there is a workaround for this.

Thank you in advance

0


source to share


1 answer


The answer depends on if the 1st user needs it. If they don't, call WNetCancelConnection2 (). If they do, Keith Brown, in her book Windows Security Programming, has the trick of calling LogonUser () to establish a new login session, which creates a new SMB port to avoid conflict. Once impersonated, your thread will be able to connect using different credentials.



+1


source







All Articles