home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / osi / isode / vmsisode / vmsisode80_tar.Z / vmsisode80_tar / sockit / source / setuser.mar < prev    next >
Encoding:
Text File  |  1990-06-20  |  2.5 KB  |  86 lines

  1.         .TITLE SYS_SET_USERNAME
  2. ;
  3.         .IDENT /X01-001/
  4. ;
  5. ;       FACILITY:       SYS - General procedure library
  6. ;
  7. ;       ABSTRACT:       Rewrite current process's USERNAME
  8. ;
  9. ;       ENVIRONMENT:    User mode, calls kernel mode routine, requires
  10. ;                       user privelege CMKRNL
  11. ;
  12. ;
  13. ;       AUTHOR:         Geoff Fitch
  14. ;       CREATION DATE:  04-AUG-82
  15. ;
  16. ;--
  17. ;++
  18. ;
  19. ;  FUNCTIONAL DESCRIPTION:
  20. ;
  21. ;
  22. ;       This routine is passed the address of a string descriptor
  23. ;       pointing to the new username, it copies the string buffer
  24. ;       to a local buffer and calls a kernel mode routine to write
  25. ;       the new username in control space and the JIB.
  26. ;
  27. ;       Calling routines must be linked with SYS$SYSTEM:SYS.STB
  28. ;
  29. ;  CALLING SEQUENCE:   (from DCL)
  30. ;
  31. ;       ret_status.wlc.v = SYS_SET_USERNAME ( new_name.rt.dx )
  32. ;
  33. ;  FORMAL PARAMETERS:
  34. ;
  35. ;       NEW_NAME                String containing the new username
  36. ;
  37. ;  IMPLICIT INPUTS:
  38. ;
  39. ;       NONE
  40. ;
  41. ;  IMPLICIT OUTPUTS:
  42. ;
  43. ;       Process control space (CTL$T_USERNAME)
  44. ;       Jb Info Block  (JIB$T_USERNAME)
  45. ;
  46. ;  COMPLETION STATUS:
  47. ;
  48. ;       SS$_NORMAL              Success
  49. ;       SS$_NOPRIV              You don't have CMKRNL
  50. ;       <other>                 something returned from LIB$SCOPY_DXDX
  51. ;
  52. ;  SIDE EFFECTS:
  53. ;
  54. ;       Process Username is changed
  55. ;--
  56. ;
  57.         .LIBRARY        /SYS$LIBRARY:LIB.MLB/
  58.         $JIBDEF                                 ; JIB symbols
  59.         $PCBDEF
  60.  
  61.         .PSECT  _SYS_CODE, PIC, USR, CON, REL, LCL, SHR, EXE, RD, NOWRT
  62.  
  63.         .ENTRY  SYS_SET_USERNAME, ^M<R2,R3,R4,R5,R6,R7,R8,R9,R10,R11> ;save all reg
  64.         SUBL2   #12, SP                 ; allocate local string
  65.         MOVAL   (SP), -(SP)             ; and create string descr
  66.         PUSHL   #12
  67.         PUSHAQ  (SP)
  68.         PUSHAQ  @4(AP)                  ; copy username to local area
  69.         CALLS   #2, G^LIB$SCOPY_DXDX
  70.         BLBC    R0, 10$                 ; return if copy failed
  71.         ADDL    #8, SP                  ; deallocate descriptor
  72.         MOVAB   (SP), R8                ; save buffer address
  73.         $CMKRNL_S  ROUTIN=WRITEUSER     ; call kernel routine
  74. 10$:    RET
  75.  
  76.         .ENTRY  WRITEUSER, 0
  77.         MOVC3   #12, (R8), G^CTL$T_USERNAME       ; write username in P1 space
  78.         MOVL    G^CTL$GL_PCB, R0                  ; load address of pcb
  79.         MOVL    PCB$L_JIB(R0), R1               ; load address of jib
  80.         MOVC3   #12, (R8), JIB$T_USERNAME(R1)   ; write username into jib
  81.         MOVL    #1, R0                          ; return with success
  82.         RET
  83.  
  84.  
  85.         .END
  86.