The Environment is a data structure that contains environmental information that can be passed between a caller and a called object when a method is executed. For example, it is used to pass information about the user id of a client, to return exception data to the client following a method call, and so on.
A pointer to an Environment variable is passed as an argument to method calls (unless the method's class has the callstyle=oidl SOM IDL modifier). The Environment typedef is defined in "som.h", and an instance of the structure is allocated by the caller in any reasonable way: on the stack (by declaring a local variable and initializing it using the macro SOM_InitEnvironment), dynamically (using the SOM_CreateLocalEnvironment macro), or by calling the somGetGlobalEnvironment function to allocate an Environment structure to be shared by objects running in the same thread.
For class libraries that use callstyle=oidl, there is no explicit Environment parameter. For these libraries, exception information may be passed using the per-thread Environment structure returned by the somGetGlobalEnvironment procedure.