This wouldn't very hard to do. The only problem is that a Windows native library would be required. This means that the registry jar would need to be in the common area of the servlet engines classloading mechanism.
Since all contexts share the same JVM the different classloaders would conflict.