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.

104 lines
2.8 KiB

  1. #define BUFFER_LEN 200
  2. #define REG_STR_LEN 100
  3. #define NUM_LOG_CONF_TYPES 4
  4. #define MAX_STR_LEN 300
  5. typedef DWORD NEXTRET;
  6. #define NR_SUCCESS 0x00000000
  7. #define NR_DONE 0x00000001 // no more configurations
  8. #define NR_INVALID 0x00000002 // invalid previous configuration
  9. //
  10. // Structures
  11. //
  12. //
  13. // Stores information about a device's resource descriptors
  14. //
  15. typedef struct _RES_DES_DATA
  16. {
  17. struct _RES_DES_DATA *Next;
  18. struct _RES_DES_DATA *Prev;
  19. PMEM_RESOURCE pmresMEMResource;
  20. PIO_RESOURCE piresIOResource;
  21. PDMA_RESOURCE pdresDMAResource;
  22. PIRQ_RESOURCE pqresIRQResource;
  23. } RES_DES_DATA, *PRES_DES_DATA;
  24. //
  25. // Stores registry and resource information about a device
  26. //
  27. typedef struct _DEV_INFO
  28. {
  29. struct _DEV_INFO *Next;
  30. struct _DEV_INFO *Prev;
  31. TCHAR szDevNodeID [ MAX_PATH ];
  32. TCHAR szDescription[ MAX_PATH ];
  33. TCHAR szHardwareID [ MAX_PATH ];
  34. TCHAR szService [ MAX_PATH ];
  35. TCHAR szClass [ MAX_PATH ];
  36. TCHAR szManufacturer[ MAX_PATH ];
  37. TCHAR szConfigFlags [ MAX_PATH ];
  38. TCHAR szFriendlyName[ MAX_PATH ];
  39. PRES_DES_DATA prddForcedResDesData;
  40. PRES_DES_DATA prddAllocResDesData;
  41. PRES_DES_DATA prddBasicResDesData;
  42. PRES_DES_DATA prddBootResDesData;
  43. DEVNODE dnParent;
  44. RES_DES_DATA rddOrigConfiguration;
  45. BOOL boolSavedOrigConfiguration;
  46. BOOL boolConfigurable;
  47. BOOL boolDisabled;
  48. } DEV_INFO, *PDEV_INFO;
  49. void CollectDevData();
  50. BOOL ParseEnumerator(IN PTCHAR szEnumBuffer);
  51. BOOL GetDevNodeInfoAndCreateNewDevInfoNode(IN DEVNODE dnDevNode,
  52. IN PTCHAR szDevNodeID,
  53. IN PTCHAR szEnumBuffer);
  54. BOOL CopyRegistryLine(IN DEVNODE dnDevNode,
  55. IN ULONG ulPropertyType,
  56. IN PDEV_INFO pdiDevInfo);
  57. BOOL CopyRegDataToDevInfoNode(IN OUT PDEV_INFO pdiDevInfo,
  58. IN ULONG ulPropertyType,
  59. IN PTCHAR szRegData);
  60. BOOL InitializeInfoNode(IN PDEV_INFO pdiDevInfo,
  61. IN PTCHAR szDevNodeID,
  62. IN DEVNODE dnDevNode);
  63. void RecordFriendlyName(IN PDEV_INFO pdiDevInfo);
  64. BOOL SaveAndDeletePreviousForcedLogConf(IN LOG_CONF lcLogConf,
  65. OUT PDEV_INFO pdiDevInfo);
  66. BOOL GetResDesList(IN OUT PDEV_INFO pdiDevInfo,
  67. IN LOG_CONF lcLogConf,
  68. IN ULONG ulLogConfType);
  69. BOOL ProcessResDesInfo(IN OUT PRES_DES_DATA prddResDesData,
  70. IN RES_DES rdResDes,
  71. IN RESOURCEID ridResourceID);
  72. BOOL UpdateDeviceList();
  73. void DeleteResDesDataNode(IN PRES_DES_DATA prddTmpResDes);
  74. BOOL RecreateResDesList(IN OUT PDEV_INFO pdiTmpDevInfo,
  75. IN ULONG ulLogConfType);
  76. void Cleanup();