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.

69 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 2000-2001 Microsoft Corporation
  3. Module Name:
  4. testperf.c
  5. Abstract:
  6. Test program for very basic perflib features
  7. Author:
  8. 01-Nov-2000 JeePang
  9. Revision History:
  10. --*/
  11. #include <nt.h>
  12. #include <ntrtl.h>
  13. #include <nturtl.h>
  14. #include <windows.h>
  15. #include <ole2.h>
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18. #include <winperf.h>
  19. #define BUFSIZE 1024 * 1024
  20. char Buffer[BUFSIZE];
  21. int _cdecl main(int argc, char *argv[])
  22. {
  23. DWORD status, dwSize;
  24. LANGID iLanguage;
  25. iLanguage = GetUserDefaultLangID();
  26. printf("User locale: %04X Primary %X Sub %X\n",
  27. iLanguage, PRIMARYLANGID(iLanguage), SUBLANGID(iLanguage));
  28. iLanguage = GetSystemDefaultLangID();
  29. printf("System locale: %04X Primary %X Sub %X\n",
  30. iLanguage, PRIMARYLANGID(iLanguage), SUBLANGID(iLanguage));
  31. iLanguage = GetUserDefaultUILanguage();
  32. printf("User UI Language: %04X Primary %X Sub %X\n",
  33. iLanguage, PRIMARYLANGID(iLanguage), SUBLANGID(iLanguage));
  34. iLanguage = GetSystemDefaultUILanguage();
  35. printf("System UI Language: %04X Primary %X Sub %X\n",
  36. iLanguage, PRIMARYLANGID(iLanguage), SUBLANGID(iLanguage));
  37. dwSize = BUFSIZE;
  38. status = RegQueryValueExW(
  39. HKEY_PERFORMANCE_NLSTEXT,
  40. L"Counter",
  41. NULL,
  42. NULL,
  43. Buffer,
  44. &dwSize);
  45. printf("Query NLSTEXT: status=%d dwSize=%d\n", status, dwSize);
  46. }