⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ntddser.inc

📁 这是asm驱动的开发包
💻 INC
📖 第 1 页 / 共 2 页
字号:
	EofReceived			BOOLEAN	?
	WaitForImmediate	BOOLEAN	?
						db 2 dup(?)	; padding
SERIAL_STATUS ENDS
PSERIAL_STATUS typedef ptr SERIAL_STATUS

; +
; This structure is used for XOFF counter ioctl.  The xoff ioctl
; is used to support those subsystems that feel the need to emulate
; the serial chip in software.
;
; It has the following semantics:
;
; This io request is placed into the normal device write
; queue.  That is, it will be queued behind any writes
; already given to the driver.
;
; When this request becomes the current request, the character
; specified in the field XoffChar will be sent, subject to
; all other flow control already defined.
;
; Immediately upon sending the character the driver will
; perform the following actions.
;
; A timer will be initiated that will expire after the
; number of milliseconds in the Timeout field of the
; SERIAL_XOFF_COUNTER structure.
;
; The driver will initialize a counter to the value specified
; in the Counter field of the SERIAL_XOFF_RECORD.  The driver
; will decrement this counter whenever a character is received.
;
; This request will then be held by the driver.  It will
; actually complete under the following circumstances:
;
; 1) If there is another "write" request behind it in the queue.
;    The "xoff" request will be completed with the informational status
;    STATUS_SERIAL_MORE_WRITES.  The Information field of the
;    IOSTATUS block will be set to 0.
;
;    Note: By write request we mean another SERIAL_XOFF_COUNTER
;    request, or a simple write request.  If the only subsequent
;    request is a flush request, the driver WILL NOT automatically
;    complete the SERIAL_XOFF_COUNTER request.  NOTE: Transmit
;    immediate requests DO NOT count as a normal write, and therefore
;    would not cause a counter request to complete.
;
; 2) The timer expires.  The driver will complete the request
;    with the informational status STATUS_SERIAL_COUNTER_TIMEOUT.
;    The Information field of the IOSTATUS of the request will be set to 0.
;
; 3) The driver maintained counter goes to zero.  (By implication,
;    at least "Counter" number of characters have been received.)
;    The request will be completed with a successful status
;    of STATUS_SUCCESS.  The Information field of the
;    IOSTATUS of the request will be set to 0.
;
; 4) This is really a degenerate case of "1" above.  The request
;    is started and no request follow it on the queue.  However
;    at some point, before "2" or "3" above occur, another "write"
;    request is started.  This will cause the completion actions
;    stated in "1" to occur.
;
; NOTE: This request being issued WILL NOT cause the normal flow
;       control code of the driver to be invoked.
;
; NOTE: This request has no interaction with the IOCTL_SERIAL_WAIT_ON_MASK
;       request.  An application CAN NOT wait via the above ^^^^^^ ioctl
;       on the counter going to zero.  The application must synchronize
;       with the particular IOCTL_SERIAL_XOFF_COUNTER request.
;
; NOTE: The Timeout value equal to zero would cause the counter
;       to NEVER timeout.  The only way that such a request could
;       be killed at that point would be issue another write, or
;       to purge the WRITE queue.
; -

SERIAL_XOFF_COUNTER STRUCT
	Timeout		DWORD	?	; Zero based.  In milliseconds
	Counter		SDWORD	?	; Must be greater than zero.
	XoffChar	BYTE	?
				db 3 dup(?)	; padding
SERIAL_XOFF_COUNTER ENDS
PSERIAL_XOFF_COUNTER typedef ptr SERIAL_XOFF_COUNTER

; The following structure (and defines) are passed back by
; the serial driver in response to the get properties ioctl.

SERIAL_SP_SERIALCOMM         equ 00000001

; Provider subtypes

SERIAL_SP_UNSPECIFIED       equ 00000000
SERIAL_SP_RS232             equ 00000001
SERIAL_SP_PARALLEL          equ 00000002
SERIAL_SP_RS422             equ 00000003
SERIAL_SP_RS423             equ 00000004
SERIAL_SP_RS449             equ 00000005
SERIAL_SP_MODEM             equ 00000006
SERIAL_SP_FAX               equ 00000021h
SERIAL_SP_SCANNER           equ 00000022h
SERIAL_SP_BRIDGE            equ 00000100h
SERIAL_SP_LAT               equ 00000101h
SERIAL_SP_TELNET            equ 00000102h
SERIAL_SP_X25               equ 00000103h

