6 _TEXT SEGMENT PUBLIC DWORD USE16 'CODE'
8 _DATA SEGMENT PUBLIC DWORD USE16 'CODE'
10 _TEXT32 SEGMENT PUBLIC BYTE USE32 'CODE'
12 CB_DSEG EQU <CS> ; DOSX is tiny-model
13 D_SEG EQU <_TEXT SEGMENT>
14 D_END EQU <_TEXT ENDS>
15 ASSUME CS:_TEXT,DS:_TEXT
27 _TEXT SEGMENT PUBLIC DWORD 'CODE'
29 _DATA SEGMENT PUBLIC DWORD 'DATA'
31 CB_DSEG EQU <SEG _DATA> ; 16bit is small/large model
32 D_SEG EQU <_DATA SEGMENT>
33 D_END EQU <_DATA ENDS>
34 ASSUME CS:_TEXT,DS:_DATA
45 ;-------------------------------------------
54 EXTRN _NdisSystemRequest : near
55 EXTRN _NdisRequestConfirm : near
56 EXTRN _NdisTransmitConfirm : near
57 EXTRN _NdisReceiveLookahead : near
58 EXTRN _NdisIndicationComplete : near
59 EXTRN _NdisReceiveChain : near
60 EXTRN _NdisStatusProc : near
61 EXTRN _NdisAllocStack : near
62 EXTRN _NdisFreeStack : near
65 ; *ALL* interrupt threads come through this macro.
67 CALLBACK macro callbackProc, argsSize
70 PUSHREGS ;; Save the registers
74 mov ax,CB_DSEG ;; Load DS
76 call _NdisAllocStack ;; Get and install a stack.
78 mov bx,ss ;; Save off the old stack in other regs
80 mov ss,dx ;; Install the new one
82 push bx ;; Save the old one on to the new stack
84 sub sp,&argsSize ;; Allocate space for arguments on the stack
86 mov ax,ss ;; Set up the destination for the move
89 mov ds,bx ;; Set up the source for the move.
93 mov cx,&argsSize ;; Move the arguments to the stack.
98 mov ax,CB_DSEG ;; Set my data segment again.
101 call &callbackProc ;; Call the real callback.
102 pop di ;; Pop off the old stack
104 mov bx,ss ;; Save off the current allocated stack.
106 mov ss,si ;; Restore the old stack
108 push ax ;; Save the return code
109 push bx ;; Free the stack. Push the pointer to it
113 pop ax ;; Get the return code back
114 add di,32 ;; Get a pointer to ax on the stack
115 mov word ptr ss:[di],ax
124 ; Define all of the callbacks for the NDIS procs.
127 PUBPROC systemRequestGlue
128 CALLBACK _NdisSystemRequest,14
131 PUBPROC requestConfirmGlue
132 CALLBACK _NdisRequestConfirm,12
135 PUBPROC transmitConfirmGlue
136 CALLBACK _NdisTransmitConfirm,10
139 PUBPROC receiveLookaheadGlue
140 CALLBACK _NdisReceiveLookahead,16
143 PUBPROC indicationCompleteGlue
144 CALLBACK _NdisIndicationComplete,4
147 PUBPROC receiveChainGlue
148 CALLBACK _NdisReceiveChain,16
152 CALLBACK _NdisStatusProc,12
156 ; int FAR NdisGetLinkage (int handle, char *data, int size);
160 PUBPROC NdisGetLinkage
162 mov ebx, [esp+8] ; device handle
163 mov eax, 4402h ; IOCTRL read function
164 mov edx, [esp+12] ; DS:EDX -> result data
165 mov ecx, [esp+16] ; ECX = length
173 PUBPROC NdisGetLinkage