ReactOS 0.4.16-dev-36-g301675c
precomp.h File Reference
#include <apitest.h>
#include <ndk/rtlfuncs.h>
#include <isapnphw.h>
#include <isapnpres.h>
Include dependency graph for precomp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _ISAPNP_FDO_EXTENSION
 
struct  _ISAPNP_PDO_EXTENSION
 
struct  _ISAPNP_CARD_LOGICAL_DEVICE
 
struct  _ISAPNP_CARD
 

Macros

#define WIN32_NO_STATUS
 
#define UNIT_TEST
 
#define PAGED_CODE()
 
#define CODE_SEG(segment)
 
#define DPRINT(...)   do { if (0) { trace(__VA_ARGS__); } } while (0)
 
#define DPRINT1(...)   do { if (0) { trace(__VA_ARGS__); } } while (0)
 
#define KeStallExecutionProcessor(MicroSeconds)
 
#define TAG_ISAPNP   'pasI'
 
#define TEST_MAX_SUPPORTED_DEVICES   7
 
#define expect_resource_list_header(ResourceList, ExpectedIface, ExpectedCount)
 
#define expect_requirements_list_header(ReqList, ExpectedIface, ExpectedCount)
 
#define expect_alt_list_header(AltList, ExpectedCount)
 
#define expect_port_req(Desc, ExpectedOption, ExpectedFlags, ExpectedShare, ExpectedLength, ExpectedAlign, ExpectedMin, ExpectedMax)
 
#define expect_irq_req(Desc, ExpectedOption, ExpectedFlags, ExpectedShare, ExpectedMin, ExpectedMax)
 
#define expect_dma_req(Desc, ExpectedOption, ExpectedFlags, ExpectedShare, ExpectedMin, ExpectedMax)
 
#define expect_mem_req(Desc, ExpectedOption, ExpectedFlags, ExpectedShare, ExpectedLength, ExpectedAlign, ExpectedMin, ExpectedMax)
 
#define expect_cfg_req(Desc, ExpectedOption, ExpectedFlags, ExpectedShare, ExpectedPriority, ExpectedRes1, ExpectedRes2)
 
#define expect_port_res(Desc, ExpectedFlags, ExpectedShare, ExpectedLength, ExpectedStart)
 
#define expect_irq_res(Desc, ExpectedFlags, ExpectedShare, ExpectedLevel, ExpectedVector, ExpectedAffinity)
 
#define expect_dma_res(Desc, ExpectedFlags, ExpectedShare, ExpectedChannel)
 
#define expect_mem_res(Desc, ExpectedFlags, ExpectedShare, ExpectedLength, ExpectedStart)
 

Typedefs

typedef PVOID PDEVICE_OBJECT
 
typedef struct _ISAPNP_FDO_EXTENSION ISAPNP_FDO_EXTENSION
 
typedef struct _ISAPNP_FDO_EXTENSIONPISAPNP_FDO_EXTENSION
 
typedef struct _ISAPNP_PDO_EXTENSION ISAPNP_PDO_EXTENSION
 
typedef struct _ISAPNP_PDO_EXTENSIONPISAPNP_PDO_EXTENSION
 
typedef enum _ISAPNP_STATE ISAPNP_STATE
 
typedef struct _ISAPNP_CARD_LOGICAL_DEVICE ISAPNP_CARD_LOGICAL_DEVICE
 
typedef struct _ISAPNP_CARD_LOGICAL_DEVICEPISAPNP_CARD_LOGICAL_DEVICE
 
typedef struct _ISAPNP_CARD ISAPNP_CARD
 
typedef struct _ISAPNP_CARDPISAPNP_CARD
 

Enumerations

enum  _ISAPNP_STATE { IsaWaitForKey = 0 , IsaSleep = 1 , IsaIsolation = 2 , IsaConfgure = 3 }
 

Functions

FORCEINLINE PVOID ExAllocatePoolWithTag (ULONG PoolType, SIZE_T NumberOfBytes, ULONG Tag)
 
FORCEINLINE PVOID ExAllocatePoolZero (ULONG PoolType, SIZE_T NumberOfBytes, ULONG Tag)
 
FORCEINLINE VOID ExFreePoolWithTag (PVOID MemPtr, ULONG Tag)
 
FORCEINLINE SIZE_T GetPoolAllocSize (PVOID MemPtr)
 
UCHAR NTAPI READ_PORT_UCHAR (_In_ PUCHAR Port)
 
VOID NTAPI WRITE_PORT_UCHAR (_In_ PUCHAR Port, _In_ UCHAR Value)
 
VOID IsaBusCreateCard (_Inout_ PISAPNP_CARD Card, _In_ PVOID PnpRom, _In_ ULONG RomSize, _In_ ULONG LogicalDevices)
 
VOID DrvCreateCard1 (_In_ PISAPNP_CARD Card)
 
VOID DrvTestCard1Dev1Resources (_In_ PCM_RESOURCE_LIST ResourceList, _In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 
VOID DrvTestCard1Dev2Resources (_In_ PCM_RESOURCE_LIST ResourceList, _In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 
VOID DrvTestCard1Dev3Resources (_In_ PCM_RESOURCE_LIST ResourceList, _In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 
VOID DrvTestCard1Dev4Resources (_In_ PCM_RESOURCE_LIST ResourceList, _In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 
VOID DrvTestCard1Dev5Resources (_In_ PCM_RESOURCE_LIST ResourceList, _In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 
VOID DrvTestCard1Dev6Resources (_In_ PCM_RESOURCE_LIST ResourceList, _In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 
VOID DrvTestCard1Dev7Resources (_In_ PCM_RESOURCE_LIST ResourceList, _In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 
PCM_RESOURCE_LIST DrvTestCard1Dev6CreateConfigurationResources (VOID)
 
VOID DrvTestCard1Dev6ConfigurationResult (_In_ PISAPNP_CARD_LOGICAL_DEVICE LogDev)
 
VOID DrvCreateCard2 (_In_ PISAPNP_CARD Card)
 

Macro Definition Documentation

◆ CODE_SEG

#define CODE_SEG (   segment)

Definition at line 24 of file precomp.h.

◆ DPRINT

#define DPRINT (   ...)    do { if (0) { trace(__VA_ARGS__); } } while (0)

Definition at line 25 of file precomp.h.

◆ DPRINT1

#define DPRINT1 (   ...)    do { if (0) { trace(__VA_ARGS__); } } while (0)

Definition at line 26 of file precomp.h.

◆ expect_alt_list_header

#define expect_alt_list_header (   AltList,
  ExpectedCount 
)
Value:
do { \
ok_eq_int((AltList)->Version, 1); \
ok_eq_int((AltList)->Revision, 1); \
ok_eq_ulong((AltList)->Count, (ExpectedCount)); \
} while (0)
_In_ ULONG Revision
Definition: rtlfuncs.h:1142
int Count
Definition: noreturn.cpp:7
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469

Definition at line 218 of file precomp.h.

◆ expect_cfg_req

#define expect_cfg_req (   Desc,
  ExpectedOption,
  ExpectedFlags,
  ExpectedShare,
  ExpectedPriority,
  ExpectedRes1,
  ExpectedRes2 
)
Value:
do { \
ok((Desc)->Type == CmResourceTypeConfigData, \
"Desc->Type = %u, expected %u\n", (Desc)->Type, CmResourceTypeConfigData); \
ok((Desc)->Option == (ExpectedOption), \
"Desc->Option = %u, expected %u\n", (Desc)->Option, (ExpectedOption)); \
ok((Desc)->Flags == (ExpectedFlags), \
"Desc->Flags = %x, expected %x\n", (Desc)->Flags, (ExpectedFlags)); \
ok((Desc)->ShareDisposition == (ExpectedShare), \
"Desc->ShareDisposition = %u, expected %u\n", \
(Desc)->ShareDisposition, (ExpectedShare)); \
ok((Desc)->u.ConfigData.Priority == (ExpectedPriority), \
"Desc->u.ConfigData.Priority = %lx, expected %lx\n", \
(Desc)->u.ConfigData.Priority, (ExpectedPriority)); \
ok((Desc)->u.ConfigData.Reserved1 == (ExpectedRes1), \
"Desc->u.ConfigData.Reserved1 = %lx, expected %lx\n", \
(Desc)->u.ConfigData.Reserved2, (ExpectedRes1)); \
ok((Desc)->u.ConfigData.Reserved2 == (ExpectedRes2), \
"Desc->u.ConfigData.Reserved2 = %lx, expected %lx\n", \
(Desc)->u.ConfigData.Reserved2, (ExpectedRes2)); \
} while (0)
Type
Definition: Type.h:7
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
#define CmResourceTypeConfigData
Definition: hwresource.cpp:130
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Definition at line 317 of file precomp.h.

◆ expect_dma_req

#define expect_dma_req (   Desc,
  ExpectedOption,
  ExpectedFlags,
  ExpectedShare,
  ExpectedMin,
  ExpectedMax 
)
Value:
do { \
ok((Desc)->Type == CmResourceTypeDma, \
"Desc->Type = %u, expected %u\n", (Desc)->Type, CmResourceTypeDma); \
ok((Desc)->Option == (ExpectedOption), \
"Desc->Option = %u, expected %u\n", (Desc)->Option, (ExpectedOption)); \
ok((Desc)->Flags == (ExpectedFlags), \
"Desc->Flags = %x, expected %x\n", (Desc)->Flags, (ExpectedFlags)); \
ok((Desc)->ShareDisposition == (ExpectedShare), \
"Desc->ShareDisposition = %u, expected %u\n", \
(Desc)->ShareDisposition, (ExpectedShare)); \
ok((Desc)->u.Dma.MinimumChannel == (ExpectedMin), \
"Desc->u.Dma.MinimumChannel = %lu, expected %lu\n", \
(Desc)->u.Dma.MinimumChannel, (ExpectedMin)); \
ok((Desc)->u.Dma.MaximumChannel == (ExpectedMax), \
"Desc->u.Dma.MaximumChannel = %lu, expected %lu\n", \
(Desc)->u.Dma.MaximumChannel, (ExpectedMax)); \
} while (0)
#define CmResourceTypeDma
Definition: hwresource.cpp:126

Definition at line 271 of file precomp.h.

◆ expect_dma_res

#define expect_dma_res (   Desc,
  ExpectedFlags,
  ExpectedShare,
  ExpectedChannel 
)
Value:
do { \
ok((Desc)->Type == CmResourceTypeDma, \
"Desc->Type = %u, expected %u\n", (Desc)->Type, CmResourceTypeDma); \
ok((Desc)->Flags == (ExpectedFlags), \
"Desc->Flags = %x, expected %x\n", (Desc)->Flags, (ExpectedFlags)); \
ok((Desc)->ShareDisposition == (ExpectedShare), \
"Desc->ShareDisposition = %u, expected %u\n", \
(Desc)->ShareDisposition, (ExpectedShare)); \
ok((Desc)->u.Dma.Channel == (ExpectedChannel), \
"Desc->u.Dma.Channel = %lu, expected %lu\n", \
(Desc)->u.Dma.Channel, (ExpectedChannel)); \
ok((Desc)->u.Dma.Port == 0ul, \
"Desc->u.Dma.Port = %lu, expected %lu\n", \
(Desc)->u.Dma.Port, 0ul); \
ok((Desc)->u.Dma.Reserved1 == 0ul, \
"Desc->u.Dma.Reserved1 = %lx, expected 0\n", (Desc)->u.Dma.Reserved1); \
} while (0)

Definition at line 375 of file precomp.h.

◆ expect_irq_req

#define expect_irq_req (   Desc,
  ExpectedOption,
  ExpectedFlags,
  ExpectedShare,
  ExpectedMin,
  ExpectedMax 
)
Value:
do { \
ok((Desc)->Type == CmResourceTypeInterrupt, \
"Desc->Type = %u, expected %u\n", (Desc)->Type, CmResourceTypeInterrupt); \
ok((Desc)->Option == (ExpectedOption), \
"Desc->Option = %u, expected %u\n", (Desc)->Option, (ExpectedOption)); \
ok((Desc)->Flags == (ExpectedFlags), \
"Desc->Flags = %x, expected %x\n", (Desc)->Flags, (ExpectedFlags)); \
ok((Desc)->ShareDisposition == (ExpectedShare), \
"Desc->ShareDisposition = %u, expected %u\n", \
(Desc)->ShareDisposition, (ExpectedShare)); \
ok((Desc)->u.Interrupt.MinimumVector == (ExpectedMin), \
"Desc->u.Interrupt.MinimumVector = %lu, expected %lu\n", \
(Desc)->u.Interrupt.MinimumVector, (ExpectedMin)); \
ok((Desc)->u.Interrupt.MaximumVector == (ExpectedMax), \
"Desc->u.Interrupt.MaximumVector = %lu, expected %lu\n", \
(Desc)->u.Interrupt.MaximumVector, (ExpectedMax)); \
} while (0)
#define CmResourceTypeInterrupt
Definition: hwresource.cpp:124

Definition at line 251 of file precomp.h.

◆ expect_irq_res

#define expect_irq_res (   Desc,
  ExpectedFlags,
  ExpectedShare,
  ExpectedLevel,
  ExpectedVector,
  ExpectedAffinity 
)
Value:
do { \
ok((Desc)->Type == CmResourceTypeInterrupt, \
"Desc->Type = %u, expected %u\n", (Desc)->Type, CmResourceTypeInterrupt); \
ok((Desc)->Flags == (ExpectedFlags), \
"Desc->Flags = %x, expected %x\n", (Desc)->Flags, (ExpectedFlags)); \
ok((Desc)->ShareDisposition == (ExpectedShare), \
"Desc->ShareDisposition = %u, expected %u\n", \
(Desc)->ShareDisposition, (ExpectedShare)); \
ok((Desc)->u.Interrupt.Level == (ExpectedLevel), \
"Desc->u.Interrupt.Level = %lu\n", (Desc)->u.Interrupt.Level); \
ok((Desc)->u.Interrupt.Vector == (ExpectedVector), \
"Desc->u.Interrupt.Vector = %lu\n", (Desc)->u.Interrupt.Vector); \
ok((Desc)->u.Interrupt.Affinity == (ExpectedAffinity), \
"Desc->u.Interrupt.Affinity = %Ix\n", (Desc)->u.Interrupt.Affinity); \
} while (0)

Definition at line 357 of file precomp.h.

◆ expect_mem_req

#define expect_mem_req (   Desc,
  ExpectedOption,
  ExpectedFlags,
  ExpectedShare,
  ExpectedLength,
  ExpectedAlign,
  ExpectedMin,
  ExpectedMax 
)
Value:
do { \
ok((Desc)->Type == CmResourceTypeMemory, \
"Desc->Type = %u, expected %u\n", (Desc)->Type, CmResourceTypeMemory); \
ok((Desc)->Option == (ExpectedOption), \
"Desc->Option = %u, expected %u\n", (Desc)->Option, (ExpectedOption)); \
ok((Desc)->Flags == (ExpectedFlags), \
"Desc->Flags = %x, expected %x\n", (Desc)->Flags, (ExpectedFlags)); \
ok((Desc)->ShareDisposition == (ExpectedShare), \
"Desc->ShareDisposition = %u, expected %u\n", \
(Desc)->ShareDisposition, (ExpectedShare)); \
ok((Desc)->u.Memory.Length == (ExpectedLength), \
"Desc->u.Memory.Length = %lx, expected %lx\n", \
(Desc)->u.Memory.Length, (ExpectedLength)); \
ok((Desc)->u.Memory.Alignment == (ExpectedAlign), \
"Desc->u.Memory.Alignment = %lx, expected %lx\n", \
(Desc)->u.Memory.Alignment, (ExpectedAlign)); \
ok((Desc)->u.Memory.MinimumAddress.QuadPart == (ExpectedMin), \
"Desc->u.Memory.MinimumAddress = 0x%I64x, expected 0x%I64x\n", \
(Desc)->u.Memory.MinimumAddress.QuadPart, (ExpectedMin)); \
ok((Desc)->u.Memory.MaximumAddress.QuadPart == (ExpectedMax), \
"Desc->u.Memory.MaximumAddress = 0x%I64x, expected 0x%I64x\n", \
(Desc)->u.Memory.MaximumAddress.QuadPart, (ExpectedMax)); \
} while (0)
#define CmResourceTypeMemory
Definition: hwresource.cpp:125

