.title sys_set_account .ident /X1-002/ ;+ ; Version: X1-002 ; ; Facility: General system routines. ; ; Abstract: Change the account associated with the current process. ; ; Environment: Kernel mode. ; ; History: ; ; 28-Sep-1990, DBS, Version X1-001 ; 001 - Original version. ; 19-Jan-1996, DBS, Version X1-002 ; 002 - Added code for alpha and moved argument checking code out of ; the kernel mode stuff. Removed lock stuff - no good on alpha. ;- ;++ ; Functional Description: ; Changes the account of the current process to that specified. ; ; Calling Sequence: ; status = sys_set_account (new_name) ; -or- ; pushaq new_name ; calls #1, g^sys_set_account ; blbc r0, error ; ; Formal Argument(s): ; new_name.rt.ds Address of a fixed length string descriptor which ; points to the new process account name. ; ; Implicit Inputs: ; None ; ; Implicit Outputs: ; None ; ; Completion Codes: ; ss$_ivbuflen The length of the string was not 8 characters. ; ss$_insfarg Insufficient arguments specified in the call. ; ss$_normal Successful completion. ; ss$_ovrmaxarg Too many arguments specified in the call. ; ; Side Effects: ; It is possible to cause BUGCHECKS or system hangs if this routine ; is not used carefully. ;-- .library "SYS$LIBRARY:LIB.MLB" .library "DBSLIBRARY:SYS_MACROS.MLB" .link "SYS$SYSTEM:SYS.STB" /selective_search .ntype ...on_alpha..., R31 .iif equal, <...on_alpha...@-4&^XF>-5, alpha=0 .iif defined, alpha, .disable flagging ; use the following for jsb entry points ;jsb_name:: .iif defined, alpha, .jsb_entry input=, output= .disable global $jibdef $pcbdef $ssdef .external ctl$gl_pcb .external ctl$t_account arg_count=1 ; to see if we have one argument p1=4 ; offset first argument p1_len=8 ; to check the length of the name address=4 ; offset to the string address space=32 def_psect _sys_code, type=CODE, alignment=LONG set_psect _sys_code .entry - sys_set_account, ^m<> cmpw (ap), #arg_count ; do we have one argument ? bgtr 10$ ; too many, bail out bneq 20$ ; nope, not enough, bail out tstl p1(ap) ; check address of descriptor beql 20$ ; not a real argument cmpw @p1(ap), #p1_len ; check the length of the string bneq 30$ ; bail out if not 8 characters $cmkrnl_s - routin=sys___set_account, - arglst=(ap) movl #ss$_normal, r0 brb 40$ 10$: movl #ss$_ovrmaxarg, r0 brb 40$ 20$: movl #ss$_insfarg, r0 brb 40$ 30$: movl #ss$_ivbuflen, r0 40$: ret .entry - sys___set_account, ^m movl p1(ap), r7 ; grab the descriptor address movl address(r7), r7 ; now get the string address movc5 #p1_len, (r7), #space, - ; update the pcb copy of the #p1_len, ctl$t_account ; account movl ctl$gl_pcb, r1 ; grab the pcb pointer movl pcb$l_jib(r1), r6 ; now the pointer to the jib ;;; lock lockname=jib ; lock the jib before we fiddle it movc5 #p1_len, (r7), #space, - ; update the jib copy of the #p1_len, jib$t_account(r6) ; account ;;; unlock lockname=jib ; unlock the jib, we're finished ret sys_set_account_end:: .iif defined, alpha, .jsb_entry input=, output= .end