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.

207 lines
4.2 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. migrate.h
  5. Environment:
  6. WIN32 User Mode
  7. --*/
  8. #include <windows.h>
  9. #include <tchar.h>
  10. #include <setupapi.h>
  11. #include <ole2.h>
  12. #include <cfgmgr32.h>
  13. #include <devguid.h>
  14. #include <debug.h>
  15. #include "..\common\deskcmmn.h"
  16. #define VU_ATTACHED_TO_DESKTOP 0x00000001
  17. #define VU_RELATIVE_X 0x00000002
  18. #define VU_RELATIVE_Y 0x00000004
  19. #define VU_BITS_PER_PEL 0x00000008
  20. #define VU_X_RESOLUTION 0x00000010
  21. #define VU_Y_RESOLUTION 0x00000020
  22. #define VU_VREFRESH 0x00000040
  23. #define VU_FLAGS 0x00000080
  24. #define VU_HW_ACCELERATION 0x00000100
  25. #define VU_PRUNING_MODE 0x00000200
  26. typedef struct _VU_LOGICAL_DEVICE {
  27. struct _VU_LOGICAL_DEVICE *pNextLogicalDevice;
  28. DWORD DeviceX;
  29. DWORD ValidFields;
  30. DWORD AttachedToDesktop;
  31. DWORD RelativeX;
  32. DWORD RelativeY;
  33. DWORD BitsPerPel;
  34. DWORD XResolution;
  35. DWORD YResolution;
  36. DWORD VRefresh;
  37. DWORD Flags;
  38. DWORD HwAcceleration;
  39. DWORD PruningMode;
  40. } VU_LOGICAL_DEVICE, *PVU_LOGICAL_DEVICE;
  41. typedef struct _VU_PHYSICAL_DEVICE {
  42. struct _VU_PHYSICAL_DEVICE *pNextPhysicalDevice;
  43. PVU_LOGICAL_DEVICE pFirstLogicalDevice;
  44. DWORD CountOfLogicalDevices;
  45. DWORD Legacy;
  46. DWORD BusNumber;
  47. DWORD Address;
  48. } VU_PHYSICAL_DEVICE, *PVU_PHYSICAL_DEVICE;
  49. typedef CMAPI CONFIGRET (WINAPI *PFN_CM_LOCATE_DEVNODE)(
  50. OUT PDEVINST pdnDevInst,
  51. IN DEVINSTID pDeviceID, OPTIONAL
  52. IN ULONG ulFlags
  53. );
  54. typedef BOOL (WINAPI *PFN_SETUP_DI_ENUM_DEVICES_INTERFACES)(
  55. IN HDEVINFO DeviceInfoSet,
  56. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  57. IN CONST GUID *InterfaceClassGuid,
  58. IN DWORD MemberIndex,
  59. OUT PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData
  60. );
  61. typedef BOOL (WINAPI *PFN_SETUP_DI_GET_DEVICE_INTERFACE_DETAIL)(
  62. IN HDEVINFO DeviceInfoSet,
  63. IN PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData,
  64. OUT PSP_DEVICE_INTERFACE_DETAIL_DATA DeviceInterfaceDetailData, OPTIONAL
  65. IN DWORD DeviceInterfaceDetailDataSize,
  66. OUT PDWORD RequiredSize, OPTIONAL
  67. OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  68. );
  69. typedef HKEY (WINAPI *PFN_SETUP_DI_CREATE_DEVICE_INTERFACE_REG_KEY)(
  70. IN HDEVINFO DeviceInfoSet,
  71. IN PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData,
  72. IN DWORD Reserved,
  73. IN REGSAM samDesired,
  74. IN HINF InfHandle, OPTIONAL
  75. IN PCTSTR InfSectionName OPTIONAL
  76. );
  77. typedef HKEY (WINAPI *PFN_SETUP_DI_OPEN_DEVICE_INTERFACE_REG_KEY)(
  78. IN HDEVINFO DeviceInfoSet,
  79. IN PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData,
  80. IN DWORD Reserved,
  81. IN REGSAM samDesired
  82. );
  83. typedef HKEY (WINAPI *PFN_SETUP_DI_CREATE_DEVICE_INTERFACE)(
  84. IN HDEVINFO DeviceInfoSet,
  85. IN PSP_DEVINFO_DATA DeviceInfoData,
  86. IN CONST GUID *InterfaceClassGuid,
  87. IN PCTSTR ReferenceString, OPTIONAL
  88. IN DWORD CreationFlags,
  89. OUT PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData OPTIONAL
  90. );
  91. VOID
  92. SaveOsInfo(
  93. HKEY hKey,
  94. POSVERSIONINFO posVer
  95. );
  96. VOID
  97. SaveLegacyDriver(
  98. HKEY hKey
  99. );
  100. VOID
  101. SaveNT4Services(
  102. HKEY hKey
  103. );
  104. VOID
  105. SaveAppletExtensions(
  106. HKEY hKey
  107. );
  108. BOOL
  109. SaveDisplaySettings(
  110. HKEY hKey,
  111. POSVERSIONINFO posVer
  112. );
  113. VOID
  114. CollectDisplaySettings(
  115. PVU_PHYSICAL_DEVICE* ppPhysicalDevice
  116. );
  117. VOID
  118. LegacyCollectDisplaySettings(
  119. PVU_PHYSICAL_DEVICE* ppPhysicalDevice
  120. );
  121. BOOL
  122. WriteDisplaySettingsToRegistry(
  123. HKEY hKey,
  124. PVU_PHYSICAL_DEVICE pPhysicalDevice
  125. );
  126. BOOL
  127. InsertNode(
  128. PVU_PHYSICAL_DEVICE* ppPhysicalDevice,
  129. PVU_LOGICAL_DEVICE pLogicalDevice,
  130. DWORD Legacy,
  131. DWORD BusNumber,
  132. DWORD Address
  133. );
  134. VOID
  135. FreeAllNodes(
  136. PVU_PHYSICAL_DEVICE pPhysicalDevice
  137. );
  138. BOOL
  139. GetDevInfoData(
  140. IN LPTSTR pDeviceKey,
  141. OUT HDEVINFO* phDevInfo,
  142. OUT PSP_DEVINFO_DATA pDevInfo
  143. );
  144. BOOL
  145. GetDevInfoDataFromInterfaceName(
  146. IN LPWSTR pwInterfaceName,
  147. OUT HDEVINFO* phDevInfo,
  148. OUT PSP_DEVINFO_DATA pDevInfo
  149. );
  150. BOOL
  151. GetDevInfoDataFromInstanceID(
  152. IN LPWSTR pwInstanceID,
  153. OUT HDEVINFO* phDevInfo,
  154. OUT PSP_DEVINFO_DATA pDevInfo
  155. );
  156. BOOL
  157. DeleteKeyAndSubkeys(
  158. HKEY hKey,
  159. LPCTSTR lpSubKey
  160. );