views:

26

answers:

1

Documentation for TransactNamedPipe Function claims that "This parameter can also be a handle to an anonymous pipe, as returned by the CreatePipe function." This would mean that it is possible to use transactions on anonymous pipes. As I understand it transactions are read/write operations and anonymous pipes are either read or write - it doesn't make sense to me.

  1. Is it really possible to use transactions with anonymous pipes?
  2. If yes, how? For example which of the two handles obtained from call to CreatePipe should I pass to TransactNamedPipe?
A: 

Caveat: I have not tried this. However the MSDN docs for CreatePipe contain corroborative evidence for why this might work. These docs are very mature at this point - named pipes were a very early Windows transport - and it would surprise me if this is incorrect.

Anonymous pipes are implemented using a named pipe with a unique name. Therefore, you can often pass a handle to an anonymous pipe to a function that requires a handle to a named pipe.

This, in combination with the quote you provided above, suggests this will work. Not sure what handle (read or write) from CreatePipe you would use - maybe either will work, since this is a single duplex named pipe under the covers.

Steve Townsend