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.

72 lines
1.1 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. eventtest.c
  5. Abstract:
  6. Test routine for named object squatting fix.
  7. Author:
  8. Jonathan Schwartz (JSchwart) 01-Mar-2002
  9. Environment:
  10. User Mode - Win32
  11. --*/
  12. //
  13. // INCLUDES
  14. //
  15. #include <scpragma.h>
  16. #include <stdio.h>
  17. #include <windows.h> // win32 typedefs
  18. /****************************************************************************/
  19. int __cdecl
  20. wmain (
  21. DWORD argc,
  22. LPWSTR argv[]
  23. )
  24. /*++
  25. Routine Description:
  26. Allows manual testing of the Service Controller by typing commands on
  27. the command line.
  28. Arguments:
  29. Return Value:
  30. --*/
  31. {
  32. //
  33. // Make sure a per-service event (created by the test service that's
  34. // built from this directory) exists and is ACLed as expected.
  35. //
  36. HANDLE hEvent = OpenEvent(SYNCHRONIZE, FALSE, L"\\Services\\Foo\\MyEvent");
  37. if (hEvent == NULL)
  38. {
  39. printf("OpenEvent failed %d\n", GetLastError());
  40. }
  41. else
  42. {
  43. printf("OpenEvent succeeded!\n");
  44. }
  45. }