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.

71 lines
2.3 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1994 - 1997.
  5. //
  6. // File: data.cpp
  7. //
  8. // Contents: Defines storage class that maintains data for snap-in nodes.
  9. //
  10. // Classes: CAppData
  11. //
  12. // Functions:
  13. //
  14. // History: 05-27-1997 stevebl Created
  15. //
  16. //---------------------------------------------------------------------------
  17. #include "precomp.hxx"
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23. //+--------------------------------------------------------------------------
  24. //
  25. // Function: SetStringData
  26. //
  27. // Synopsis: helper function to initialize strings that are based on
  28. // binary data
  29. //
  30. // Arguments: [pData] - pointer to structer to be modified
  31. //
  32. // Returns: 0
  33. //
  34. // Modifies: szType, szMach, and szLoc
  35. //
  36. // History: 05-27-1997 stevebl Created
  37. //
  38. // Notes: This function is here to ensure that any routine that needs
  39. // to display this data in a user-friendly manner, will always
  40. // display it in a consistent fashion.
  41. //
  42. // In other words, if the code needs to display this data in
  43. // more than one place, both places will display it in the same
  44. // way.
  45. //
  46. //---------------------------------------------------------------------------
  47. long SetStringData(APP_DATA * pData)
  48. {
  49. // Modifies szType, szLoc, and szMach.
  50. TCHAR szBuffer[256];
  51. ::LoadString(ghInstance, IDS_DATATYPES + (int)pData->type, szBuffer, 256);
  52. pData->szType = szBuffer;
  53. ::LoadString(ghInstance, IDS_OS + pData->pDetails->Platform.dwPlatformId + 1, szBuffer, 256);
  54. pData->szMach = szBuffer;
  55. wsprintf(szBuffer, _T(" %u.%u/"), pData->pDetails->Platform.dwVersionHi, pData->pDetails->Platform.dwVersionLo);
  56. pData->szMach += szBuffer;
  57. ::LoadString(ghInstance, IDS_HW + pData->pDetails->Platform.dwProcessorArch, szBuffer, 256);
  58. pData->szMach += szBuffer;
  59. // pData->szLoc.Format((LPCTSTR)_T("0x%lX"), pData->loc);
  60. GetLocaleInfo(pData->pDetails->Locale, LOCALE_SLANGUAGE, szBuffer, 256);
  61. pData->szLoc = szBuffer;
  62. GetLocaleInfo(pData->pDetails->Locale, LOCALE_SCOUNTRY, szBuffer, 256);
  63. pData->szLoc += _T(" - ");
  64. pData->szLoc += szBuffer;
  65. return 0;
  66. }