예제 #1
0
 /*
  * (non-Javadoc)
  * @see waffle.windows.auth.IWindowsIdentity#isGuest()
  */
 @Override
 public boolean isGuest() {
     for (final Account userGroup : this.getUserGroups()) {
         if (Advapi32Util.isWellKnownSid(userGroup.sid, WELL_KNOWN_SID_TYPE.WinBuiltinGuestsSid)) {
             return true;
         }
         if (Advapi32Util.isWellKnownSid(userGroup.sid, WELL_KNOWN_SID_TYPE.WinAccountDomainGuestsSid)) {
             return true;
         }
         if (Advapi32Util.isWellKnownSid(userGroup.sid, WELL_KNOWN_SID_TYPE.WinAccountGuestSid)) {
             return true;
         }
     }
     return Advapi32Util.isWellKnownSid(this.getSid(), WELL_KNOWN_SID_TYPE.WinAnonymousSid);
 }
 /**
  * Get the VLC installation directory.
  *
  * <p>If vlc is installed correctly, this should not be needed.
  *
  * @return fully-qualified directory name, or <code>null</code> if the value could not be obtained
  */
 public static String getVlcInstallDir() {
   logger.debug("getVlcInstallDir()");
   try {
     return Advapi32Util.registryGetStringValue(
         WinReg.HKEY_LOCAL_MACHINE, VLC_REGISTRY_KEY, VLC_INSTALL_DIR_KEY);
   } catch (Exception e) {
     logger.warn("Failed to get VLC installation directory from the registry", e);
     return null;
   }
 }
예제 #3
0
 /**
  * Gets the user groups.
  *
  * @return the user groups
  */
 private Account[] getUserGroups() {
     if (this.userGroups == null) {
         this.userGroups = Advapi32Util.getTokenGroups(this.windowsIdentity);
     }
     return this.userGroups.clone();
 }
예제 #4
0
 /**
  * Gets the windows account.
  *
  * @return the windows account
  */
 private Account getWindowsAccount() {
     if (this.windowsAccount == null) {
         this.windowsAccount = Advapi32Util.getTokenAccount(this.windowsIdentity);
     }
     return this.windowsAccount;
 }