This call installs a handler for a
vector which can be arbitrarily invoked by Windows code. Some caveats apply:

Your handler must reside within the first 256Mb of RISC-OS memory

If bit 0 of the flags is not set, the handler will be called in IRQ
mode with interrupts disabled just like a normal interrupt handler - hence
you must take care with R14_svc and only call reentrant SWIs. You may
alter R0-R3 and R12.

If bit 0 of the flags is set, the handler will be called next time
RISC-OS is not busy. The processor mode may vary (usually SVC) and you
must preserve all registers - however, you can call any SWI you like.

Be cautious where your handler is located - do NOT use user space
memory in a multitasking environment as your code will not always exist in
its specified location.

Because of the above point, be very sure you have deallocated
the vector before your task exits. Perhaps a check on the environment exit
vector code (eg; onexit())?