LogonUser() returns errorcode 2(0x2)

Krishna Kumar J 6 Reputation points

Scenario : Domain user password verification at login screen by my custom credential provider.

  1. I have used LogonUser function for the above scenario with dwLogonType=LOGON32_LOGON_INTERACTIVE.
  2. Using LOGON32_LOGON_NETWORK for dwLogonType fails when the Domain controllers are not reachable(remote work environment) from the PC and hence I moved to LOGON32_LOGON_INTERACTIVE which works for local cached credentials verification also.

Problem : LogonUser is failing with error code 2 (0x2) which doesn't make sense as per system error codes as ERROR_FILE_NOT_FOUND "The system cannot find the file specified".

please help me in,

  1. Identifying the root cause and reason for this error code in order to fix.
  2. Whether I'm using the correct dwLogonType for my scenario ? If not any suggestion ?
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,479 questions
{count} votes