Source code of Windows XP (NT5)
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.

165 lines
3.3 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. autest1.c
  5. Abstract:
  6. This module performs a set of authentication package/logon
  7. process testing.
  8. TO BUILD:
  9. nmake UMTYPE=console UMTEST=autest1
  10. Author:
  11. Jim Kelly 3-Apr-1992.
  12. Revision History:
  13. --*/
  14. #include <nt.h>
  15. #include <ntlsa.h>
  16. #include <ntrtl.h>
  17. #include <nturtl.h>
  18. #include <stdlib.h>
  19. #include <stdio.h>
  20. #include <string.h>
  21. ///////////////////////////////////////////////////////////////////////
  22. // //
  23. // Locally needed data types //
  24. // //
  25. ///////////////////////////////////////////////////////////////////////
  26. ///////////////////////////////////////////////////////////////////////
  27. // //
  28. // Local Macros //
  29. // //
  30. ///////////////////////////////////////////////////////////////////////
  31. ///////////////////////////////////////////////////////////////////////
  32. // //
  33. // Global variables //
  34. // //
  35. ///////////////////////////////////////////////////////////////////////
  36. ///////////////////////////////////////////////////////////////////////
  37. // //
  38. // Internal routine definitions
  39. // //
  40. ///////////////////////////////////////////////////////////////////////
  41. VOID
  42. main (
  43. IN int c,
  44. IN PCHAR v[]
  45. );
  46. ///////////////////////////////////////////////////////////////////////
  47. // //
  48. // Routines //
  49. // //
  50. ///////////////////////////////////////////////////////////////////////
  51. VOID
  52. main (
  53. IN int c,
  54. IN PCHAR v[]
  55. )
  56. /*++
  57. Routine Description:
  58. This routine is the main entry routine for this test.
  59. Arguments:
  60. TBS
  61. Return Value:
  62. TBS
  63. --*/
  64. {
  65. NTSTATUS Status;
  66. STRING LPName;
  67. HANDLE LsaHandle;
  68. LSA_OPERATIONAL_MODE SecurityMode;
  69. RtlInitString( &LPName, "Test");
  70. DbgPrint("Temporary Restriction: THIS TEST MUST BE RUN WITH TCB ENABLED\n\n");
  71. //
  72. // register as a logon process
  73. //
  74. DbgPrint("Registering as logon process . . . . . . . . .");
  75. Status = LsaRegisterLogonProcess( &LPName, &LsaHandle, &SecurityMode );
  76. if (NT_SUCCESS(Status)) {
  77. DbgPrint("Succeeded\n");
  78. //
  79. // de-register as a logon process
  80. //
  81. DbgPrint("Deregistering as logon process . . . . . . . .");
  82. Status = LsaDeregisterLogonProcess( LsaHandle );
  83. if (NT_SUCCESS(Status)) {
  84. DbgPrint("Succeeded\n");
  85. } else {
  86. DbgPrint("*** FAILED ***\n");
  87. }
  88. } else {
  89. DbgPrint("*** FAILED ***\n");
  90. }
  91. DBG_UNREFERENCED_PARAMETER(c);
  92. DBG_UNREFERENCED_PARAMETER(v);
  93. }