; SCCSID = %W% %E%
;/**********************************************************************
;/*                                                                    *
;/*                       IBM/Microsoft Confidential                   *
;/*                                                                    *
;/*                 Copyright (c) IBM Corporation  1987, 1990          *
;/*                 Copyright (c) Microsoft Corp.  1987, 1990          *
;/*                           All Rights Reserved                      *
;/*                                                                    *
;/**********************************************************************


        .XCREF
        .XLIST
;        INCLUDE devsym.inc
         INCLUDE devhdr.inc
        .LIST
        .CREF

         EXTRN  _parLPT1:FAR
         EXTRN  _parLPT2:FAR
         EXTRN  _parLPT3:FAR

DDHEADER segment word public 'DDHEADER'
        EVEN
_headers LABEL  WORD
        dw      lpt1dev                 ; POINTER TO NEXT HEADER
        dw      ?                       ; POINTER TO NEXT HEADER
        dw      DEV_CHAR_DEV OR DEVLEV_3 OR DEV_30  ; ATTRIBUTE
        dw      OFFSET  _parLPT1        ; POINTER TO STRATEGY ROUTINE
        dw      OFFSET   pddidc         ; POINTER TO PDD-PDD IDC ROUTINE
        db      'PRN     '              ; DEVICE NAME
        dw      ?                       ; SELECTOR OF CS SEGMENT
        dw      ?                       ; SELECTOR OF DS SEGMENT
        dw      ?                       ; SEGMENT NUMBER OF CS SEGMENT
        dw      ?                       ; SEGMENT NUMBER OF DS SEGMENT
        dd      DEV_ADAPTER_DD OR DEV_INITCOMPLETE ; CAPABILITIES BIT STRIP

lpt1dev LABEL   WORD
        dw      lpt2dev                 ; POINTER TO NEXT HEADER
        dw      ?                       ; POINTER TO NEXT HEADER
        dw      DEV_CHAR_DEV OR DEVLEV_3 OR DEV_30  ; ATTRIBUTE
        dw      OFFSET  _parLPT1        ; POINTER TO STRATEGY ROUTINE
        dw      OFFSET   pddidc         ; POINTER TO PDD-PDD IDC ROUTINE
        db      'LPT1    '              ; DEVICE NAME
        dw      ?                       ; SELECTOR OF CS SEGMENT
        dw      ?                       ; SELECTOR OF DS SEGMENT
        dw      ?                       ; SEGMENT NUMBER OF CS SEGMENT
        dw      ?                       ; SEGMENT NUMBER OF DS SEGMENT
        dd      DEV_ADAPTER_DD OR DEV_INITCOMPLETE ; CAPABILITIES BIT STRIP

lpt2dev LABEL   WORD
        dw      lpt3dev                 ; POINTER TO NEXT HEADER
        dw      ?                       ; POINTER TO NEXT HEADER
        dw      DEV_CHAR_DEV OR DEVLEV_3 OR DEV_30  ; ATTRIBUTE
        dw      OFFSET  _parLPT2        ; POINTER TO STRATEGY ROUTINE
        dw      OFFSET   pddidc         ; POINTER TO PDD-PDD IDC ROUTINE
        db      'LPT2    '              ; DEVICE NAME
        dw      ?                       ; SELECTOR OF CS SEGMENT
        dw      ?                       ; SELECTOR OF DS SEGMENT
        dw      ?                       ; SEGMENT NUMBER OF CS SEGMENT
        dw      ?                       ; SEGMENT NUMBER OF DS SEGMENT
        dd      DEV_ADAPTER_DD OR DEV_INITCOMPLETE ; CAPABILITIES BIT STRIP

lpt3dev LABEL   WORD
        dd      -1                      ; LAST ON THE CHAIN
        dw      DEV_CHAR_DEV OR DEVLEV_3 OR DEV_30  ; ATTRIBUTE
        dw      OFFSET  _parLPT3        ; POINTER TO STRATEGY ROUTINE
        dw      OFFSET   pddidc         ; POINTER TO PDD-PDD IDC ROUTINE
        db      'LPT3    '              ; DEVICE NAME
        dw      ?                       ; SELECTOR OF CS SEGMENT
        dw      ?                       ; SELECTOR OF DS SEGMENT
        dw      ?                       ; SEGMENT NUMBER OF CS SEGMENT
        dw      ?                       ; SEGMENT NUMBER OF DS SEGMENT
        dd      DEV_ADAPTER_DD OR DEV_INITCOMPLETE ; CAPABILITIES BIT STRIP

DDHeader ends

_DATA   segment word public 'DATA'
_DATA   ends

CONST   segment word public 'CONST'
CONST   ends

_BSS    segment word public 'BSS'
_BSS    ends

RMCode  segment word public 'CODE'
RMCode  ends

Code    segment word public 'CODE'
Code    ends

_TEXT   segment word public 'CODE'

         EXTRN  _parPDD_Entry:NEAR

PUBLIC  pddidc
pddidc  proc    far

        push   bx                       ; save regs
        push   cx
        push   dx
        push   si
        push   di
        push   es

        push    cx                      ; port id
        push    bx                      ; flags
        push    ax                      ; function code
        call    _parPDD_Entry           ; call C worker
        add     sp, 6

        pop     es                      ; restore regs
        pop     di
        pop     si
        pop     dx
        pop     cx
        pop     bx
        ret
pddidc  endp

_TEXT   ends


; Programmer cannot control location of CONST and _BSS class segments
; being grouped.  They are always last.  Do not put anything in these
; segments since they will be truncated after device driver initialization.
DGROUP  GROUP   DDHeader, CONST, _BSS, _DATA
CGROUP  GROUP   RMCode, Code, _TEXT
        end
