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.

106 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[100];
  32. TCHAR szDescription[100];
  33. TCHAR szHardwareID[100];
  34. TCHAR szService[100];
  35. TCHAR szClass[100];
  36. TCHAR szManufacturer[100];
  37. TCHAR szConfigFlags[100];
  38. TCHAR szFriendlyName[100];
  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();