Revise MSDTC support.
1. Remove pointlessly complicated AsyncThreads stuff. Instead use
_beginthread() to clean up threads.
2. Make pgenlist.dll from the structure change of ConnectionClass.
The driver dlls exports the functions described in connexp.h
which are used by pgenlist.dll.
3. Isolate the current communication path if necessary.
While an IAsyncPG object is alive, a ConnectionClass object (hereinafter
refered to as conn-obj) is assigned to it. The assignment has to be
changed in the following cases.
a) SQLDisconnect() is called for the current connection handle which
is assigned to an IAsyncPG object.
Allocate another conn-obj and move the current communication
path (*sock* member of the current conn-obj) to the new conn-obj.
The communicaation path is lost from the current conn-obj and
the new conn-obj is assigned to the IAsyncPG object.
b) Another (global) transaction is about to begin but the current
global transaction is not PREPARED yet.
Same as case a) but will open a new communication path for
the current conn-obj for the subsequent ODBC API calls.
c) Another (global) transaction is about to begin and the current
global transaction is already PREPARED.
Allocate another conn-obj and open a new communication path for
the conn-obj. The new conn-obj is assigned to the IAsyncPG
object only to issue COMMIT/ROLLBACK PREPARED command.
communication pass (*sock* member of the current ConnectionClass
object) to the new object and change the state of the current
object NOT CONNECTED. The IAsyncPG object uses new object instead
of the current object. In case b) the current object will open a
new communication path.