| PVK_AllocEnv( ) | Allocate Environment | 
HPVKENV PVK_AllocEnv( );
Where:
| HPVKENV | Handle to the environment structure, 4-byte value. Returns null on failure. | 
PVK_AllocEnv( ) is used to allocate the environment. The environment handle must be passed to the following functions to provide thread safety of PXPIO operations: PVK_RegisterKey( ), PVK_OpenExt( ), PVSetEnvMode( ) and PVGetEnvMode( ). The environment handle must be freed at the end of the session to avoid resource leaks.