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.

128 lines
5.0 KiB

  1. #ifndef _DESKCMMN_H
  2. #define _DESKCMMN_H
  3. //==========================================================================
  4. // Guids
  5. //==========================================================================
  6. DEFINE_GUID(GUID_DISPLAY_ADAPTER_INTERFACE,
  7. 0x5b45201d,
  8. 0xf2f2, 0x4f3b,
  9. 0x85, 0xbb, 0x30, 0xff, 0x1f, 0x95, 0x35, 0x99);
  10. #define SZ_DISPLAY_ADAPTER_INTERFACE_NAME TEXT("{5b45201d-f2f2-4f3b-85bb-30ff1f953599}")
  11. //==========================================================================
  12. // Macros
  13. //==========================================================================
  14. #define SZ_REGISTRYMACHINE TEXT("\\REGISTRY\\MACHINE\\")
  15. #define SZ_PRUNNING_MODE TEXT("PruningMode")
  16. #define SZ_GUID TEXT("VideoID")
  17. #define SZ_VIDEO_DEVICES TEXT("System\\CurrentControlSet\\Control\\Video\\")
  18. #define SZ_COMMON_SUBKEY TEXT("\\Video")
  19. #define SZ_SERVICES_PATH TEXT("System\\CurrentControlSet\\Services\\")
  20. #define SZ_SERVICE TEXT("Service")
  21. #define DCDSF_DYNA (0x0001)
  22. #define DCDSF_ASK (0x0002)
  23. #define DCDSF_PROBABLY (DCDSF_ASK | DCDSF_DYNA)
  24. #define DCDSF_PROBABLY_NOT (DCDSF_ASK | 0)
  25. #define DCDSF_YES (0 | DCDSF_DYNA)
  26. #define DCDSF_NO (0 | 0)
  27. #define REGSTR_VAL_DYNASETTINGSCHANGE TEXT("DynaSettingsChange")
  28. #define SZ_UPGRADE_FROM_PLATFORM TEXT("PlatformId")
  29. #define SZ_UPGRADE_FROM_MAJOR_VERSION TEXT("MajorVersion")
  30. #define SZ_UPGRADE_FROM_MINOR_VERSION TEXT("MinorVersion")
  31. #define SZ_UPGRADE_FROM_BUILD_NUMBER TEXT("BuildNumber")
  32. #define SZ_UPGRADE_FROM_VERSION_DESC TEXT("CSDVersion")
  33. #define SZ_UPGRADE_FROM_PELS_WIDTH TEXT("PelsWidth")
  34. #define SZ_UPGRADE_FROM_PELS_HEIGHT TEXT("PelsHeight")
  35. #define SZ_UPGRADE_FROM_BITS_PER_PEL TEXT("BPP")
  36. #define SZ_UPGRADE_FROM_PLANES TEXT("Planes")
  37. #define SZ_UPGRADE_FROM_DISPLAY_FREQ TEXT("VRefresh")
  38. #define SZ_UPGRADE_FAILED_ALLOW_INSTALL TEXT("FailedAllowInstall")
  39. #define SZ_VIDEOMAP TEXT("HARDWARE\\DEVICEMAP\\VIDEO")
  40. #define SZ_DEVICE TEXT("\\Device")
  41. #define SZ_ENUM TEXT("Enum")
  42. #define SZ_UPDATE_SETTINGS TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\VideoUpgradeDisplaySettings")
  43. #define SZ_UPDATE_SETTINGS_PATH TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion")
  44. #define SZ_UPDATE_SETTINGS_KEY TEXT("VideoUpgradeDisplaySettings")
  45. #define SZ_VU_COUNT TEXT("Count")
  46. #define SZ_VU_PHYSICAL TEXT("Physical")
  47. #define SZ_VU_LOGICAL TEXT("Logical")
  48. #define SZ_VU_BUS_NUMBER TEXT("BusNumber")
  49. #define SZ_VU_ADDRESS TEXT("Address")
  50. #define SZ_VU_PREFERRED_MODE TEXT("UsePreferredMode")
  51. #define SZ_VU_ATTACHED_TO_DESKTOP TEXT("Attach.ToDesktop")
  52. #define SZ_VU_RELATIVE_X TEXT("Attach.RelativeX")
  53. #define SZ_VU_RELATIVE_Y TEXT("Attach.RelativeY")
  54. #define SZ_VU_BITS_PER_PEL TEXT("DefaultSettings.BitsPerPel")
  55. #define SZ_VU_X_RESOLUTION TEXT("DefaultSettings.XResolution")
  56. #define SZ_VU_Y_RESOLUTION TEXT("DefaultSettings.YResolution")
  57. #define SZ_VU_VREFRESH TEXT("DefaultSettings.VRefresh")
  58. #define SZ_VU_FLAGS TEXT("DefaultSettings.Flags")
  59. #define SZ_HW_ACCELERATION TEXT("Acceleration.Level")
  60. #define SZ_VOLATILE_SETTINGS TEXT("VolatileSettings")
  61. #define SZ_DETECT_DISPLAY TEXT("System\\CurrentControlSet\\Control\\GraphicsDrivers\\DetectDisplay")
  62. #define SZ_NEW_DISPLAY TEXT("System\\CurrentControlSet\\Control\\GraphicsDrivers\\NewDisplay")
  63. //==========================================================================
  64. // Functions
  65. //==========================================================================
  66. // LPTSTR SubStrEnd(LPTSTR pszTarget, LPTSTR pszScan )
  67. //
  68. // If pszScan starts with pszTarget, then the function returns the first
  69. // char of pszScan that follows the pszTarget; other wise it returns pszScan.
  70. //
  71. // eg: SubStrEnd("abc", "abcdefg" ) ==> "defg"
  72. // SubStrEnd("abc", "abZQRT" ) ==> "abZQRT"
  73. LPTSTR SubStrEnd(LPTSTR pszTarget, LPTSTR pszScan);
  74. BOOL GetDeviceRegKey(LPCTSTR pstrDeviceKey, HKEY* phKey, BOOL* pbReadOnly);
  75. int GetDisplayCPLPreference(LPCTSTR szRegVal);
  76. int GetDynaCDSPreference();
  77. void SetDisplayCPLPreference(LPCTSTR szRegVal, int val);
  78. LONG WINAPI MyStrToLong(LPCTSTR sz);
  79. BOOL
  80. AllocAndReadInterfaceName(
  81. IN LPTSTR pDeviceKey,
  82. OUT LPWSTR* ppInterfaceName
  83. );
  84. BOOL
  85. AllocAndReadInstanceID(
  86. IN LPTSTR pDeviceKey,
  87. OUT LPWSTR* ppInstanceID
  88. );
  89. BOOL
  90. AllocAndReadValue(
  91. IN HKEY hkKey,
  92. IN LPTSTR pValueName,
  93. OUT LPWSTR* ppwValueData
  94. );
  95. #endif // _DESKCMMN_H