;       SCCSID = @(#)smrsetev.asm	6.1 90/11/18
;	SCCSID @(#)smrsetev.asm	6.5 90/05/18
PAGE 60,132    ;
; ****************************************************************************
; *									     *
; *			  IBM/Microsoft Confidential			     *
; *									     *
; *		    Copyright (c) IBM Corporation  1987, 1990		     *
; *		    Copyright (c) Microsoft Corp.  1987, 1990		     *
; *			      All Rights Reserved			     *
; *									     *
; ****************************************************************************

;************************************************************************
;
; Source File Name:	SMRSETEV.ASM
;
; Subroutine Name:	APPSETSESSION
;
; Descriptive Name:	Process an Application Set Session Request
;
; Function:	Call the Session Manager to process a bond request.
;
;		WINSetSwEntry will be called to update the switch
;		list entry with the specified selectability
;		attributes.
;
; Notes:
;	Dependencies:	None
;
;	Restrictions:	None
;
;	Change History:
;
; Entry Point:
;	Linkage:  EXTRN APPSETSESSION : NEAR
;			CALL	APPSETSESSION
; Inputs:
;	DS	RDATA
;	ES:DI	ReqBlock   Address to an application start request
;			   block.
;
; Exit Normal:
;	AX	ReturnCode Value = 0, Application request successful
;
; Exit Errors:
;	AX	ReturnCode error_smg_not_baseshell
;			   error_smg_session_not_found
;
;			   DOSSMSGSET	 errors
;			   WINSETSWENTRY errors
;
; Effects:	All other registers preserved.
;
;************************************************************************
ifdef I1
;
;   IF (PM is present)
;      WINSETSWENTRY (Set switch list entry)
;      Indicate no change to selectability
;   ENDIF
;   IF (No_Error)
;      DOSSMSGSET (Mark child selectable or not selectable and/or
;		   set or break parent/child bond)
;   ENDIF
;
;************************************************************************
else

.386C
    EXTRN PM_Present	 : BYTE
    EXTRN WinSetSwEntry  : DWORD	; Call set session hooker

    EXTRN DOSSMSGSET	 : FAR		; Process session set options
.xlist
    INCLUDE SMRREQB.INC 		; Request block data definitions
.xcref
    INCLUDE ERROR2.INC			; Error code equates
    INCLUDE SMRRDATA.INC		; Router data declarations
    INCLUDE STRUC.INC
.cref
.list

CODE SEGMENT WORD PUBLIC 'CODE' USE16
    ASSUME CS:CODE,DS:RDATA,SS:NOTHING,ES:NOTHING

    PUBLIC APPSETSESSION
APPSETSESSION PROC NEAR

    Local_Bytes  EQU  0

;   ENTER Local_Bytes,0 						;CJ10
    XOR  AX, AX 			; Preset to No_Error

    .IF  < PM_Present e Yes >
      PUSH ES				; Send request block to windowed sub-system
      PUSH DI
      CALL WINSETSWENTRY
      MOV  ES:[DI].RqSetSelectOpt, 0	; No change to selectability
    .ENDIF

;   *********************************************************************
;   *  Call Session Manager to mark child selectable or not selectable	*
;   *********************************************************************
    .IF  < zero AX >			; Call not rejected or no error ;CJ10
      PUSH ES:[DI].ReqSessionID 	; Parent session ID
      PUSH ES:[DI].RqSetSessionID	; Child session ID
      PUSH ES:[DI].RqSetSelectOpt	; Selectable or not
      PUSH ES:[DI].RqSetBondOption	; Bond option
      CALL DOSSMSGSET
    .ENDIF

;   LEAVE								;CJ10
    RET

APPSETSESSION ENDP

CODE ENDS
endif
    END
