Exemple #1
0
 /** Retrieves the data for the value with the specified name, within the specified open key. */
 public String wfmQueryValue(final HKEY hKey, final String valueName) throws XfsException {
   final ZSTR data = new ZSTR(SIZE_LIMIT, true);
   final DWORD cchData = new DWORD(0L);
   final int errorCode = wfmQueryValue0(hKey, new ZSTR(valueName), data, cchData);
   XfsException.throwFor(errorCode);
   return data.toString();
 }
Exemple #2
0
 /**
  * Closes the specified key.
  *
  * @param hKey Handle to the currently open key that is to be closed.
  * @throws XfsException
  */
 public void wfmCloseKey(final HKEY hKey) throws XfsException {
   final int errorCode = wfmCloseKey0(hKey);
   XfsException.throwFor(errorCode);
   synchronized (openKeys) {
     openKeys.remove(hKey);
   }
 }
Exemple #3
0
 /**
  * Enumerates the values of the specified open key. Retrieves the name and data for one value each
  * time it is called.
  */
 public Map.Entry<String, String> wfmEnumValue(final HKEY hKey, final DWORD iValue)
     throws XfsException {
   ZSTR value = new ZSTR(SIZE_LIMIT, true);
   ZSTR data = new ZSTR(SIZE_LIMIT, true);
   final int errorCode = wfmEnumValue0(hKey, iValue, value, data);
   XfsException.throwFor(errorCode);
   return new ValuePair(value.toString(), data.toString());
 }
Exemple #4
0
 /**
  * Enumerates the subkeys of the specified open key. Retrieves information about one subkey each
  * time it is called.
  *
  * @param hKey Handle to a currently open key, or the predefined handle value: {@link
  *     #WFS_CFG_HKEY_XFS_ROOT}
  * @return the name of the subkey
  */
 public String wfmEnumKey(final HKEY key, final DWORD iSubKey) throws XfsException {
   final ZSTR name = new ZSTR(SIZE_LIMIT, true);
   DWORD cchName = new DWORD(name.length);
   FILETIME lastWrite = new FILETIME();
   final int errorCode = wfmEnumKey0(key, iSubKey, name, cchName, lastWrite);
   XfsException.throwFor(errorCode);
   return name.toString();
 }
Exemple #5
0
 /** Opens the specified key. */
 public HKEY wfmOpenKey(final HKEY hKey, final String subKey) throws XfsException {
   HKEY hkResult = new HKEY();
   final int errorCode = wfmOpenKey0(hKey, (subKey == null ? null : new ZSTR(subKey)), hkResult);
   XfsException.throwFor(errorCode);
   synchronized (openKeys) {
     openKeys.add(hkResult);
   }
   return hkResult;
 }