pblah
November 8th, 2007, 07:23 AM
Hi there,
I've been given some sw to support that uses WNetAddConnection2 to connect to remote computers and pull back files. It is a multi threaded application with each thread getting a computer name from a DB and using WNetAddConnection2 with the NETRESOURCE.lpLocalName set to NULL to connect to the remote computer.
1: Is the function thread safe?
2: No other WNet functions are called, specifically WNetCancelConnection2 is never called (and can't be as I have no local name to cancel?). Does windows clean up the connections and when will it do so?
Another application on the server ends up not being able to bind a socket and I'm wondering if the frequent uncanceled calls to WNetAdd are tying resources up?
Thanks,
Patrick
I've been given some sw to support that uses WNetAddConnection2 to connect to remote computers and pull back files. It is a multi threaded application with each thread getting a computer name from a DB and using WNetAddConnection2 with the NETRESOURCE.lpLocalName set to NULL to connect to the remote computer.
1: Is the function thread safe?
2: No other WNet functions are called, specifically WNetCancelConnection2 is never called (and can't be as I have no local name to cancel?). Does windows clean up the connections and when will it do so?
Another application on the server ends up not being able to bind a socket and I'm wondering if the frequent uncanceled calls to WNetAdd are tying resources up?
Thanks,
Patrick