The LogonUser function http://msdn.microsoft.com/en-us/library/aa378184(VS.85).aspx returns a handle that you can use to impersonate the user, when you are done using it you call CloseHandle to close it. My question is, do you need to close the handle if the logon attempt fails (ie wrong username or password)?
The LogonUser function http://msdn.microsoft.com/en-us/library/aa378184(VS.85).aspx returns a handle that you can use to impersonate the
Share
No.
LogonUserreturns zero if it fails and no handle is created. Though, if you do callCloseHandleon it,CloseHandleshould just returnERROR_INVALID_HANDLE.