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.

178 lines
4.9 KiB

  1. /////////////////////////////////////////////////////////////////////////
  2. //
  3. // poormansresource.h
  4. //
  5. // Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
  6. //
  7. // History: 10/15/97 Sanj Created by Sanj
  8. // 10/17/97 jennymc Moved things a tiny bit
  9. // 06/05/98 Sanj Removed extraneous definitions.
  10. //
  11. /////////////////////////////////////////////////////////////////////////
  12. #ifndef __POORMANSRESOURCE_H__
  13. #define __POORMANSRESOURCE_H__
  14. #include "cfgmgr32.h"
  15. /*XLATOFF*/
  16. #if ! (defined(lint) || defined(_lint) || defined(RC_INVOKED))
  17. #if ( _MSC_VER >= 800 )
  18. #pragma warning(disable:4103)
  19. #if !(defined( MIDL_PASS )) || defined( __midl )
  20. #pragma pack(push)
  21. #endif
  22. #pragma pack(1)
  23. #else
  24. #pragma pack(1)
  25. #endif
  26. #endif // ! (defined(lint) || defined(_lint) || defined(RC_INVOKED))
  27. /*XLATON*/
  28. struct Mem_Des16_s {
  29. WORD MD_Count;
  30. WORD MD_Type;
  31. ULONG MD_Alloc_Base;
  32. ULONG MD_Alloc_End;
  33. WORD MD_Flags;
  34. WORD MD_Reserved;
  35. };
  36. typedef struct Mem_Des16_s MEM_DES16;
  37. struct IO_Des16_s {
  38. WORD IOD_Count;
  39. WORD IOD_Type;
  40. WORD IOD_Alloc_Base;
  41. WORD IOD_Alloc_End;
  42. WORD IOD_DesFlags;
  43. BYTE IOD_Alloc_Alias;
  44. BYTE IOD_Alloc_Decode;
  45. };
  46. typedef struct IO_Des16_s IO_DES16;
  47. struct DMA_Des16_s {
  48. BYTE DD_Flags;
  49. BYTE DD_Alloc_Chan; // Channel number allocated
  50. BYTE DD_Req_Mask; // Mask of possible channels
  51. BYTE DD_Reserved;
  52. };
  53. typedef struct DMA_Des16_s DMA_DES16;
  54. struct IRQ_Des16_s {
  55. WORD IRQD_Flags;
  56. WORD IRQD_Alloc_Num; // Allocated IRQ number
  57. WORD IRQD_Req_Mask; // Mask of possible IRQs
  58. WORD IRQD_Reserved;
  59. };
  60. typedef struct IRQ_Des16_s IRQ_DES16;
  61. typedef MEM_DES16 *PMEM_DES16;
  62. typedef IO_DES16 *PIO_DES16;
  63. typedef DMA_DES16 *PDMA_DES16;
  64. typedef IRQ_DES16 *PIRQ_DES16;
  65. // BUS Info structs from KBASE
  66. typedef struct PnPAccess_s {
  67. BYTE bCSN; // card slot number
  68. BYTE bLogicalDevNumber; // Logical Device #
  69. WORD wReadDataPort; // Read data port
  70. } sPnPAccess;
  71. typedef struct PCIAccess_s {
  72. BYTE bBusNumber; // Bus no 0-255
  73. BYTE bDevFuncNumber; // Device # in bits 7:3 and
  74. // Function # in bits 2:0
  75. WORD wPCIReserved; //
  76. } sPCIAccess;
  77. typedef struct EISAAccess_s {
  78. BYTE bSlotNumber; // EISA board slot number
  79. BYTE bFunctionNumber;
  80. WORD wEisaReserved;
  81. } sEISAAccess;
  82. typedef struct PCMCIAAccess_s {
  83. WORD wLogicalSocket; // Card socket #
  84. WORD wPCMCIAReserved; // Reserved
  85. } sPCMCIAAccess;
  86. typedef struct BIOSAccess_s {
  87. BYTE bBIOSNode; // Node number
  88. } sBIOSAccess;
  89. /****************************************************************************
  90. *
  91. * CONFIGURATION MANAGER BUS TYPE
  92. *
  93. ***************************************************************************/
  94. #define BusType_None 0x00000000
  95. #define BusType_ISA 0x00000001
  96. #define BusType_EISA 0x00000002
  97. #define BusType_PCI 0x00000004
  98. #define BusType_PCMCIA 0x00000008
  99. #define BusType_ISAPNP 0x00000010
  100. #define BusType_MCA 0x00000020
  101. #define BusType_BIOS 0x00000040
  102. /*********************************************************************
  103. The following information was not copied, it is information I pieced
  104. together on my own. It probably exists somewhere but I was too
  105. lazy to find it, so I pieced it together myself.
  106. **********************************************************************/
  107. // OKAY, Here's my definition of the header that precedes each and every resource
  108. // descriptor as far as I can tell.
  109. // This is the size (as far as I can tell) of the resource header that precedes
  110. // each resource descriptor. The header consists of a DWORD indicating the total
  111. // size of the resource (including the header), a WORD which is the 16-bit Resource
  112. // Id being described, and a byte of padding.
  113. #pragma pack (1)
  114. struct POORMAN_RESDESC_HDR // Hacked out with much pain and frustration
  115. {
  116. DWORD dwResourceSize; // Size of resource including header
  117. DWORD dwResourceId; // Resource Id
  118. };
  119. #pragma pack()
  120. typedef POORMAN_RESDESC_HDR* PPOORMAN_RESDESC_HDR;
  121. #define SIZEOF_RESDESC_HDR sizeof(POORMAN_RESDESC_HDR)
  122. #define FIRST_RESOURCE_OFFSET 8 // Offset off first resource
  123. // Use to mask out all values other than Resource Type (first 5 bits)
  124. #define RESOURCE_TYPE_MASK 0x0000001F
  125. // Use to mask out all values other than OEM Number
  126. #define OEM_NUMBER_MASK 0x00007FE0
  127. /*XLATOFF*/
  128. #if ! (defined(lint) || defined(_lint) || defined(RC_INVOKED))
  129. #if ( _MSC_VER >= 800 )
  130. #pragma warning(disable:4103)
  131. #if !(defined( MIDL_PASS )) || defined( __midl )
  132. #pragma pack(pop)
  133. #else
  134. #pragma pack()
  135. #endif
  136. #else
  137. #pragma pack()
  138. #endif
  139. #endif // ! (defined(lint) || defined(_lint) || defined(RC_INVOKED))
  140. /*XLATON*/
  141. #endif