;       SCCSID = @(#)nmpkernl.asm	6.1 90/11/17
;      SCCSID = @(#)nmpkernl.asm	6.3 90/05/08
TITLE	NMPKERNL - Dispatch named pipe functions to kernel

;***	NMPKERNL - Dispatch named pipe functions to kernel
;
;	This module contains the definitions of functions that simply
;	call corresponding OS/2 entry points.  This is used to map
;	functions calls from nampipes.dll into the `real' kernel
;	entry points and is used to provide binary compatibility for
;	applications that were developed before the named pipe calls
;	were available in the kernel.
;
;	The dispatch is done by just pushing all the arguments and
;	calling the corresponding kernel entry point.  The entry
;	point names are mapped at the .DEF file level to avoid
;	multiple definitions of the entry point names.

.286p
.xlist
include dc1segs.inc						; DCR 704
.list

CODE16	 SEGMENT						; DCR 704

;**	PushAndCall - define a procedure that pushes arguments and calls kernel
;
;	PushAndCall	M,N
;
;	This macro generates a procedure called M that pushes the number
;	of arguments given by N, then calls procedure M (with DOS prepended
;	to the name).
;
PushAndCall	macro	m,n
?n = 0
public	DOS&m
DOS&m	proc	far
	enter	0,0
	if n
	    ?n = 2 * n
	    rept n
		?n = ?n - 2
		push  [bp + 6 + ?n]
	    endm
	endif
	extrn	DOSI&m:far
	call	DOSI&m
	leave
	ret	n*2
DOS&m	endp
		endm

	PushAndCall	MAKENMPIPE, 10

	PushAndCall	QNMPIPEINFO, 5

	PushAndCall	CONNECTNMPIPE, 1

	PushAndCall	DISCONNECTNMPIPE, 1

	PushAndCall	QNMPHANDSTATE, 3

	PushAndCall	SETNMPHANDSTATE, 2

	PushAndCall	PEEKNMPIPE,10

	PushAndCall	WAITNMPIPE, 4

	PushAndCall	TRANSACTNMPIPE, 9

	PushAndCall	CALLNMPIPE, 12

	PushAndCall	RAWREADNMPIPE, 6

	PushAndCall	RAWWRITENMPIPE, 6

	PushAndCall	QNMPIPESEMSTATE, 5

	PushAndCall	SETNMPIPESEM, 4

CODE16	 ENDS
	END
