--- os2sdk/demos/examples/getenv/getenv.c 2018/08/09 12:25:13 1.1.1.1 +++ os2sdk/demos/examples/getenv/getenv.c 2018/08/09 12:26:13 1.1.1.2 @@ -1,24 +1,27 @@ /* - * Example of DOSGETENV usage + * Example of DosGenEnv usage * * This call gets the addresses of the environment strings and command * line arguments belonging to the current process * - * Compile as: cl -AL -Lp -G2 getenv.c + * Compile as: cl -AL -Lp -G0 getenv.c * - * Copyright (C) Microsoft Corp. 1986 + * Created by Microsoft Corp. 1986 */ -#include +#define INCL_DOSMISC + +#include +#include main() { - unsigned int EnvSegment; /* Segment handle to the env strings */ - unsigned int CmdOffset; /* Offset within EnvSegment where the - command line arguments can be found */ - char *arg; /* Pointer to data */ + USHORT EnvSegment; /* Segment handle to the env strings */ + USHORT CmdOffset; /* Offset within EnvSegment where the + command line arguments can be found */ + char *arg; /* Pointer to data */ - DOSGETENV(&EnvSegment,&CmdOffset); /* Get environment information */ + DosGetEnv(&EnvSegment,&CmdOffset); /* Get environment information */ /* Set arg to point to the environment strings */ arg = (char *)((long)EnvSegment << 16);