INtime SDK Help
GetRtEnvironmentVariable
INtime SDK v7.1 > About INtime > INtime Kernel > Environment variables > GetRtEnvironmentVariable

Return the value of an environment variable given its name.

BOOLEAN 
GetRtEnvironmentVariable(
    LPCSTR szName, 
    LPSTR szValue, 
    LPDWORD pdwValueLen);

Parameters

szName
Pointer to name of the environment variable to find
szValue
Pointer to buffer where value is to be received
pdwValueLen
Pointer to variable containing the length of the buffer. After the call the variable contains the length of the returned value.

Remarks

Environment variable names are case-sensitive.

If the buffer supplied is too small for the value to be returned the call returns FALSE and sets the last error to E_LIMIT, and the value at pdwLocation to the size required to return the value.

Return values

Return TRUE on sucess and the value of the requested variable is copied to the supplied buffer.

Returns FALSE on error. The status is returned by calling GetLastRtError(). Possible error conditions include:

E_EXIST
There is no variable of the given name.
E_LIMIT
The buffer supplied is too small for the value of the variable to be returned. See Remarks.
E_BAD_ADDR
One or other of the szValue or pdwValueLen pointers is invalid.

Requirements

Versions Defined in Include Link to
INtime 6.0 intime/rt/include/rtbase.h rt.h rt.lib

See Also