Article 4857 of vmsnet.internals: In comp.os.vms Eric F. Richards wrote: > Greetings all... > I'm trying to figure out something in the lock manager. > What I want to do is create a lock in EXEC mode and be able to convert it > in USER mode. Now, the impression I get from the docs is that I can do > this, if I say, for example > $enqw_s lkmode=#lck$k_nlmode, - ; create a null lock > acmode=#psl$c_user, - ; ...user-mode, > resnam=name, - ; ...using this name > lksb=lksb ; store its lock ID here > to create the lock, and then from user mode, say... > $enqw_s lkmode=#lck$k_exmode, - ; convert lock to exclusive > flags=#lck$m_convert, - ; ... > acmode=#psl$c_user, - ; ...user-mode, > lksb=lksb ; this is the ID > However, this returns SS$_IVLOCKID. So... > 1) is there a way to do what I want, that is, create the lock in an elvated > processor mode and convert it at USER mode? Brian Schenkenberger sent me a short hack to get around this problem, basically by modifying the LKB after the fact. It seems to behave exactly the way I want it to: $cmkrnl_s routin=fixit ; always legal from EXEC mode blbc r0, error ; on error bail out . . . .entry fixit, ^m ; R4 get LKID, R6 gets LKB addr movl lksb+4, r4 ; get lock ID jsb g^lck$validate_local_lkid ; get LKB blbc r0, 10$ ; on error bail out insv #psl$c_user, #lkb$v_mode, - ; set lock mode to USER mode #lkb$s_mode, lkb$b_rmod(r6) ; ...in LKB -- just force it. 10$: ret ; back to EXEC mode -- Eric F. Richards efricha@alumni.cs.colorado.edu "The weird part is that I can feel productive even when I'm doomed." - Dilbert