I have an application that runs on a workgroup and not on a domain. The
application needs to open a file located on a second machine using a
different user account to the logged on user.
I have this working using LogonUser() and ImpersonateLoggedOnUser() but
recently I discovered XP Pro has a maximum limit on the number of sessions
(10). When we attempt to open more than 10 files (each file is opened in its
own thread, hence each thread calls the logon functions) the limit is
reached and we receive the error ERROR_REQ_NOT_ACCEP. Similarly, if more
than 10 instances of the same application are running, then not all will be
able to open the files.
I cannot run the process as another user because this does not comply with
the customer requirements.
I have some questions on this problem:
1. In the case where there are multiple threads in the one process, can I
use OpenThreadToken() - or something else - to make each thread work as if
it has logged on without actually having to log on. ie, the first thread
logs on, but each additional thread opens/copies the token from the first.
2. In the case where there are multiple processes running, each of which may
only open 1 file, I cannot see any solution to this situation. Any ideas ?
All help appreciated.