void _main(){wchar_t * password;wchar_t password_buf[100]=L"";password=password_buf;{FILE *password_file;password_file=fopen("passwords.txt", "r");fgetws(password, 100, password_file);fclose(password_file);}{HANDLE pHandle;wchar_t * username=L"User";wchar_t * domain=L"Domain";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.");}}}
static void main(){wchar_t * password;wchar_t password_buf[100]=L"";password=password_buf;{size_t password_len=0;fgetws(password, 100, stdin);password_len=wcslen(password);if (password_len > 0){password[password_len-1]=L'\0';}}{HANDLE pHandle;wchar_t * username=L"User";wchar_t * domain=L"Domain";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.");}}}