; Provider capabilities flags.

SERIAL_PCF_DTRDSR        equ 0001
SERIAL_PCF_RTSCTS        equ 0002
SERIAL_PCF_CD            equ 0004
SERIAL_PCF_PARITY_CHECK  equ 0008
SERIAL_PCF_XONXOFF       equ 0010h
SERIAL_PCF_SETXCHAR      equ 0020h
SERIAL_PCF_TOTALTIMEOUTS equ 0040h
SERIAL_PCF_INTTIMEOUTS   equ 0080h
SERIAL_PCF_SPECIALCHARS  equ 0100h
SERIAL_PCF_16BITMODE     equ 0200h

; Comm provider settable parameters.

SERIAL_SP_PARITY         equ 0001
SERIAL_SP_BAUD           equ 0002
SERIAL_SP_DATABITS       equ 0004
SERIAL_SP_STOPBITS       equ 0008
SERIAL_SP_HANDSHAKING    equ 0010h
SERIAL_SP_PARITY_CHECK   equ 0020h
SERIAL_SP_CARRIER_DETECT equ 0040h

; Settable baud rates in the provider.

SERIAL_BAUD_075          equ 00000001h
SERIAL_BAUD_110          equ 00000002h
SERIAL_BAUD_134_5        equ 00000004h
SERIAL_BAUD_150          equ 00000008h
SERIAL_BAUD_300          equ 00000010h
SERIAL_BAUD_600          equ 00000020h
SERIAL_BAUD_1200         equ 00000040h
SERIAL_BAUD_1800         equ 00000080h
SERIAL_BAUD_2400         equ 00000100h
SERIAL_BAUD_4800         equ 00000200h
SERIAL_BAUD_7200         equ 00000400h
SERIAL_BAUD_9600         equ 00000800h
SERIAL_BAUD_14400        equ 00001000h
SERIAL_BAUD_19200        equ 00002000h
SERIAL_BAUD_38400        equ 00004000h
SERIAL_BAUD_56K          equ 00008000h
SERIAL_BAUD_128K         equ 00010000h
SERIAL_BAUD_115200       equ 00020000h
SERIAL_BAUD_57600        equ 00040000h
SERIAL_BAUD_USER         equ 10000000h

; Settable Data Bits

SERIAL_DATABITS_5        equ 0001
SERIAL_DATABITS_6        equ 0002
SERIAL_DATABITS_7        equ 0004
SERIAL_DATABITS_8        equ 0008
SERIAL_DATABITS_16       equ 0010h
SERIAL_DATABITS_16X      equ 0020h

; Settable Stop and Parity bits.

SERIAL_STOPBITS_10       equ 0001)
SERIAL_STOPBITS_15       equ 0002)
SERIAL_STOPBITS_20       equ 0004
SERIAL_PARITY_NONE       equ 0100h
SERIAL_PARITY_ODD        equ 0200h
SERIAL_PARITY_EVEN       equ 0400h
SERIAL_PARITY_MARK       equ 0800h
SERIAL_PARITY_SPACE      equ 1000h

SERIAL_COMMPROP STRUCT
	PacketLength		WORD	?
	PacketVersion		WORD	?
	ServiceMask			DWORD	?
	Reserved1			DWORD	?
	MaxTxQueue			DWORD	?
	MaxRxQueue			DWORD	?
	MaxBaud				DWORD	?
	ProvSubType			DWORD	?
	ProvCapabilities	DWORD	?
	SettableParams		DWORD	?
	SettableBaud		DWORD	?
	SettableData		WORD	?
	SettableStopParity	WORD	?
	CurrentTxQueue		DWORD	?
	CurrentRxQueue		DWORD	?
	ProvSpec1			DWORD	?
	ProvSpec2			DWORD	?
	ProvChar			WORD 1 dup(?)	; WCHAR
						WORD	?
SERIAL_COMMPROP ENDS
PSERIAL_COMMPROP typedef ptr SERIAL_COMMPROP

; Define masks for the rs-232 input and output.

SERIAL_DTR_STATE         equ 00000001
SERIAL_RTS_STATE         equ 00000002
SERIAL_CTS_STATE         equ 00000010h
SERIAL_DSR_STATE         equ 00000020h
SERIAL_RI_STATE          equ 00000040h
SERIAL_DCD_STATE         equ 00000080h

