;       SCCSID = @(#)sswsetup.asm	6.1 90/11/18
;      SCCSID = @(#)sswsetup.asm	6.3 90/03/19

; ****************************************************************************
; *									     *
; *			  IBM/Microsoft Confidential			     *
; *									     *
; *		    Copyright (c) IBM Corporation  1987, 1990		     *
; *		    Copyright (c) Microsoft Corp.  1987, 1990		     *
; *			      All Rights Reserved			     *
; *									     *
; ****************************************************************************

;********************** START OF SPECIFICATIONS ***********************/
;								      */
; SUBROUTINE NAME:  SSWSETUP					      */
;								      */
; DESCRIPTIVE NAME:  Screen Switcher's shared memory housekeeping     */
;		     procedure. 				      */
;								      */
; FUNCTION: This is an internally called procedure which sets up      */
;	    internal structures for storing screen group, PID, and    */
;	    thread information. Flags are initialized, etc. It is     */
;	    called during initialization of Screen Switcher by	      */
;	    the Session Manager and any time a new sgcb must be       */
;	    created.						      */
;								      */
; NOTES:  Executes on Level 3					      */
;								      */
; ENTRY POINT:	SSCBSetup					      */
;   LINKAGE:							      */
;								      */
; INPUT: DS points to common data segment. Sgpointeroff points to     */
;	 the first available block of memory to use for setting up    */
;	 the sgcb. BX must contain the sg# to use.		      */
;								      */
; EXIT-NORMAL:	None						      */
;								      */
; EXIT-ERROR:	None						      */
;								      */
; EFFECTS:  SG control block is initialized.			      */
;								      */
; INTERNAL REFERENCES:						      */
;   ROUTINES:  None						      */
;								      */
; EXTERNAL REFERENCES:						      */
;   ROUTINES:  None						      */
;								      */
;	Change History: 					      */
;								      */
;	@TL6 - 03/01/90 - DCR 704 - Merge SMG/SSW instance data into  */
;			  OS2CHAR				      */
;								      */
;*********************** END OF SPECIFICATIONS ************************/
EXTRN sgnumber:word, sgpointeroff:word
.xlist
INCLUDE SSWINC.INC
.list

.386P

CODE	SEGMENT WORD PUBLIC 'CODE' USE16                                ;@TL6

	ASSUME	CS:CODE, DS:STDATASG,SS:NOTHING,ES:NOTHING		;@TL6

	       PUBLIC  SSCBSETUP

SSCBSETUP      PROC    NEAR			    ; Enter with offset
						    ; of sgcb memory block
						    ; in sgpointeroff and
						    ; DS pointing to
						    ; the common data seg
	       push    es
	       push    di
	       push    si
	       push    cx

	       push    ds			    ; Point es to stdatasg
	       pop     es

	       ASSUME  ES:STDATASG

	       mov     sgnumber,bx		    ; Store the sg#
	       mov     di,sgpointeroff
	       mov     si,offset sgcb_str	    ; Write init parms
	       mov     cx,sgcb_str_len		    ; to the sgcb
	       rep     movsb

	       pop     cx
	       pop     si
	       pop     di
	       pop     es

	       ret

SSCBSETUP      ENDP

CODE	ENDS								;@TL6
	       END
