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.

55 lines
1.2 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Test program for the healer sample.
  4. //
  5. // Copyright (C) Microsoft Corporation, 2000.
  6. //
  7. //----------------------------------------------------------------------------
  8. #include <stdio.h>
  9. #include <windows.h>
  10. void __cdecl
  11. main(int Argc, char** Argv)
  12. {
  13. printf("GetVersion returns %08X\n", GetVersion());
  14. OSVERSIONINFO OsVer;
  15. OsVer.dwOSVersionInfoSize = sizeof(OsVer);
  16. if (GetVersionEx(&OsVer))
  17. {
  18. switch(OsVer.dwPlatformId)
  19. {
  20. case VER_PLATFORM_WIN32_NT:
  21. printf("Windows NT/2000 ");
  22. break;
  23. case VER_PLATFORM_WIN32_WINDOWS:
  24. printf("Windows 9x/ME ");
  25. break;
  26. default:
  27. printf("Platform %d ", OsVer.dwPlatformId);
  28. break;
  29. }
  30. printf("%d.%02d.%04d\n", OsVer.dwMajorVersion, OsVer.dwMinorVersion,
  31. OsVer.dwBuildNumber);
  32. }
  33. else
  34. {
  35. printf("GetVersionEx failed, %d\n", GetLastError());
  36. }
  37. int i;
  38. printf("\nUsing sti/cli\n");
  39. for (i = 0; i < 10; i++)
  40. {
  41. printf(" %d", i);
  42. __asm sti;
  43. __asm cli;
  44. }
  45. printf("\n");
  46. printf("\nSuccessful\n");
  47. }