; begin_winioctl

; The following values follow the escape designator in the
; data stream if the LSRMST_INSERT mode has been turned on.

SERIAL_LSRMST_ESCAPE     equ 00

; Following this value is the contents of the line status
; register, and then the character in the RX hardware when
; the line status register was encountered.

SERIAL_LSRMST_LSR_DATA   equ 01

; Following this value is the contents of the line status
; register.  No error character follows

SERIAL_LSRMST_LSR_NODATA equ 02

; Following this value is the contents of the modem status
; register.

SERIAL_LSRMST_MST        equ 03

; Bit values for FIFO Control Register

SERIAL_IOC_FCR_FIFO_ENABLE      equ 00000001
SERIAL_IOC_FCR_RCVR_RESET       equ 00000002
SERIAL_IOC_FCR_XMIT_RESET       equ 00000004
SERIAL_IOC_FCR_DMA_MODE         equ 00000008
SERIAL_IOC_FCR_RES1             equ 00000010h
SERIAL_IOC_FCR_RES2             equ 00000020h
SERIAL_IOC_FCR_RCVR_TRIGGER_LSB equ 00000040h
SERIAL_IOC_FCR_RCVR_TRIGGER_MSB equ 00000080h

; Bit values for Modem Control Register

SERIAL_IOC_MCR_DTR              equ 00000001
SERIAL_IOC_MCR_RTS              equ 00000002
SERIAL_IOC_MCR_OUT1             equ 00000004
SERIAL_IOC_MCR_OUT2             equ 00000008
SERIAL_IOC_MCR_LOOP             equ 00000010h

; end_winioctl

; Serenum internal ioctl's
IFNDEF PHYSICAL_ADDRESS
PHYSICAL_ADDRESS UNION
	struct
		LowPart    DWORD ?
		HighPart   SDWORD ?
	ends
	struct u
		LowPart    DWORD ?
		HighPart   SDWORD ?
	ends
	QuadPart     QWORD ?	; signed
PHYSICAL_ADDRESS ENDS
PPHYSICAL_ADDRESS typedef PTR PHYSICAL_ADDRESS
ENDIF

SERENUM_PORT_DESC STRUCT
	_Size		DWORD			?	; IN sizeof (struct _PORT_DESC)
	PortHandle	PVOID			?	; OUT
	PortAddress	PHYSICAL_ADDRESS <>	; OUT
	Reserved	WORD 1 dup(?)
				WORD 3 dup(?)	; padding
SERENUM_PORT_DESC ENDS
PSERENUM_PORT_DESC typedef ptr SERENUM_PORT_DESC

; **************************************************************************
; Internal IOCTL interface for (pdo)
; The HID to legacy serial port minidriver uses this interface to
; find the address of the device.
; **************************************************************************

IOCTL_INTERNAL_SERENUM_REMOVE_SELF equ CTL_CODE(FILE_DEVICE_SERENUM, 129, METHOD_NEITHER, FILE_ANY_ACCESS)

; of which IO_STACK_LOCATION->Parameters.Others.Argument1 is set to
; a pointer to struct _SERENUM_SER_PARAMETERS

;typedef enum _SERENUM_PORTION {
    SerenumFirstHalf	equ 0
    SerenumSecondHalf	equ 1
    SerenumWhole		equ 2

SERENUM_PORT_PARAMETERS STRUCT
	_Size			DWORD	?	; IN sizeof (SERENUM_GET_PORT_PARAMETERS)

	ReadAccessor	PVOID	?	; OUT PSERENUM_READPORT read the serial port
	WriteAccessor	PVOID	?	; OUT PSERENUM_WRITEPORT write the serial port
	SerPortAddress	PVOID	?	; OUT token to read this serial port

	HardwareHandle	PVOID	?	; OUT a handle to this particular PDO.
	Portion			DWORD	?	; OUT SERENUM_PORTION
	NumberAxis		WORD	?	; OUT legacy joysticks only
	Reserved		WORD 3 dup(?)
SERENUM_PORT_PARAMETERS ENDS
PSERENUM_PORT_PARAMETERS typedef ptr SERENUM_PORT_PARAMETERS

ENDIF ; _NTDDSER_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -