void _main(){{wchar_t * password=(wchar_t *)malloc(100*sizeof(wchar_t));size_t password_len=0;HANDLE pHandle;wchar_t * username=L"User";wchar_t * domain=L"Domain";password[0]=L'\0';fgetws(password, 100, stdin);password_len=wcslen(password);if (password_len > 0){password[password_len-1]=L'\0';}if (LogonUserW( username, domain, password, LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT, &pHandle)!=0){printLine("User logged in successfully.");CloseHandle(pHandle);}else{printLine("Unable to login.");}free(password);}}
static void main(){{wchar_t * password=(wchar_t *)malloc(100*sizeof(wchar_t));size_t password_len=0;HANDLE pHandle;wchar_t * username=L"User";wchar_t * domain=L"Domain";password[0]=L'\0';fgetws(password, 100, stdin);password_len=wcslen(password);if (password_len > 0){password[password_len-1]=L'\0';}if (LogonUserW( username, domain, password, LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT, &pHandle)!=0){printLine("User logged in successfully.");CloseHandle(pHandle);}else{printLine("Unable to login.");}password_len=wcslen(password);SecureZeroMemory(password, password_len * sizeof(wchar_t));}}