| Modifier and Type | Class and Description |
|---|---|
| public static enum | |
| public static class | Advapi32Util.Account
An account. |
| public static class | |
| public static class | Advapi32Util.EventLogIterator
An iterator for Event Log entries. |
| public static class | Advapi32Util.EventLogRecord
An event log record. |
| public static enum | Advapi32Util.EventLogType
Event log types. |
| public static class | |
| public static class | Advapi32Util.Privilege
Convenience class to enable certain Windows process privileges |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | Returns: true if has access, otherwise falsethe file to check file, Advapi32Util.the permission to check for the file permissionToCheckChecks if the current process has the given permission for the file. |
| public static int | |
| public static void | backupEncryptedFile(File
The encrypted file or directory to backup. src, File The directory where the backup will be saved. destDir)Backup an encrypted file or folder without decrypting it. |
| public static String | Returns: String SID.SID bytes. sidConvert a security identifier (SID) to a string format suitable for display, storage, or transmission. |
| public static byte[] | Returns: SID bytes.String SID. sidString)Convert a string representation of a security identifier (SID) to a binary format. |
| public static void | |
| public static void | disableEncryption(File
The directory for which to enable or disable encryption. directory, boolean TRUE to disable encryption. FALSE to enable it. disable)Disables or enables encryption of the specified directory and the files in it. |
| public static void | |
| public static int | Returns: The status of the file.The file to check the status for. file)Checks the encryption status of a file. |
| public static Advapi32Util. | Returns: A structure containing the account SID;Specifies the account name. accountName)Retrieves a security identifier (SID) for the account on the current system. |
| public static Advapi32Util. | Returns: A structure containing the account SID.Name of the system. systemName, String Account name. accountName)Retrieves a security identifier (SID) for a given account. |
| public static Advapi32Util. | |
| public static Advapi32Util. | Returns: Account.Name of the system. systemName, WinNT.SID. sidGet the account by SID. |
| public static Advapi32Util. | Returns: Account.SID. sidString)Get an account name from a string SID on the local machine. |
| public static Advapi32Util. | Returns: Account.System name. systemName, String SID. sidString)Get an account name from a string SID. |
| public static int | Returns: size of the ACElength of the sid sidLength)Helper function to calculate the size of an ACE for a given PSID size |
| public static Advapi32Util. | Returns: An array of groups.Return the group memberships of the currently logged on user. |
| public static String | Returns: A environment blockEnvironment variables environment)Converts a map of environment variables to an environment block suitable
for |
| public static WinNT. | Returns: list of ACEs in the DACL of the referenced filepath to the file fileName, boolean if true compatible ACEs are merged if possible compact)
|
| public static WinNT. | Returns: The file's Security Descriptor in self relative format.File object containing a path to a file system object. file, boolean Get the SACL. See getSACL)Advapi32#GetNamedSecurityInfo for process privilege requirements in getting the SACL.Gets a file's Security Descriptor. |
| private static Memory | |
| public static Memory | Returns: Memory containing the self relative security descriptorA pointer to a null-terminated string that specifies the name of the object
from which to retrieve security information. For descriptions of the string
formats for the different object types, see SE_OBJECT_TYPE in
absoluteObjectPath, int AccCtrl.Object type referred to by the path. See objectType, boolean AccCtrl. for valid definitions.Get SACL of the object. See getSACL)Advapi32#GetNamedSecurityInfo for process privilege requirements in getting the SACL.Get a self relative security descriptor for the given object type. |
| public static Advapi32Util. | Returns: Token user.Token. hTokenThis function returns the information about the user who owns a security token, |
| public static Advapi32Util. | Returns: Token groups.Token. hTokenThis function returns the groups associated with a security token, such as a user token. |
| public static Advapi32Util. | Returns: Token primary group.Token. hTokenThis function returns the primary group associated with a security token, such as a user token. |
| public static String | Returns: A user name.Retrieves the name of the user associated with the current thread. |
| public static boolean | Returns: true if the current process has elevated perissions, false otherwise.Reports whether the current process is running with elevated permissions. |
| public static boolean | Returns: True if the SID is of the well-known type, false otherwise.String representation of a SID. sidString, int Member of the WELL_KNOWN_SID_TYPE enumeration to compare with
the SID at pSid. wellKnownSidType)Compares a SID to a well known SID and returns TRUE if they match. |
| public static boolean | Returns: True if the SID is of the well-known type, false otherwise.Byte representation of a SID. sidBytes, int Member of the WELL_KNOWN_SID_TYPE enumeration to compare with
the SID at pSid. wellKnownSidType)Compares a SID to a well known SID and returns TRUE if they match. |
| public static void | |
| public static boolean | Returns: True if the key was created, false otherwise.Parent key. hKey,Key name. keyName)Create a registry key. |
| public static boolean | Returns: True if the key was created, false otherwise.Parent key. hKey,Key name. keyName, int Registry key security and access rights to be requested in addition to WinNT.KEY_READ.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Create a registry key. |
| public static boolean | Returns: True if the key was created, false otherwise.Root key. root,Path to an existing registry key. parentPath, String Key name. keyName)Create a registry key. |
| public static boolean | Returns: True if the key was created, false otherwise.Root key. root,Path to an existing registry key. parentPath, String Key name. keyName, int Registry key security and access rights to be requested in addition to WinNT.KEY_CREATE_SUB_KEY.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Create a registry key. |
| public static void | registryDeleteKey(WinReg.
Parent key. hKey,Name of the key to delete. keyName)Delete a registry key. |
| public static void | registryDeleteKey(WinReg.
Root key. root,Path to an existing registry key. keyPath, String Name of the key to delete. keyName)Delete a registry key. |
| public static void | registryDeleteKey(WinReg.
Root key. root,Path to an existing registry key. keyPath, String Name of the key to delete. keyName, int Registry key security and access rights to be requested in addition to WinNT.KEY_READ and WinNT.KEY_WRITE.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Delete a registry key. |
| public static void | registryDeleteValue(WinReg.
Parent key. hKey,Name of the value to delete. valueName)Delete a registry value. |
| public static void | registryDeleteValue(WinReg.
Root key. root,Path to an existing registry key. keyPath, String Name of the value to delete. valueName)Delete a registry value. |
| public static void | registryDeleteValue(WinReg.
Root key. root,Path to an existing registry key. keyPath, String Name of the value to delete. valueName, int Registry key security and access rights to be requested in addition to WinNT.KEY_READ and WinNT.KEY_WRITE.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Delete a registry value. |
| public static byte[] | Returns: String value.Root key. root,Registry path. key, String Name of the value to retrieve. value)Get a registry REG_BINARY value. |
| public static byte[] | Returns: String value.Root key. root,Registry path. key, String Name of the value to retrieve. value, int Registry key security and access rights to be requested in addition to WinNT.KEY_READ.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Get a registry REG_BINARY value. |
| public static byte[] | Returns: String value.Parent Key. hKey,Name of the value to retrieve. value)Get a registry REG_BINARY value. |
| public static String | Returns: String value.Root key. root,Registry path. key, String Name of the value to retrieve. value)Get a registry REG_EXPAND_SZ value. |
| public static String | Returns: String value.Root key. root,Registry path. key, String Name of the value to retrieve. value, int Registry key security and access rights to be requested in addition to WinNT.KEY_READ.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Get a registry REG_EXPAND_SZ value. |
| public static String | Returns: String value.Parent Key. hKey,Name of the value to retrieve. value)Get a registry REG_EXPAND_SZ value. |
| public static int | Returns: Integer value.Root key. root,Registry key path. key, String Name of the value to retrieve. value)Get a registry DWORD value. |
| public static int | Returns: Integer value.Root key. root,Registry key path. key, String Name of the value to retrieve. value, int Registry key security and access rights to be requested in addition to WinNT.KEY_READ.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Get a registry DWORD value. |
| public static int | Returns: Integer value.Parent key. hKey,Name of the value to retrieve. value)Get a registry DWORD value. |
| public static WinReg. | Returns: HKEYByReference.Root key. root,Path to a registry key. keyPath, int Access level (e.g. WinNT.KEY_READ) samDesired)Get a registry key, the caller is responsible to close the key after use. |
| public static String[] | Returns: Array of registry key names.Registry key. hKeyGet names of the registry key's sub-keys. |
| public static String[] | Returns: Array of registry key names.Root key. root,Path to a registry key. keyPath)Get names of the registry key's sub-keys. |
| public static String[] | Returns: Array of registry key names.Root key. root,Path to a registry key. keyPath, int Registry key security and access rights to be requested in addition to WinNT.KEY_READ.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Get names of the registry key's sub-keys. |
| public static long | Returns: Integer value.Root key. root,Registry key path. key, String Name of the value to retrieve. value)Get a registry QWORD value. |
| public static long | Returns: Integer value.Root key. root,Registry key path. key, String Name of the value to retrieve. value, int Registry key security and access rights to be requested in addition to WinNT.KEY_READ.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Get a registry QWORD value. |
| public static long | Returns: Integer value.Parent key. hKey,Name of the value to retrieve. value)Get a registry QWORD value. |
| public static String[] | Returns: String value.Root key. root,Registry path. key, String Name of the value to retrieve. value)Get a registry REG_MULTI_SZ value. |
| public static String[] | Returns: String value.Root key. root,Registry path. key, String Name of the value to retrieve. value, int Registry key security and access rights to be requested in addition to WinNT.KEY_READ.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Get a registry REG_MULTI_SZ value. |
| public static String[] | Returns: String value.Parent Key. hKey,Name of the value to retrieve. value)Get a registry REG_MULTI_SZ value. |
| public static String | Returns: String value.Root key. root,Registry path. key, String Name of the value to retrieve. value)Get a registry REG_SZ value. |
| public static String | Returns: String value.Root key. root,Registry path. key, String Name of the value to retrieve. value, int Registry key security and access rights to be requested in addition to WinNT.KEY_READ.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Get a registry REG_SZ value. |
| public static String | Returns: String value.Parent Key. hKey,Name of the value to retrieve. value)Get a registry REG_SZ value. |
| public static Object | Returns: Object value.Root key. hkKey,Registry key path. subKey, String Name of the value to retrieve or null for the default value. lpValueName)Get a registry value and returns a java object depending on the value type. |
| public static TreeMap | Returns: Table of values.Registry key. hKeyGet a table of registry values. |
| public static TreeMap | Returns: Table of values.Registry root. root,Regitry key path. keyPath)Get a table of registry values. |
| public static TreeMap | Returns: Table of values.Registry root. root,Regitry key path. keyPath, int Registry key security and access rights to be requested in addition to WinNT.KEY_READ.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Get a table of registry values. |
| public static boolean | Returns: True if the key exists.HKEY_LOCAL_MACHINE, etc. root,Path to the registry key. key)Checks whether a registry key exists. |
| public static boolean | Returns: True if the key exists.HKEY_LOCAL_MACHINE, etc. root,Path to the registry key. key, int Registry key security and access rights to be requested in addition to WinNT.KEY_READ.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Checks whether a registry key exists. |
| public static WinReg. | registryLoadAppKey(String
Path to the file fileName, int Access mask that specifies the desired access rights to the samDesired, int If this parameter is REG_PROCESS_APPKEY,
the hive cannot be loaded again while it is loaded by the caller.
This prevents access to this registry hive by another caller. dwOptions)Loads the specified registry hive as an application hive. |
| public static Advapi32Util. | Returns: A InfoKey value object.Current registry key. hKey,security descriptor lpcbSecurityDescriptor)Queries the information about a specified key. |
| public static Advapi32Util. | Returns: A InfoKey value object.Current registry key. hKey,Queries the information about a specified key. |
| public static void | registrySetBinaryValue(WinReg.
Parent key. hKey,Value name. name, byte[] Data to write to registry. data)Set a binary value in registry. |
| public static void | registrySetBinaryValue(WinReg.
Root key. root,Path to an existing registry key. keyPath, String Value name. name, byte[] Data to write to registry. data)Set a binary value in registry. |
| public static void | registrySetBinaryValue(WinReg.
Root key. root,Path to an existing registry key. keyPath, String Value name. name, byte[] Data to write to registry. data, int Registry key security and access rights to be requested in addition to WinNT.KEY_READ and WinNT.KEY_WRITE.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Set a binary value in registry. |
| public static void | registrySetExpandableStringValue(WinReg.
Parent key. hKey,Value name. name, String Value to write to registry. value)Set an expandable string value in registry. |
| public static void | |
| public static void | registrySetExpandableStringValue(WinReg.
Root key. root,Path to an existing registry key. keyPath, String Value name. name, String Value to write to registry. value, int Registry key security and access rights to be requested in addition to WinNT.KEY_READ and WinNT.KEY_WRITE.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Set a string value in registry. |
| public static void | registrySetIntValue(WinReg.
Parent key. hKey,Value name. name, int Value to write to registry. value)Set an integer value in registry. |
| public static void | registrySetIntValue(WinReg.
Root key. root,Path to an existing registry key. keyPath, String Value name. name, int Value to write to registry. value)Set an integer value in registry. |
| public static void | registrySetIntValue(WinReg.
Root key. root,Path to an existing registry key. keyPath, String Value name. name, int Value to write to registry. value, int Registry key security and access rights to be requested in addition to WinNT.KEY_READ and WinNT.KEY_WRITE.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Set an integer value in registry. |
| public static void | registrySetLongValue(WinReg.
Parent key. hKey,Value name. name, long Value to write to registry. value)Set a long value in registry. |
| public static void | registrySetLongValue(WinReg.
Root key. root,Path to an existing registry key. keyPath, String Value name. name, long Value to write to registry. value)Set a long value in registry. |
| public static void | registrySetLongValue(WinReg.
Root key. root,Path to an existing registry key. keyPath, String Value name. name, long Value to write to registry. value, int Registry key security and access rights to be requested in addition to WinNT.KEY_READ and WinNT.KEY_WRITE.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Set a long value in registry. |
| public static void | registrySetStringArray(WinReg.
Parent key. hKey,Name. name, String[] Array of strings to write to registry. arr)Set a string array value in registry. |
| public static void | |
| public static void | registrySetStringArray(WinReg.
Root key. root,Path to an existing registry key. keyPath, String Value name. name, String[] Array of strings to write to registry. arr, int Registry key security and access rights to be requested in addition to WinNT.KEY_READ and WinNT.KEY_WRITE.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Set a string array value in registry. |
| public static void | registrySetStringValue(WinReg.
Parent key. hKey,Value name. name, String Value to write to registry. value)Set a string value in registry. |
| public static void | |
| public static void | registrySetStringValue(WinReg.
Root key. root,Path to an existing registry key. keyPath, String Value name. name, String Value to write to registry. value, int Registry key security and access rights to be requested in addition to WinNT.KEY_READ and WinNT.KEY_WRITE.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Set a string value in registry. |
| public static boolean | Returns: True if the value exists.HKEY_LOCAL_MACHINE, etc. root,Registry key path. key, String Value name. value)Checks whether a registry value exists. |
| public static boolean | Returns: True if the value exists.HKEY_LOCAL_MACHINE, etc. root,Registry key path. key, String Value name. value, int Registry key security and access rights to be requested in addition to WinNT.KEY_READ.
(e.g WinNT.KEY_WOW64_32KEY or WinNT.KEY_WOW64_64KEY to force 32bit or 64bit registry access.) samDesiredExtra)Checks whether a registry value exists. |
| pack-priv static String[] | Returns: An array of strings corresponding to the strings in the buffer.A buffer containing strings delimited by a null character, ending
with two null characters. data)Convert the null-delimited buffer of strings returned from registry values of
type |
| public static void | setFileSecurityDescriptor(File
File object containing a path to a file system object. file, WinNT.The security descriptor to set. securityDescriptor,Set the owner. See setOwner, boolean Advapi32#SetNamedSecurityInfo for process privilege requirements in setting the owner.Set the group. setGroup, boolean Set the DACL. setDACL, boolean Set the SACL. See setSACL, boolean Advapi32#SetNamedSecurityInfo for process privilege requirements in setting the SACL.Set DACL protected status as contained within securityDescriptor.control. setDACLProtectedStatus, boolean Set SACL protected status as contained within securityDescriptor.control. * setSACLProtectedStatus)Sets a file's Security Descriptor. |
| public static void | setSecurityDescriptorForObject(final String
A pointer to a null-terminated string that specifies the name of the object
from which to retrieve security information. For descriptions of the string
formats for the different object types, see absoluteObjectPath, int AccCtrl..Object type referred to by the path. See objectType, WinNT.AccCtrl. for valid definitions.A security descriptor to set. securityDescriptor,Set the owner. The owner is extracted from securityDescriptor and must be valid,
otherwise IllegalArgumentException is throw.
See setOwner, boolean Advapi32#SetNamedSecurityInfo for process privilege requirements in getting the OWNER.Set the group. The group is extracted from securityDescriptor and must be valid,
otherwise IllegalArgumentException is throw. setGroup, boolean Set the DACL. The DACL is extracted from securityDescriptor and must be valid,
otherwise IllegalArgumentException is throw. setDACL, boolean Set the SACL. The SACL is extracted from securityDescriptor and must be valid,
otherwise IllegalArgumentException is throw.
See setSACL, boolean Advapi32#SetNamedSecurityInfo for process privilege requirements in getting the SACL.Set DACL protected status as contained within securityDescriptor.control. setDACLProtectedStatus, boolean Set SACL protected status as contained within securityDescriptor.control. setSACLProtectedStatus)Set a self relative security descriptor for the given object type. |