;       SCCSID = @(#)d_baddl.asm	6.1 91/02/15
;      SCCSID = @(#)d_baddl.asm	1.4 90/01/22
; ****************************************************************************
; *									     *
; *			  IBM/Microsoft Confidential			     *
; *									     *
; *		    Copyright (c) IBM Corporation  1987, 1990		     *
; *		    Copyright (c) Microsoft Corp.  1987, 1990		     *
; *			      All Rights Reserved			     *
; *									     *
; ****************************************************************************
;***  d_baddl.asm - API stub routine BadDynLink
;
;	Member of API library
;	Bill Mershon
;	Copyright MicroSoft Corporation, 1986
;	15-Apr-1986
;
;	library routine for API simulator
;
;	Called from dos 2.x,3.x compatible dos 5.x applications
;
;	Special Information
;		none
;
;	Modification History
;

INCLUDE dos2equ.inc
INCLUDE basemaca.inc
INCLUDE error.inc

;***	BADDYNLINK - stub to emulate BADDYNLINK function call
;
;	simulates DOS 5.0 call from DOS 2.x,3.x environment
;
;	errorcode = unsigned far pascal
;	BadDynLink ()
;
;	ENTRY:
;
;	RETURN:
;		does not return
;
;	EXIT:
;
;	USES:
;		AX
;
;	Pseudo Code:
;		abort program
;
;	WARNING:
;		does not return
;
;	EFFECTS:
;		terminates program
;

	title	BADDYNLINK - stub to emulate BADDYNLINK function call
;
;	EXTRN	BADDYNLINK:FAR
;
;	CALL	BADDYNLINK
;

MsgSeg		segment para public 'DATA'
 extrn	 TXT_MSG_BAD_DYNALINK:word
MsgSeg		ends

STDERR	EQU	2

_TEXT	segment byte public 'CODE'

	assume	CS:_TEXT,DS:NOTHING

	public	BADDYNLINK

BADDYNLINK	proc	far
	mov	ax, seg MsgSeg			; @@
	mov	ds, ax				; @@
	mov	si, offset MsgSeg:TXT_MSG_BAD_DYNALINK	     ; @@
	mov	cx, word ptr [si]		; @@
	inc	si				; @@
	inc	si				; @@
	mov	dx, si				; @@
	mov	bx, STDERR			; @@
	mov	ah,D2_WriteForD			; @@
	int	21h				; @@

	mov	al,ERROR_BAD_DYNALINK
	mov	ah,D2_EndProc
	int	21H
BADDYNLINK	endp

_TEXT	ends

	end
