home *** CD-ROM | disk | FTP | other *** search
- .TITLE SYS_SET_USERNAME
- ;
- .IDENT /X01-001/
- ;
- ; FACILITY: SYS - General procedure library
- ;
- ; ABSTRACT: Rewrite current process's USERNAME
- ;
- ; ENVIRONMENT: User mode, calls kernel mode routine, requires
- ; user privelege CMKRNL
- ;
- ;
- ; AUTHOR: Geoff Fitch
- ; CREATION DATE: 04-AUG-82
- ;
- ;--
- ;++
- ;
- ; FUNCTIONAL DESCRIPTION:
- ;
- ;
- ; This routine is passed the address of a string descriptor
- ; pointing to the new username, it copies the string buffer
- ; to a local buffer and calls a kernel mode routine to write
- ; the new username in control space and the JIB.
- ;
- ; Calling routines must be linked with SYS$SYSTEM:SYS.STB
- ;
- ; CALLING SEQUENCE: (from DCL)
- ;
- ; ret_status.wlc.v = SYS_SET_USERNAME ( new_name.rt.dx )
- ;
- ; FORMAL PARAMETERS:
- ;
- ; NEW_NAME String containing the new username
- ;
- ; IMPLICIT INPUTS:
- ;
- ; NONE
- ;
- ; IMPLICIT OUTPUTS:
- ;
- ; Process control space (CTL$T_USERNAME)
- ; Jb Info Block (JIB$T_USERNAME)
- ;
- ; COMPLETION STATUS:
- ;
- ; SS$_NORMAL Success
- ; SS$_NOPRIV You don't have CMKRNL
- ; <other> something returned from LIB$SCOPY_DXDX
- ;
- ; SIDE EFFECTS:
- ;
- ; Process Username is changed
- ;--
- ;
- .LIBRARY /SYS$LIBRARY:LIB.MLB/
- $JIBDEF ; JIB symbols
- $PCBDEF
-
- .PSECT _SYS_CODE, PIC, USR, CON, REL, LCL, SHR, EXE, RD, NOWRT
-
- .ENTRY SYS_SET_USERNAME, ^M<R2,R3,R4,R5,R6,R7,R8,R9,R10,R11> ;save all reg
- SUBL2 #12, SP ; allocate local string
- MOVAL (SP), -(SP) ; and create string descr
- PUSHL #12
- PUSHAQ (SP)
- PUSHAQ @4(AP) ; copy username to local area
- CALLS #2, G^LIB$SCOPY_DXDX
- BLBC R0, 10$ ; return if copy failed
- ADDL #8, SP ; deallocate descriptor
- MOVAB (SP), R8 ; save buffer address
- $CMKRNL_S ROUTIN=WRITEUSER ; call kernel routine
- 10$: RET
-
- .ENTRY WRITEUSER, 0
- MOVC3 #12, (R8), G^CTL$T_USERNAME ; write username in P1 space
- MOVL G^CTL$GL_PCB, R0 ; load address of pcb
- MOVL PCB$L_JIB(R0), R1 ; load address of jib
- MOVC3 #12, (R8), JIB$T_USERNAME(R1) ; write username into jib
- MOVL #1, R0 ; return with success
- RET
-
-
- .END
-