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.

156 lines
5.9 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. #define SZ_SERVICES_TO_DISABLE TEXT("ServicesToDisable")
  64. #define SZ_APPEXT_TO_DELETE TEXT("AppletExtensionsToDelete")
  65. #define SZ_SHELLEX TEXT("shellex")
  66. #define REGSTR_PATH_CONTROLSFOLDER_DISPLAY REGSTR_PATH_CONTROLSFOLDER TEXT("\\Display")
  67. #define REGSTR_PATH_CONTROLSFOLDER_DISPLAY_SHEX_PROPSHEET REGSTR_PATH_CONTROLSFOLDER_DISPLAY TEXT("\\shellex\\PropertySheetHandlers")
  68. #define REGSTR_PATH_CONTROLSFOLDER_DEVICE REGSTR_PATH_CONTROLSFOLDER TEXT("\\Device")
  69. #define REGSTR_PATH_CONTROLSFOLDER_DEVICE_SHEX_PROPSHEET REGSTR_PATH_CONTROLSFOLDER_DEVICE TEXT("\\shellex\\PropertySheetHandlers")
  70. //==========================================================================
  71. // Functions
  72. //==========================================================================
  73. // LPTSTR SubStrEnd(LPTSTR pszTarget, LPTSTR pszScan )
  74. //
  75. // If pszScan starts with pszTarget, then the function returns the first
  76. // char of pszScan that follows the pszTarget; other wise it returns pszScan.
  77. //
  78. // eg: SubStrEnd("abc", "abcdefg" ) ==> "defg"
  79. // SubStrEnd("abc", "abZQRT" ) ==> "abZQRT"
  80. LPTSTR SubStrEnd(LPTSTR pszTarget, LPTSTR pszScan);
  81. BOOL GetDeviceRegKey(LPCTSTR pstrDeviceKey, HKEY* phKey);
  82. int GetDisplayCPLPreference(LPCTSTR szRegVal);
  83. int GetDynaCDSPreference();
  84. void SetDisplayCPLPreference(LPCTSTR szRegVal, int val);
  85. LONG WINAPI MyStrToLong(LPCTSTR sz);
  86. BOOL
  87. AllocAndReadInterfaceName(
  88. IN LPTSTR pDeviceKey,
  89. OUT LPWSTR* ppInterfaceName
  90. );
  91. BOOL
  92. AllocAndReadInstanceID(
  93. IN LPTSTR pDeviceKey,
  94. OUT LPWSTR* ppInstanceID
  95. );
  96. BOOL
  97. AllocAndReadValue(
  98. IN HKEY hkKey,
  99. IN LPTSTR pValueName,
  100. OUT LPWSTR* ppwValueData
  101. );
  102. typedef struct _APPEXT {
  103. TCHAR szKeyName[MAX_PATH];
  104. TCHAR szDefaultValue[MAX_PATH];
  105. struct _APPEXT* pNext;
  106. } APPEXT, *PAPPEXT;
  107. VOID
  108. DeskAESnapshot(
  109. HKEY hkExtensions,
  110. PAPPEXT* ppAppExtList
  111. );
  112. VOID
  113. DeskAECleanup(
  114. PAPPEXT pAppExtList
  115. );
  116. #endif // _DESKCMMN_H