Module openj9.dtfj

Class EnvironmentUtils


  • public class EnvironmentUtils
    extends Object
    • Constructor Detail

      • EnvironmentUtils

        public EnvironmentUtils()
    • Method Detail

      • readEnvironment

        public static Properties readEnvironment​(IProcess proc,
                                                 long environPointer)
                                          throws MemoryFault
        Extracts environment data from the environ pointer
        Parameters:
        proc - Process whose environment is being extracted
        environPointer - char ** environ value
        Returns:
        Environment properties
        Throws:
        MemoryFault
      • readEnvironmentStrings

        public static Properties readEnvironmentStrings​(IProcess proc,
                                                        long environmentPtr)
                                                 throws MemoryFault
        Constructs a set of environment variable properties a the Windows environment variable string block. Documentation in MSDN: The GetEnvironmentStrings function returns a pointer to a block of memory that contains the environment variables of the calling process (both the system and the user environment variables). Each environment block contains the environment variables in the following format: Var1=Value1\0 Var2=Value2\0 Var3=Value3\0 .... VarN=ValueN\0\0
        Parameters:
        proc - - process whose environment variables are being extracted
        environPtr - - address of Windows environment strings memory block
        Returns:
        Properties object containing list of process environment variable names and values
        Throws:
        MemoryFault