I am having difficulty cancelling printer connections using the Win API network functions on an NT server. For example, if the LPT1 is connected to \\server\MYPRINTER using WNetAddConnection all is well. But using WNetCancelConnection2 to cancel the connection doesn't work.

I think this is a known bug but I can't find a workaround.

Thanks,

John