Definition at line 291 of file precomp.h.

◆ expect_mem_res

#define expect_mem_res (   Desc,
  ExpectedFlags,
  ExpectedShare,
  ExpectedLength,
  ExpectedStart 
)
Value:
do { \
ok((Desc)->Type == CmResourceTypeMemory, \
"Desc->Type = %u, expected %u\n", (Desc)->Type, CmResourceTypeMemory); \
ok((Desc)->Flags == (ExpectedFlags), \
"Desc->Flags = %x, expected %x\n", (Desc)->Flags, (ExpectedFlags)); \
ok((Desc)->ShareDisposition == (ExpectedShare), \
"Desc->ShareDisposition = %u, expected %u\n", \
(Desc)->ShareDisposition, (ExpectedShare)); \
ok((Desc)->u.Memory.Length == (ExpectedLength), \
"Desc->u.Memory.Length = %lx, expected %lx\n", \
(Desc)->u.Memory.Length, (ExpectedLength)); \
ok((Desc)->u.Memory.Start.QuadPart == (ExpectedStart), \
"Desc->u.Memory.Start = 0x%I64x, expected 0x%I64x\n", \
(Desc)->u.Memory.Start.QuadPart, (ExpectedStart)); \
} while (0)

Definition at line 394 of file precomp.h.

◆ expect_port_req

