code: public void createKey(HKey hk, String key) throws RegistryException {
  		int[] ret;
  		try {
  			ret = ReflectedMethods.createKey(hk.root(), hk.hex(), key);
  		} catch (Exception e) {
  			throw new RegistryException("Cannot create key " + key, e);
  		}
  		if (ret.length == 0) {
  			throw new RegistryException("Cannot create key " + key + ". Zero return length");
  		}
  		if (ret[1] != RC.SUCCESS) {
  			throw new RegistryException("Cannot create key " + key + ". Return code is " + ret[1]);
  		}
  	}
docs: Create key in registry.
  
  @param hk the HKEY
  @param key the key
  @throws RegistryException when something is not right