.TITLE SWAPUSER - set up process account/username and UIC ; ; Author: Chris Chaundy ; Date: 13-May-1981 ; Update: 16-Nov-1982 (for VAX/VMS V3, copy account to JIB as well ; and get PCB address from CTL$GL_PCB) ; ; This routine is a MACRO-32 rehash of the BLISS-32 hack routine from ; the VAX/VMS V2.0 microfiche kit to set up a new username for a process, ; expanded to also change UIC, and set up as a subroutine (which must be ; called in kernel mode). ; $DSCDEF $JIBDEF $UAFDEF $PCBDEF ; V4.0 change .PSECT $CODE$,NOWRT ; Kernel mode routine to change account, username and UIC USRARG = 4 UICARG = 8 ACCARG = 12 .ENTRY SWAPUSER,^M MOVL ACCARG(AP),R6 ;get account desc adr MOVC5 DSC$W_LENGTH(R6),@DSC$A_POINTER(R6),#^A/ /, - #UAF$S_ACCOUNT, - @#CTL$T_ACCOUNT ;copy into control region MOVL CTL$GL_PCB,R0 ;get our own PCB adr MOVL PCB$L_JIB(R0),R1 ;from PCB, get our JIB adr MOVC5 DSC$W_LENGTH(R6),@DSC$A_POINTER(R6),#^A/ /, - #UAF$S_ACCOUNT, - JIB$T_ACCOUNT(R1) ;now copy new account into JIB MOVL USRARG(AP),R6 ;get username desc adr MOVC5 DSC$W_LENGTH(R6),@DSC$A_POINTER(R6),#^A/ /, - #UAF$S_USERNAME, - @#CTL$T_USERNAME ;copy into control region MOVL CTL$GL_PCB,R0 ;get our own PCB adr MOVL @UICARG(AP),PCB$L_UIC(R0) ;set new UIC MOVL PCB$L_JIB(R0),R1 ;from PCB, get our JIB adr MOVC5 DSC$W_LENGTH(R6),@DSC$A_POINTER(R6),#^A/ /, - #UAF$S_USERNAME, - JIB$T_USERNAME(R1) ;now copy new name into JIB MOVZBL #1,R0 ;show success RET ;and return .END