#define expect_port_req (   Desc,
  ExpectedOption,
  ExpectedFlags,
  ExpectedShare,
  ExpectedLength,
  ExpectedAlign,
  ExpectedMin,
  ExpectedMax 
)
Value:
do { \
ok((Desc)->Type == CmResourceTypePort, \
"Desc->Type = %u, expected %u\n", (Desc)->Type, CmResourceTypePort); \
ok((Desc)->Option == (ExpectedOption), \
"Desc->Option = %u, expected %u\n", (Desc)->Option, (ExpectedOption)); \
ok((Desc)->Flags == (ExpectedFlags), \
"Desc->Flags = %x, expected %x\n", (Desc)->Flags, (ExpectedFlags)); \
ok((Desc)->ShareDisposition == (ExpectedShare), \
"Desc->ShareDisposition = %u, expected %u\n", \
(Desc)->ShareDisposition, (ExpectedShare)); \
ok((Desc)->u.Port.Length == (ExpectedLength), \
"Desc->u.Port.Length = %lx, expected %lx\n", \
(Desc)->u.Port.Length, (ExpectedLength)); \
ok((Desc)->u.Port.Alignment == (ExpectedAlign), \
"Desc->u.Port.Alignment = %lu, expected %lu\n", \
(Desc)->u.Port.Alignment, (ExpectedAlign)); \
ok((Desc)->u.Port.MinimumAddress.QuadPart == (ExpectedMin), \
"Desc->u.Port.MinimumAddress = 0x%I64x, expected 0x%I64x\n", \
(Desc)->u.Port.MinimumAddress.QuadPart, (ExpectedMin)); \
ok((Desc)->u.Port.MaximumAddress.QuadPart == (ExpectedMax), \
"Desc->u.Port.MaximumAddress = 0x%I64x, expected 0x%I64x\n", \
(Desc)->u.Port.MaximumAddress.QuadPart, (ExpectedMax)); \
} while (0)
#define CmResourceTypePort
Definition: hwresource.cpp:123

Definition at line 225 of file precomp.h.

◆ expect_port_res

#define expect_port_res (   Desc,
  ExpectedFlags,
  ExpectedShare,
  ExpectedLength,
  ExpectedStart 
)
Value:
do { \
ok((Desc)->Type == CmResourceTypePort, \
"Desc->Type = %u, expected %u\n", (Desc)->Type, CmResourceTypePort); \
ok((Desc)->Flags == (ExpectedFlags), \
"Desc->Flags = %x, expected %x\n", (Desc)->Flags, (ExpectedFlags)); \
ok((Desc)->ShareDisposition == (ExpectedShare), \
"Desc->ShareDisposition = %u, expected %u\n", \
(Desc)->ShareDisposition, (ExpectedShare)); \
ok((Desc)->u.Port.Length == (ExpectedLength), \
"Desc->u.Port.Length = %lx, expected %lx\n", \
(Desc)->u.Port.Length, (ExpectedLength)); \
ok((Desc)->u.Port.Start.QuadPart == (ExpectedStart), \
"Desc->u.Port.Start = 0x%I64x, expected 0x%I64x\n", \
(Desc)->u.Port.Start.QuadPart, (ExpectedStart)); \
} while (0)

Definition at line 340 of file precomp.h.

◆ expect_requirements_list_header

#define expect_requirements_list_header (   ReqList,
  ExpectedIface,
  ExpectedCount 
)
Value:
do { \
ok_eq_int((ReqList)->InterfaceType, (ExpectedIface)); \
ok_eq_ulong((ReqList)->BusNumber, 0UL); \
ok_eq_ulong((ReqList)->SlotNumber, 0UL); \
ok_eq_ulong((ReqList)->AlternativeLists, (ExpectedCount)); \
} while (0)
#define UL
Definition: tui.h:165
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID InterfaceType
Definition: wdffdo.h:463
_In_ WDFIORESREQLIST _In_ ULONG SlotNumber
Definition: wdfresource.h:68
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:160

Definition at line 210 of file precomp.h.

◆ expect_resource_list_header

#define expect_resource_list_header (   ResourceList,
  ExpectedIface,
  ExpectedCount 
)
Value:
do { \
ok_eq_int((ResourceList)->List[0].InterfaceType, (ExpectedIface)); \
ok_eq_ulong((ResourceList)->List[0].BusNumber, 0UL); \
ok_eq_int((ResourceList)->List[0].PartialResourceList.Version, 1); /* 0 */ \
ok_eq_int((ResourceList)->List[0].PartialResourceList.Revision, 1); /* 0x3000 */ \
ok_eq_ulong((ResourceList)->List[0].PartialResourceList.Count, (ExpectedCount)); \
} while (0)
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:309
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550

Definition at line 201 of file precomp.h.

◆ KeStallExecutionProcessor

#define KeStallExecutionProcessor (   MicroSeconds)

Definition at line 27 of file precomp.h.

◆ PAGED_CODE

#define PAGED_CODE ( )

Definition at line 23 of file precomp.h.

◆ TAG_ISAPNP

#define TAG_ISAPNP   'pasI'

Definition at line 78 of file precomp.h.

◆ TEST_MAX_SUPPORTED_DEVICES

#define TEST_MAX_SUPPORTED_DEVICES   7

Definition at line 113 of file precomp.h.

◆ UNIT_TEST

#define UNIT_TEST

Definition at line 17 of file precomp.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 12 of file precomp.h.

Typedef Documentation

◆ ISAPNP_CARD

◆ ISAPNP_CARD_LOGICAL_DEVICE

◆ ISAPNP_FDO_EXTENSION

◆ ISAPNP_PDO_EXTENSION

◆ ISAPNP_STATE

◆ PDEVICE_OBJECT

Definition at line 15 of file precomp.h.

◆ PISAPNP_CARD

◆ PISAPNP_CARD_LOGICAL_DEVICE

◆ PISAPNP_FDO_EXTENSION

◆ PISAPNP_PDO_EXTENSION

Enumeration Type Documentation

◆ _ISAPNP_STATE

Enumerator
IsaWaitForKey 
IsaSleep 
IsaIsolation 
IsaConfgure 

Definition at line 100 of file precomp.h.

