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.

256 lines
6.2 KiB

  1. /* *********************************************************************
  2. * DevInfo.h Header file for DOS ConfigMgr Internal structure
  3. *
  4. * Microsoft Corporation
  5. * Copyright 1993
  6. *
  7. * Author: Nagarajan Subramaniyan
  8. * Created: 9/1/93
  9. *
  10. * Modification history:
  11. *
  12. * **********************************************************************
  13. */
  14. #ifndef _INC_DEVINFO
  15. #define _INC_DEVINFO
  16. /* XLATOFF */
  17. #ifndef FAR
  18. #ifdef IS_32
  19. #define FAR
  20. #else
  21. #define FAR far
  22. #endif
  23. #endif
  24. /* XLATON */
  25. #define MAX_DEVID_LENGTH 10
  26. // device id string length
  27. // EISA/PNP/PCI ids are only (max)8 bytes in length
  28. #define MAX_SERNO_LENGTH MAX_DEVID_LENGTH
  29. #define CONFIG_DEVICE_NAME "CONFIG$"
  30. #define BUSTYPE_UNKNOWN 0
  31. #define BUSTYPE_ISA 1
  32. // ISA PNP bus is also treated as ISA
  33. #define BUSTYPE_EISA 2
  34. #define BUSTYPE_PCI 4
  35. #define BUSTYPE_PCMCIA 8
  36. #define BUSTYPE_PNPISA 0x10
  37. #define BUSTYPE_MCA 0x20
  38. #define BUSTYPE_BIOS 0x40
  39. struct Device_ID_s {
  40. DWORD dwBusID;
  41. // 0 undefined
  42. // 1 ISA
  43. // 2 EISA
  44. // 4 PCI
  45. // 8 PCMCIA
  46. // 0x10 PNP
  47. // 0x20 MCA
  48. DWORD dwDevId;
  49. // physical device ID ; -1 is undefined
  50. DWORD dwSerialNum; // 0 undefined
  51. DWORD dwLogicalID;
  52. // Log device ID for PNP ISA
  53. // Class code for PCI, -1 undefined
  54. DWORD dwFlags;
  55. // Bit 0: Device has been inited
  56. // Bit 1: Device is enabled
  57. // Bit 2: Device Config has been locked
  58. };
  59. /* values for DevId->dwFlags field */
  60. #define DEV_INITED 0x1
  61. // device has been initialized
  62. #define DEV_ENABLED 0x2
  63. // device has been enabled
  64. #define DEV_CONFIG_LOCKED 0x4
  65. // device config was locked
  66. #define DEV_STATIC_FLAGS (DEV_INITED | DEV_ENABLED | DEV_CONFIG_LOCKED )
  67. // for static, motherboard devices, all 3 bits have to be set
  68. #define SERNO_UNKNOWN 0x0
  69. // unknown serial no
  70. #define UNKNOWN_VALUE 0xFFFFFFFF
  71. // unknown devid, log id etc..
  72. typedef struct Device_ID_s DEVICE_ID;
  73. typedef DEVICE_ID *PDEVICE_ID;
  74. typedef struct Device_ID_s FAR *LPDEVICE_ID;
  75. /* XLATOFF */
  76. union Bus_Access {
  77. /* XLATON */
  78. struct PCIAccess_s {
  79. BYTE bBusNumber; // Bus no 0-255
  80. BYTE bDevFuncNumber; // Device # in bits 7:3 and
  81. // Function # in bits 2:0
  82. WORD wPCIReserved; //
  83. } sPCIAccess;
  84. struct EISAAccess_s {
  85. BYTE bSlotNumber; // EISA board slot number
  86. BYTE bFunctionNumber;
  87. WORD wEisaReserved;
  88. } sEISAAccess;
  89. struct PnPAccess_s {
  90. BYTE bCSN; // card slot number
  91. BYTE bLogicalDevNumber; // Logical Device #
  92. WORD wReadDataPort; // Read data port
  93. } sPnPAccess;
  94. struct PCMCIAAccess_s {
  95. BYTE bAdapterNumber; // Card adapter number
  96. BYTE bSocketNumber; // Card socket #
  97. WORD wPCMCIAReserved; // Reserved
  98. } sPCMCIAAccess;
  99. struct BIOSAccess_s {
  100. BYTE bBIOSNode; // Node number
  101. } sBIOSAccess;
  102. /* XLATOFF */
  103. };
  104. typedef union Bus_Access UBUS_ACCESS;
  105. typedef union Bus_Access *PUBUS_ACCESS;
  106. typedef union Bus_Access FAR *LPUBUS_ACCESS;
  107. /* XLATON */
  108. /* ASM
  109. ; Following is supposed to be the max size of the above UNION
  110. ; This is done since H2INC doesn't know how to handle Unions
  111. UBUS_ACCESS_SIZE equ size PnPAccess_s
  112. ;
  113. ; Structure definition for Config_Info_s
  114. ;
  115. Config_Info_s STRUC
  116. sDeviceId db size Device_ID_s dup (?)
  117. uBusAccess db UBUS_ACCESS_SIZE dup (?)
  118. sConfig_Data db size Config_Buff_s dup (?)
  119. Config_Info_s ENDS
  120. ; End assembly
  121. */
  122. /* XLATOFF */
  123. struct Config_Info_s {
  124. DEVICE_ID sDeviceId; // DEVICE ID Info
  125. UBUS_ACCESS uBusAccess; // Bus specific data
  126. CMCONFIG sConfig_Data; // configuration data
  127. // defined in configmg.h
  128. };
  129. typedef struct Config_Info_s CONFIGINFO;
  130. typedef struct Config_Info_s *PCONFIGINFO;
  131. typedef struct Config_Info_s FAR *LPCONFIGINFO;
  132. /* XLATON */
  133. struct Dev_Info_s {
  134. struct Dev_Info_s FAR *lpNxtDevInfo; // ptr to next dev info record
  135. struct Config_Info_s sConfigInfo; // config data info
  136. // variable length
  137. };
  138. typedef struct Dev_Info_s DEVINFO;
  139. typedef struct Dev_Info_s *PDEVINFO;
  140. typedef struct Dev_Info_s FAR *LPDEVINFO;
  141. #define MAX_STATE_DATA_SIZE 300
  142. #define DEVHDR_SIGNATURE 0x4d435744 // "DWCM" = Dos/Windows Config Manager
  143. struct Dev_Header_s {
  144. DWORD DH_Signature; // for verification == DEVHDR_SIGNATURE
  145. DWORD DH_DevCount; // no of devices we know of (and have data)
  146. DWORD DH_TotalSize; // size in bytes (incl. this header )
  147. DWORD DH_LinearAddr; // Linear address if XMS.
  148. char DH_StateData[MAX_STATE_DATA_SIZE];
  149. // Hardware state data
  150. struct Config_Info_s DH_DevInfo; // array of Config Info records
  151. // start here
  152. };
  153. typedef struct Dev_Header_s DEVHEADER;
  154. typedef struct Dev_Header_s *PDEVHEADER;
  155. typedef struct Dev_Header_s FAR *LPDEVHEADER;
  156. /* Structures and definitions for the IOCTL_READ call to CONFIG$ */
  157. struct ConfigDataPtr_s {
  158. DWORD lpConfigPtr;
  159. BYTE bConfigFlags;
  160. };
  161. typedef struct ConfigDataPtr_s CONFIGDATAPTR;
  162. typedef struct ConfigDataPtr_s *PCONFIGDATAPTR;
  163. typedef struct ConfigDataPtr_s FAR *LPCONFIGDATAPTR;
  164. /* Definitions for bConfigFlags */
  165. #define DC_API_ENABLED 1
  166. #define DC_DATA_IN_XMS 2
  167. // default: data in conv mem
  168. /* if Data in conv mem, lpConfigPtr is actually a far ptr to the data
  169. * if Data is in xms, LOWORD(lpConfigPtr) = 0 and HIWORD(lpConfigPtr) is the
  170. * XMS handle.
  171. */
  172. #define MAX_CONFIG 9
  173. #define MAX_PROFILE_LEN 80
  174. #define ULDOCK_ZERO 0xFFFFFFF0
  175. typedef WORD CONFIG;
  176. typedef WORD *PCONFIG;
  177. typedef WORD FAR *LPCONFIG;
  178. struct Map_s {
  179. DWORD MP_dwDock;
  180. DWORD MP_dwSerialNo;
  181. WORD MP_wChecksum;
  182. CONFIG MP_cfg;
  183. };
  184. typedef struct Map_s MAP;
  185. typedef struct Map_s *PMAP;
  186. typedef struct Map_s FAR *LPMAP;
  187. struct Map_DB_s {
  188. WORD MD_imapMax;
  189. struct Map_s MD_rgmap[MAX_CONFIG];
  190. };
  191. typedef struct Map_DB_s MAPDB;
  192. typedef struct Map_DB_s *PMAPDB;
  193. typedef struct Map_DB_s FAR *LPMAPDB;
  194. struct Config_Data_s {
  195. // this data put into CONFIG$ device
  196. DWORD CD_dwDock;
  197. DWORD CD_dwSerialNo;
  198. WORD CD_wChecksum;
  199. CONFIG CD_cfg;
  200. char CD_szFriendlyName[MAX_PROFILE_LEN];
  201. // this data not put into CONFIG$ device
  202. struct Map_DB_s CD_mapdb;
  203. };
  204. typedef struct Config_Data_s CONFIGDATA;
  205. typedef struct Config_Data_s *PCONFIGDATA;
  206. typedef struct Config_Data_s FAR *LPCONFIGDATA;
  207. #endif /* _INC_DEVINFO */