Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. nwtest.c
  5. Abstract:
  6. Main program.
  7. Author:
  8. Glenn Curtis (glennc) June, 1998
  9. Environment:
  10. User Mode - Win32
  11. Revision History:
  12. --*/
  13. #include <nwclient.h>
  14. #include <ntmsv1_0.h>
  15. #include <nwsnames.h>
  16. #include <nwcanon.h>
  17. #include <validc.h>
  18. #include <nwevent.h>
  19. #include <nwdlg.h>
  20. #include <nwreg.h>
  21. #include <nwauth.h>
  22. #include <nwapi.h>
  23. #include <nwmisc.h>
  24. #include <ndsapi32.h>
  25. #include <stdlib.h>
  26. #include <stdio.h> // printf()
  27. #include <string.h> // strtoul()
  28. __cdecl
  29. main(
  30. int Argc,
  31. char **Argv
  32. )
  33. {
  34. DWORD Status = NO_ERROR;
  35. WCHAR Domain[256];
  36. WCHAR UserName[256];
  37. WCHAR Password[256];
  38. WCHAR OldPassword[256];
  39. MSV1_0_INTERACTIVE_LOGON AuthentInfo;
  40. MSV1_0_INTERACTIVE_LOGON PreviousAuthentInfoType;
  41. memset( &AuthentInfo, 0, sizeof( MSV1_0_INTERACTIVE_LOGON ));
  42. memset( &PreviousAuthentInfoType, 0, sizeof( MSV1_0_INTERACTIVE_LOGON ));
  43. AuthentInfo.LogonDomainName.Length = wcslen( L"NTDEV" ) * sizeof( WCHAR );
  44. AuthentInfo.LogonDomainName.MaximumLength = 256 * sizeof( WCHAR );
  45. AuthentInfo.LogonDomainName.Buffer = Domain;
  46. wcscpy( AuthentInfo.LogonDomainName.Buffer, L"NTDEV" );
  47. AuthentInfo.UserName.Length = wcslen( L"glennc" ) * sizeof( WCHAR );
  48. AuthentInfo.UserName.MaximumLength = 256 * sizeof( WCHAR );
  49. AuthentInfo.UserName.Buffer = UserName;
  50. wcscpy( AuthentInfo.UserName.Buffer, L"glennc" );
  51. AuthentInfo.Password.Length = wcslen( L"VWbug01" ) * sizeof( WCHAR );
  52. AuthentInfo.Password.MaximumLength = 256 * sizeof( WCHAR );
  53. AuthentInfo.Password.Buffer = Password;
  54. wcscpy( AuthentInfo.Password.Buffer, L"VWbug01" );
  55. PreviousAuthentInfoType.LogonDomainName.Length = wcslen( L"NTDEV" ) * sizeof( WCHAR );
  56. PreviousAuthentInfoType.LogonDomainName.MaximumLength = 256 * sizeof( WCHAR );
  57. PreviousAuthentInfoType.LogonDomainName.Buffer = Domain;
  58. PreviousAuthentInfoType.UserName.Length = wcslen( L"glennc" ) * sizeof( WCHAR );
  59. PreviousAuthentInfoType.UserName.MaximumLength = 256 * sizeof( WCHAR );
  60. PreviousAuthentInfoType.UserName.Buffer = UserName;
  61. PreviousAuthentInfoType.Password.Length = wcslen( L"VWbug08" ) * sizeof( WCHAR );
  62. PreviousAuthentInfoType.Password.MaximumLength = 256 * sizeof( WCHAR );
  63. PreviousAuthentInfoType.Password.Buffer = OldPassword;
  64. wcscpy( PreviousAuthentInfoType.Password.Buffer, L"VWbug08" );
  65. Status = NPPasswordChangeNotify( L"MSV1_0:Interactive",
  66. (LPVOID) &AuthentInfo,
  67. NULL,
  68. (LPVOID) &PreviousAuthentInfoType,
  69. L"WinSta0",
  70. NULL,
  71. 0 );
  72. return(1);
  73. }