attachproc curiously uses a constant variable set to ORDWR, a remnant of some earlier code. instead of always forcing ORDWR for register access, why not try it, and if it can't be opened read-write, use read-only instead.