;       SCCSID = @(#)d_svrfy.asm	6.1 91/02/15
;	SCCSID = @(#)d_svrfy.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_svrfy.asm - API stub routine DosSetVerify
;
;	Member of API library
;	Bill Mershon
;	Copyright MicroSoft Corporation, 1986
;	27-Feb-1986
;
;	library routine for API simulator
;
;	Called from dos 2.x,3.x compatible dos 5.x applications
;
;	Special Information
;		none
;
;	Modification History
;
;	DavidSi	6-26-86	Took out old error code mechanism. Included error.inc
;			and corrected error code for invalid verify switch.
;			Shortened test for a valid verify switch.
;
;	06-Jan-87 (billme): Replace initial pushes and final pops
;	with calls to __api_begin and __api_end resp.  This will
;	reduce the size of FAPI and allow support for signals.
;

include basemaca.inc
include dos2equ.inc
include error.inc

	EXTRN	__api_begin:near
	EXTRN	__api_end:near

;***	DOSSETVERIFY - stub to emulate DOSSETVERIFY function call
;
;	simulates dos 5.0 DOSSETVERIFY using int 21, function 2eh
;
;	errorcode = unsigned far pascal
;	DosSetVerify (VerifySetting)
;
;	ENTRY:
;		VerifySetting - current verify mode (see dos 5.0 spec)
;
;	RETURN:
;		AX = 0 if no error, else error code (see DOS 5 spec)
;
;	EXIT:
;
;	USES:
;		AX
;
;	Pseudo Code:
;		save registers
;		use BP as pointer to stack parameters
;		load registers for int 21 call
;		execute int 21 with function 2eh
;		restore registers
;		return
;
;	WARNING:
;		may return error code from Dos 2.x, 3.x (see dos manuals)
;
;	EFFECTS:
;		none
;

	title	DOSSETVERIFY - stub to emulate DOSSETVERIFY function call
;
;	EXTRN	DOSSETVERIFY:FAR
;
;	PUSH	WORD VerifySetting
;	CALL	DOSSETVERIFY
;


_TEXT	segment byte public 'CODE'

	assume	CS:_TEXT,DS:NOTHING

	public	DOSSETVERIFY

VERIFY_MODE_BIT	equ	1
VerifySetting	equ	[BP+6]

DOSSETVERIFY	proc	far

	call	__api_begin	; init bp and save bp,ds,bx,cx,dx,si,di,es
				; required to save: bp,bx

	mov	ax, ERROR_INVALID_VERIFY_SWITCH
	mov	bx, [VerifySetting]	; get verify mode
	test	bx, NOT VERIFY_MODE_BIT	; is it valid?
	jnz	Exit			; invalid, go exit

	mov	al, bl
	mov	ah, D2_SetResetVrfy
	int	21H			; call dos 2.x,3.x function
	xor	ax, ax			; set "no error"
Exit:

	call	__api_end	; check sigs & restore es,di,si,dx,cx,bx,ds,bp

	ret	2		; clear stack of entry parameters (bytes)
DOSSETVERIFY	endp

_TEXT	ends

	end