101{
102 IsaWaitForKey = 0,
103 IsaSleep = 1,
104 IsaIsolation = 2,
105 IsaConfgure = 3
@ IsaSleep
Definition: precomp.h:103
@ IsaConfgure
Definition: precomp.h:105
@ IsaIsolation
Definition: precomp.h:104
@ IsaWaitForKey
Definition: precomp.h:102
enum _ISAPNP_STATE ISAPNP_STATE

Function Documentation

◆ DrvCreateCard1()

VOID DrvCreateCard1 ( _In_ PISAPNP_CARD  Card)

Definition at line 226 of file res_card.c.

228{
230
232
233 /* NOTE: Boot resources of the devices should be made from the requirements */
234
235 /* ********************* DEVICE 1 ********************* */
236 LogDev = &Card->LogDev[0];
237
238 /*
239 * Assign some I/O base but don't enable decodes.
240 * The driver will ignore such I/O configuration.
241 */
242 LogDev->Registers[0x60] = 0x03;
243 LogDev->Registers[0x61] = 0x90;
244
245 /* ******************* DEVICE 2, 3, 4 ***************** */
246 LogDev++;
247 LogDev++;
248 LogDev++;
249
250 /* ********************* DEVICE 5 ********************* */
251 LogDev++;
252
253 /* Enable decodes */
254 LogDev->Registers[0x30] = 0x01;
255
256 /* No DMA is active */
257 LogDev->Registers[0x74] = 0x04;
258 LogDev->Registers[0x75] = 0x04;
259
260 /* Memory 32 Base #0 0xD6000 */
261 LogDev->Registers[0x76] = 0x00;
262 LogDev->Registers[0x77] = 0x0D;
263 LogDev->Registers[0x78] = 0x60;
264 LogDev->Registers[0x79] = 0x00;
265 /* Memory 32 Control #0 - enable range length, 8-bit memory */
266 LogDev->Registers[0x7A] = 0x00;
267 /* Memory 32 Range length #0 0xFFFF8000 (32kB) */
268 LogDev->Registers[0x7B] = 0xFF;
269 LogDev->Registers[0x7C] = 0xFF;
270 LogDev->Registers[0x7D] = 0x80;
271 LogDev->Registers[0x7E] = 0x00;
272
273 /* Memory 32 Base #1 0xC8000 */
274 LogDev->Registers[0x80] = 0x00;
275 LogDev->Registers[0x81] = 0x0C;
276 LogDev->Registers[0x82] = 0x80;
277 LogDev->Registers[0x83] = 0x00;
278 /* Memory 32 Control #1 - enable upper limit, 8-bit memory */
279 LogDev->Registers[0x84] = 0x01;
280 /* Memory 32 Limit #1 0xD0000 (0xC8000 + 0x8000 = 0xD0000) */
281 LogDev->Registers[0x85] = 0x00;
282 LogDev->Registers[0x86] = 0x0D;
283 LogDev->Registers[0x87] = 0x00;
284 LogDev->Registers[0x88] = 0x00;
285
286 /* ********************* DEVICE 6 ********************* */
287 LogDev++;
288
289 /* Enable decodes */
290 LogDev->Registers[0x30] = 0x01;
291
292 /* Memory Base #0 0xA0000 */
293 LogDev->Registers[0x40] = 0x0A;
294 LogDev->Registers[0x41] = 0x00;
295 /*
296 * Memory Control #0 - enable upper limit, 8-bit memory.
297 * The resource descriptor is 16-bit,
298 * so we can test the configuration code that touches this register.
299 */
300 LogDev->Registers[0x42] = 0x01;
301 /* Memory Limit #0 0xA4000 (0xA0000 + 0x4000 = 0xA4000) */
302 LogDev->Registers[0x43] = 0x0A;
303 LogDev->Registers[0x44] = 0x40;
304
305 /* Memory Control #1 - enable range length, 8-bit memory */
306 LogDev->Registers[0x4A] = 0x00;
307 /* Memory Base #1 is disabled */
308
309 /* I/O Base 80 */
310 LogDev->Registers[0x60] = 0x00;
311 LogDev->Registers[0x61] = 0x80;
312
313 /* IRQ 5 low-to-high transition */
314 LogDev->Registers[0x70] = 0x05 | 0xF0; // We add some garbage, must be ignored by the driver
315 LogDev->Registers[0x71] = 0x02;
316
317 /* DMA 6 */
318 LogDev->Registers[0x74] = 0x06 | 0xF8; // Ditto
319
320 /* No DMA is active */
321 LogDev->Registers[0x75] = 0x04;
322
323 /* ********************* DEVICE 7 ********************* */
324
325 /* No resources on purpose */
326}
Definition: card.h:28
VOID IsaBusCreateCard(_Inout_ PISAPNP_CARD Card, _In_ PVOID PnpRom, _In_ ULONG RomSize, _In_ ULONG LogicalDevices)
Definition: isabus.c:439
static UCHAR DrvpTestPnpRom[]
Definition: res_card.c:14

Referenced by DrvCreateCards().

◆ DrvCreateCard2()

VOID DrvCreateCard2 ( _In_ PISAPNP_CARD  Card)

Definition at line 44 of file empty_card.c.

46{
48
50
51 /* ********************* DEVICE 1 ********************* */
52 LogDev = &Card->LogDev[0];
53
54 /* Enable decodes */
55 LogDev->Registers[0x30] = 0x01;
56
57 /* No DMA is active */
58 LogDev->Registers[0x74] = 0x04;
59 LogDev->Registers[0x75] = 0x04;
60}
static UCHAR DrvpTestPnpRom[]
Definition: empty_card.c:14

Referenced by DrvCreateCards().

◆ DrvTestCard1Dev1Resources()

VOID DrvTestCard1Dev1Resources ( _In_ PCM_RESOURCE_LIST  ResourceList,
_In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList 
)

Definition at line 560 of file res_card.c.

563{
566}
static VOID DrvTestCard1Dev1QueryResourceRequirements(_In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
Definition: res_card.c:360
static VOID DrvTestCard1Dev1QueryResources(_In_ PCM_RESOURCE_LIST ResourceList)
Definition: res_card.c:331

Referenced by DrvTestResources().

◆ DrvTestCard1Dev2Resources()

VOID DrvTestCard1Dev2Resources ( _In_ PCM_RESOURCE_LIST  ResourceList,
_In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList 
)

Definition at line 660 of file res_card.c.

663{
666}
static VOID DrvTestCard1Dev2QueryResources(_In_ PCM_RESOURCE_LIST ResourceList)
Definition: res_card.c:571
static VOID DrvTestCard1Dev2QueryResourceRequirements(_In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
Definition: res_card.c:590

Referenced by DrvTestResources().

◆ DrvTestCard1Dev3Resources()

VOID DrvTestCard1Dev3Resources ( _In_ PCM_RESOURCE_LIST  ResourceList,
_In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList 
)

Definition at line 760 of file res_card.c.

763{
766}
static VOID DrvTestCard1Dev3QueryResources(_In_ PCM_RESOURCE_LIST ResourceList)
Definition: res_card.c:671
static VOID DrvTestCard1Dev3QueryResourceRequirements(_In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
Definition: res_card.c:690

Referenced by DrvTestResources().

◆ DrvTestCard1Dev4Resources()

VOID DrvTestCard1Dev4Resources ( _In_ PCM_RESOURCE_LIST  ResourceList,
_In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList 
)

Definition at line 838 of file res_card.c.

841{
844}
static VOID DrvTestCard1Dev4QueryResources(_In_ PCM_RESOURCE_LIST ResourceList)
Definition: res_card.c:771
static VOID DrvTestCard1Dev4QueryResourceRequirements(_In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
Definition: res_card.c:788

Referenced by DrvTestResources().

◆ DrvTestCard1Dev5Resources()

VOID DrvTestCard1Dev5Resources ( _In_ PCM_RESOURCE_LIST  ResourceList,
_In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList 
)

Definition at line 970 of file res_card.c.

973{
976}
static VOID DrvTestCard1Dev5QueryResourceRequirements(_In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
Definition: res_card.c:904
static VOID DrvTestCard1Dev5QueryResources(_In_ PCM_RESOURCE_LIST ResourceList)
Definition: res_card.c:854

Referenced by DrvTestResources().

◆ DrvTestCard1Dev6ConfigurationResult()

VOID DrvTestCard1Dev6ConfigurationResult ( _In_ PISAPNP_CARD_LOGICAL_DEVICE  LogDev)

Definition at line 1171 of file res_card.c.

1173{
1174 ULONG i, Offset;
1175
1176 /* Memory Base #0 = 0xA2000 */
1177 ok_eq_int(LogDev->Registers[0x40], 0x0A);
1178 ok_eq_int(LogDev->Registers[0x41], 0x20);
1179 /* Memory Control #0 = upper limit enabled, 16-bit memory */
1180 ok_eq_int(LogDev->Registers[0x42], 0x03);
1181 /* Memory Upper limit #0 = 0xA3000 (0xA2000 + 0x1000) */
1182 ok_eq_int(LogDev->Registers[0x43], 0x0A);
1183 ok_eq_int(LogDev->Registers[0x44], 0x30);
1184
1185 /* Memory Base #1 = 0x89000 */
1186 ok_eq_int(LogDev->Registers[0x48], 0x08);
1187 ok_eq_int(LogDev->Registers[0x49], 0x90);
1188 /* Memory Control #1 = range length enabled, 8-bit memory */
1189 ok_eq_int(LogDev->Registers[0x4A], 0x00);
1190 /* Memory Upper limit #1 = 0xFFFF00 (0x100) */
1191 ok_eq_int(LogDev->Registers[0x4B], 0xFF);
1192 ok_eq_int(LogDev->Registers[0x4C], 0xFF);
1193
1194 /* Memory #2-3 should be disabled */
1195 for (i = 2; i < 4; ++i)
1196 {
1197 Offset = 0x40 + i * 8;
1198
1199 /* Memory Base */
1200 ok_eq_int(LogDev->Registers[Offset ], 0x00);
1201 ok_eq_int(LogDev->Registers[Offset + 1], 0x00);
1202 /* Memory Control */
1203 ok_eq_int(LogDev->Registers[Offset + 2], 0x00);
1204 /* Memory Upper limit or range length */
1205 ok_eq_int(LogDev->Registers[Offset + 3], 0x00);
1206 ok_eq_int(LogDev->Registers[Offset + 4], 0x00);
1207 }
1208
1209 /* Memory 32 #0-3 should be disabled */
1210 for (i = 0; i < 4; ++i)
1211 {
1212 if (i == 0)
1213 Offset = 0x76;
1214 else
1215 Offset = 0x70 + i * 16;
1216
1217 /* Memory 32 Base */
1218 ok_eq_int(LogDev->Registers[Offset ], 0x00);
1219 ok_eq_int(LogDev->Registers[Offset + 1], 0x00);
1220 ok_eq_int(LogDev->Registers[Offset + 2], 0x00);
1221 ok_eq_int(LogDev->Registers[Offset + 3], 0x00);
1222 /* Memory 32 Control */
1223 ok_eq_int(LogDev->Registers[Offset + 4], 0x00);
1224 /* Memory 32 Upper limit or range length */
1225 ok_eq_int(LogDev->Registers[Offset + 5], 0x00);
1226 ok_eq_int(LogDev->Registers[Offset + 6], 0x00);
1227 ok_eq_int(LogDev->Registers[Offset + 7], 0x00);
1228 ok_eq_int(LogDev->Registers[Offset + 8], 0x00);
1229 }
1230
1231 /* I/O Base #0 = 0x80 */
1232 ok_eq_int(LogDev->Registers[0x60], 0x00);
1233 ok_eq_int(LogDev->Registers[0x61], 0x80);
1234
1235 /* I/O Base #1-6 should be disabled */
1236 for (i = 1; i < 6; ++i)
1237 {
1238 Offset = 0x60 + i * 2;
1239
1240 ok_eq_int(LogDev->Registers[Offset ], 0x00);
1241 ok_eq_int(LogDev->Registers[Offset + 1], 0x00);
1242 }
1243
1244 /* IRQ select #0 = IRQ 5 low-to-high transition */
1245 ok_eq_int(LogDev->Registers[0x70], 0x05);
1246 ok_eq_int(LogDev->Registers[0x71], 0x02);
1247
1248 /* IRQ select #1 should be disabled */
1249 ok_eq_int(LogDev->Registers[0x72], 0x00);
1250 ok_eq_int(LogDev->Registers[0x73], 0x00);
1251
1252 /* DMA select #0 = DMA 6 */
1253 ok_eq_int(LogDev->Registers[0x74], 0x06);
1254
1255 /* DMA select #1 = No DMA is active */
1256 ok_eq_int(LogDev->Registers[0x75], 0x04);
1257}
#define ok_eq_int(value, expected)
Definition: apitest.h:60
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
uint32_t ULONG
Definition: typedefs.h:59

Referenced by DrvTestResources().

◆ DrvTestCard1Dev6CreateConfigurationResources()

PCM_RESOURCE_LIST DrvTestCard1Dev6CreateConfigurationResources ( VOID  )

Definition at line 1260 of file res_card.c.

1261{
1264 ULONG ListSize;
1265
1266#define RESOURCE_COUNT 5
1267 /*
1268 * Make the following resources from the requirements:
1269 *
1270 * FullList Count 1
1271 * List #0 Iface 1 Bus #0 Ver.1 Rev.1 Count 5
1272 * [1:11] MEM: 0:A2000 Len 1000
1273 * [1:11] MEM: 0:89000 Len 100
1274 * [0:0] DMA: Channel 6 Port 0 Res 0
1275 * [1:1] INT: Lev 5 Vec 3F Aff FFFFFFFF
1276 * [1:5] IO: Start 0:80, Len 8
1277 */
1278 ListSize = FIELD_OFFSET(CM_RESOURCE_LIST, List[0].PartialResourceList.PartialDescriptors) +
1279 sizeof(*Descriptor) * RESOURCE_COUNT;
1280
1282 if (ResourceList == NULL)
1283 return NULL;
1284 ResourceList->Count = 1;
1285 ResourceList->List[0].InterfaceType = Isa;
1286 ResourceList->List[0].BusNumber = 0;
1287 ResourceList->List[0].PartialResourceList.Version = 1;
1288 ResourceList->List[0].PartialResourceList.Revision = 1;
1289 ResourceList->List[0].PartialResourceList.Count = RESOURCE_COUNT;
1290
1291 Descriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[0];
1292
1294 Descriptor->ShareDisposition = CmResourceShareDeviceExclusive;
1296 Descriptor->u.Memory.Start.LowPart = 0xA2000;
1297 Descriptor->u.Memory.Length = 0x1000;
1298 ++Descriptor;
1299
1301 Descriptor->ShareDisposition = CmResourceShareDeviceExclusive;
1303 Descriptor->u.Memory.Start.LowPart = 0x89000;
1304 Descriptor->u.Memory.Length = 0x100;
1305 ++Descriptor;
1306
1308 Descriptor->ShareDisposition = CmResourceShareUndetermined;
1310 Descriptor->u.Dma.Channel = 6;
1311 ++Descriptor;
1312
1314 Descriptor->ShareDisposition = CmResourceShareDeviceExclusive;
1316 Descriptor->u.Interrupt.Level = 5;
1317 Descriptor->u.Interrupt.Vector = 0x3F;
1318 Descriptor->u.Interrupt.Affinity = (KAFFINITY)-1;
1319 ++Descriptor;
1320
1322 Descriptor->ShareDisposition = CmResourceShareDeviceExclusive;
1324 Descriptor->u.Memory.Start.LowPart = 0x80;
1325 Descriptor->u.Memory.Length = 8;
1326
1327 return ResourceList;
1328}
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
ULONG_PTR KAFFINITY
Definition: compat.h:85
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
@ Isa
Definition: hwresource.cpp:138
#define CM_RESOURCE_PORT_IO
Definition: cmtypes.h:109
#define CM_RESOURCE_DMA_8
Definition: cmtypes.h:131
#define CM_RESOURCE_MEMORY_READ_ONLY
Definition: cmtypes.h:121
#define CM_RESOURCE_MEMORY_24
Definition: cmtypes.h:125
#define CM_RESOURCE_INTERRUPT_LATCHED
Definition: cmtypes.h:144
#define CM_RESOURCE_PORT_10_BIT_DECODE
Definition: cmtypes.h:110
#define RESOURCE_COUNT
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342
@ CmResourceShareDeviceExclusive
Definition: cmtypes.h:241
@ CmResourceShareUndetermined
Definition: cmtypes.h:240

Referenced by DrvTestResources().

◆ DrvTestCard1Dev6Resources()

VOID DrvTestCard1Dev6Resources ( _In_ PCM_RESOURCE_LIST  ResourceList,
_In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList 
)

Definition at line 1162 of file res_card.c.

1165{
1168}
static VOID DrvTestCard1Dev6QueryResources(_In_ PCM_RESOURCE_LIST ResourceList)
Definition: res_card.c:988
static VOID DrvTestCard1Dev6QueryResourceRequirements(_In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
Definition: res_card.c:1058

Referenced by DrvTestResources().

◆ DrvTestCard1Dev7Resources()

VOID DrvTestCard1Dev7Resources ( _In_ PCM_RESOURCE_LIST  ResourceList,
_In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList 
)

Definition at line 1331 of file res_card.c.

1334{
1335 /* No resources */
1337 ok_eq_pointer(ReqList, NULL);
1338}
#define ok_eq_pointer(value, expected)
Definition: apitest.h:59

Referenced by DrvTestResources().

◆ ExAllocatePoolWithTag()

FORCEINLINE PVOID ExAllocatePoolWithTag ( ULONG  PoolType,
SIZE_T  NumberOfBytes,
ULONG  Tag 
)

Definition at line 31 of file precomp.h.

32{
33 PULONG_PTR Mem = HeapAlloc(GetProcessHeap(), 0, NumberOfBytes + 2 * sizeof(PVOID));
34 if (Mem == NULL)
35 return NULL;
36
37 Mem[0] = NumberOfBytes;
38 Mem[1] = Tag;
39
40 return (PVOID)(Mem + 2);
41}
uint32_t * PULONG_PTR
Definition: typedefs.h:65
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4065
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
Definition: iotypes.h:1036

◆ ExAllocatePoolZero()

FORCEINLINE PVOID ExAllocatePoolZero ( ULONG  PoolType,
SIZE_T  NumberOfBytes,
ULONG  Tag 
)

Definition at line 45 of file precomp.h.

46{
48
49 if (Result != NULL)
51
52 return Result;
53}
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3815
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

Referenced by _Requires_lock_held_(), AllocateItem(), DIB_1BPP_BitBltSrcCopy_From1BPP(), EngpRegisterGraphicsDevice(), FdoHandleQueryCompatibleId(), FontLink_Create(), IntHandlePowerEvent(), IntInitWin32PowerManagement(), IoConnectInterrupt(), IsaPnpCreateLogicalDeviceResources(), IsaPnpCreateReadPortDORequirements(), IsaPnpCreateReadPortDOResources(), IsaReadPortQueryId(), KdbInitialize(), KdpDebugLogInit(), KeStartAllProcessors(), LDEVOBJ_bProbeAndCaptureDevmode(), MDEVOBJ_Create(), MmCreateImageSection(), NtCreatePagingFile(), NtFreeVirtualMemory(), NtGdiGetGlyphOutline(), PartitionHandleDeviceRelations(), PciIdeXPdoQueryResourceRequirements(), PciIdeXPdoQueryResources(), PiCallDriverAddDevice(), PipAllocateDeviceNode(), ScsiPortInitialize(), START_TEST(), and TestIrpHandler().

◆ ExFreePoolWithTag()

FORCEINLINE VOID ExFreePoolWithTag ( PVOID  MemPtr,
ULONG  Tag 
)

Definition at line 57 of file precomp.h.

58{
59 PULONG_PTR Mem = MemPtr;
60
61 Mem -= 2;
62 ok(Mem[1] == Tag, "Tag is %lx, expected %lx\n", Tag, Mem[1]);
63 HeapFree(GetProcessHeap(), 0, Mem);
64}
#define ok(value,...)
Definition: atltest.h:57
#define HeapFree(x, y, z)
Definition: compat.h:735

◆ GetPoolAllocSize()

FORCEINLINE SIZE_T GetPoolAllocSize ( PVOID  MemPtr)

Definition at line 68 of file precomp.h.

69{
70 PVOID* Mem = MemPtr;
71
72 Mem -= 2;
73 return (SIZE_T)Mem[0];
74}
ULONG_PTR SIZE_T
Definition: typedefs.h:80

◆ IsaBusCreateCard()

VOID IsaBusCreateCard ( _Inout_ PISAPNP_CARD  Card,
_In_ PVOID  PnpRom,
_In_ ULONG  RomSize,
_In_ ULONG  LogicalDevices 
)

Definition at line 439 of file isabus.c.

444{
445 Card->RomSize = RomSize;
446 Card->PnpRom = PnpRom;
447 Card->PnpRom[FIELD_OFFSET(ISAPNP_IDENTIFIER, Checksum)] = IsaBusPnpChecksum(PnpRom);
448 Card->PnpRom[RomSize - 1] = IsaBusResourceDataChecksum(PnpRom, RomSize);
449 Card->LogicalDevices = LogicalDevices;
450
452
454}
static VOID IsaBusPlugInCard(_Inout_ PISAPNP_CARD Card)
Definition: isabus.c:426
static UCHAR IsaBusPnpChecksum(_In_ PISAPNP_IDENTIFIER Identifier)
Definition: isabus.c:391
static UCHAR IsaBusResourceDataChecksum(_In_ PUCHAR PnpRom, _In_ ULONG RomSize)
Definition: isabus.c:413
static ULONG IsapCardCount
Definition: isabus.c:17

Referenced by DrvCreateCard1(), and DrvCreateCard2().

◆ READ_PORT_UCHAR()

UCHAR NTAPI READ_PORT_UCHAR ( _In_ PUCHAR  Port)

Definition at line 480 of file isabus.c.

482{
484
485 /* We can write only to NT Read Data Ports */
486 switch ((ULONG_PTR)Port)
487 {
488 case 0x2F4 | 3:
490 break;
491
492 /* Indicate that the Read Data Port is in conflict */
493 case 0x274 | 3:
494 case 0x3E4 | 3:
495 case 0x204 | 3:
496 case 0x2E4 | 3:
497 case 0x354 | 3:
498 Result = 0x00;
499 break;
500
501 default:
502 ok(FALSE, "Unexpected read from port %p\n", Port);
503 Result = 0xFF;
504 break;
505 }
506
507 return Result;
508}
#define FALSE
Definition: types.h:117
CPPORT Port[4]
Definition: headless.c:35
static UCHAR IsaBusReadDataPortRegister(_In_ PUCHAR Port)
Definition: isabus.c:328
uint32_t ULONG_PTR
Definition: typedefs.h:65
unsigned char UCHAR
Definition: xmlstorage.h:181

◆ WRITE_PORT_UCHAR()

VOID NTAPI WRITE_PORT_UCHAR ( _In_ PUCHAR  Port,
_In_ UCHAR  Value 
)

Definition at line 458 of file isabus.c.

461{
462 switch ((ULONG_PTR)Port)
463 {
464 case 0x279:
466 break;
467
468 case 0xA79:
470 break;
471
472 default:
473 ok(FALSE, "Unexpected write to port %p %02x\n", Port, Value);
474 break;
475 }
476}
static VOID IsaBusWriteDataRegister(_In_ UCHAR Value)
Definition: isabus.c:73
static VOID IsaBusWriteAddressRegister(_In_ UCHAR Value)
Definition: isabus.c:38
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413