title: Windows API Clear Authentication Tokens
body: <p>I'm using the <a href="http://msdn.microsoft.com/en-us/library/aa385449%28v=VS.85%29.aspx" rel="noreferrer">WNetEnumResource</a> to enumerate all network share connections and <a href="http://msdn.microsoft.com/en-us/library/aa385427%28v=VS.85%29.aspx" rel="noreferrer">WNetCancelConnection2</a> to close them. Then I am using <a href="http://msdn.microsoft.com/en-us/library/aa385482%28v=VS.85%29.aspx" rel="noreferrer">WNetUseConnection</a> to connect to a share using discrete credentials. This process happens multiple times throughout the day.</p>
  
  <p>The problem that I'm running into is that after the first flow through the process I'm getting:</p>
  
  <blockquote>
    <p>System Error 1219 has occurred.</p>
    
    <p>Multiple connections to a server or shared resource by the same user,
    using more than one user name, are not allowed. Disconnect all
    previous connections to the server or shared resource and try again.</p>
  </blockquote>
  
  <p>This happens even when the enumeration says there are no current connections.</p>
  
  <p>My question is: why? Why am I getting this error? Is the authenticated connection to the server still cached? Can I enumerate these authentication tokens? Kerberos? LSA?</p>
  
  <p>I haven't been able to find the smallest foothold of information to progress forward on this project. Any help is appreciated!</p>