IoCompletionPorts

Is it possible to change the Key value associated with a particular file handle/completion port pair?
I’ve noticed that attempting to do this with both CreateIoCompletionPort() and ZwSetInformationFile()
both return back an error code indicating that an invalid parameter was passed. I checked the parameters,
and they were indeed valid, however is suspect that it may not really be an invalid paramenter, but
an error indicating that im trying to doublely-associate a completion port. If all I want to change is the
CompletionKey value, how would I go about doing that?

asa

You can associate the key and handle with a completion port only once. You
cannot change it again. This is a limitation of the API. This limitation
allows us to enable this association with no locks whatsoever. At the NT
layer the I/O manager returns STATUS_PORT_ALREADY_SET if the application
attempts to associate a completion port on handle the second time.
Unfortunately this maps to ERROR_INVALID_PARAMETER at the WIN32 layer.We
cannot change the error message without breaking compatibility at the Win32
layer.


Nar Ganapathy
Windows Core OS group
This posting is provided “AS IS” with no warranties, and confers no rights.

“Asa Yeamans” wrote in message news:xxxxx@ntdev…
Is it possible to change the Key value associated with a particular file
handle/completion port pair?
I’ve noticed that attempting to do this with both CreateIoCompletionPort()
and ZwSetInformationFile()
both return back an error code indicating that an invalid parameter was
passed. I checked the parameters,
and they were indeed valid, however is suspect that it may not really be an
invalid paramenter, but
an error indicating that im trying to doublely-associate a completion port.
If all I want to change is the
CompletionKey value, how would I go about doing that?

asa