.TITLE SET_UIC_USER Set UIC and Username in PCB/JIB .IDENT /V2.0/ ;++SETUICUSR.MAR ; ; Facility: ; Use in SETUSER foreign command program. ; ; Abstract: ; Store new UIC in PCB and new username in P1 space and JIB. ; Allow optional setting of account name in the JIB. ; ; Environment: ; Called in kernal mode to change protected structures. ;-- ; ; Modification History: ; ; Author: F. Nagy Creation date: 21-Sep-83 ; ; V1.0 21-Sep-83 FJN Created from Aug. 83 Pageswapper and SET UIC code to ; form basis for SETUSER foreign command ; V2.0 16-Jan-84 FJN Added optional parameter for account name ; .PAGE .SUBTITLE Declarations ; ; Include Files: ; .LIBRARY "SYS$LIBRARY:LIB.MLB" ; ; Library Macros: ; .NOCROSS $JIBDEF ;Job Information Block $PCBDEF ;Process Control Block $SSDEF ;System Status codes .CROSS ; ; Local Macros: ; ; NONE ; ; Equated Symbols: ; ; NONE ; ; Pure data and code: ; .PSECT _CODE,LONG,EXE,NOWRT,CON,LCL,SHR,RD .PAGE .SUBTITLE Routine to store UIC and Username ;+/SET_UIC_USER ; ; Functional Description: ; Called in kernel mode to store UIC into PCB and username into JIB ; and into P1 space. ; ; Input Parameters: ; 4(AP) - pointer to 12 character username text ; 8(AP) - pointer to UIC longword ; 12(AP) - pointer to optional 8 character account name (0 if none) ; ; Implicit Inputs: ; CTL$GL_PCB - pointer to PCB for this process ; ; Output Parameters: ; Returns completion status in R0. ; ; Implicit Outputs: ; CTL$T_USERNAME - new username stored here ; ; Condition Codes: ; SS$_NORMAL success ; ; Side Effects: ; New username stored at JIB$T_USERNAME in the process's JIB and a new ; UIC is stored in the PCB at PCB$L_UIC. If an account name parameter ; is provided, then the new account name is stored in the JIB at offset ; JIB$T_ACCOUNT. ;- .ENTRY SET_UIC_USER,^M ;Move username into P1 space MOVC3 #JIB$S_USERNAME,@4(AP),G^CTL$T_USERNAME MOVL G^CTL$GL_PCB,R0 ;Get pointer to PCB MOVL @8(AP),PCB$L_UIC(R0) ;Store UIC into the PCB MOVL PCB$L_JIB(R0),R1 ;Get pointer to JIB from the PCB ;Move username into the JIB MOVC3 #JIB$S_USERNAME,@4(AP),JIB$T_USERNAME(R1) CMPB (AP),#3 ;Check for 3 arguments BLSSU 9$ ;Exit if no account name parameter TSTL 12(AP) ;Really check for pointer to account BEQL 9$ ;Exit if 3rd parameter defaulted MOVL G^CTL$GL_PCB,R0 ;Get pointer to PCB once more and ... MOVL PCB$L_JIB(R0),R1 ;Get pointer to JIB from the PCB ;Move account name into the JIB MOVC3 #JIB$S_ACCOUNT,@12(AP),JIB$T_ACCOUNT(R1) 9$: MOVZWL #SS$_NORMAL,R0 RET .END