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.

133 lines
2.5 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1997 - 1999
  3. Module Name:
  4. logoncli.cxx
  5. Abstract:
  6. This file contains code to trigger the Winlogon Events for SENS. This
  7. is a test DLL and these private SENS APIs should not be called directly.
  8. Author:
  9. Gopal Parupudi <GopalP>
  10. [Notes:]
  11. optional-notes
  12. Revision History:
  13. GopalP 1/17/1998 Start.
  14. --*/
  15. #include <stdio.h>
  16. #include <stdlib.h>
  17. #include <windows.h>
  18. #include <winwlx.h>
  19. #include <sensapip.h>
  20. #include "senslogn.hxx"
  21. void
  22. Usage(
  23. void
  24. )
  25. {
  26. printf("\nUsage: logoncli [Winlogon Event Number] \n\n");
  27. printf("Options:\n\n");
  28. printf(" WinlogonEventNumber 1 - Logon\n"
  29. " 2 - Logoff\n"
  30. " 3 - Startup\n"
  31. " 4 - StartShell\n"
  32. " 5 - Shutdown\n"
  33. " 6 - Lock\n"
  34. " 7 - Unlock\n"
  35. " 8 - StartScreenSaver\n"
  36. " 9 - StopScreenSaver\n"
  37. "\n\n");
  38. exit(-1);
  39. }
  40. int
  41. main(
  42. int argc,
  43. char **argv
  44. )
  45. {
  46. if (argc != 2)
  47. {
  48. Usage();
  49. }
  50. if ((atoi(argv[1]) < 1) ||
  51. (atoi(argv[1]) > 9))
  52. {
  53. Usage();
  54. }
  55. WLX_NOTIFICATION_INFO Info;
  56. Info.Size = 24;
  57. Info.Flags = 0x0;
  58. Info.UserName = L"JohnDoe";
  59. Info.Domain = L"REDMOND";
  60. Info.WindowStation = L"Default";
  61. Info.hToken = NULL;
  62. switch (atoi(argv[1]))
  63. {
  64. case 1:
  65. SensLogonEvent(&Info);
  66. break;
  67. case 2:
  68. SensLogoffEvent(&Info);
  69. break;
  70. case 3:
  71. SensStartupEvent(&Info);
  72. break;
  73. case 4:
  74. SensStartShellEvent(&Info);
  75. break;
  76. case 5:
  77. SensShutdownEvent(&Info);
  78. break;
  79. case 6:
  80. SensLockEvent(&Info);
  81. break;
  82. case 7:
  83. SensUnlockEvent(&Info);
  84. break;
  85. case 8:
  86. SensStartScreenSaverEvent(&Info);
  87. break;
  88. case 9:
  89. SensStopScreenSaverEvent(&Info);
  90. break;
  91. default:
  92. printf("Bad Event id!\n");
  93. break;
  94. }
  95. return 0;
  96. }