Ignore:
Timestamp:
Jul 8, 2001, 5:13:16 AM (24 years ago)
Author:
bird
Message:

Reorganized it a little bit. Finding that the environment isn't updated by Open32/Odin32... GetEnv2 is mostly working I think.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/misc/env.c

    r5086 r6232  
    1 /* $Id: env.c,v 1.5 2001-02-10 11:11:47 bird Exp $
     1/* $Id: env.c,v 1.6 2001-07-08 03:13:16 bird Exp $
    22 *
    33 * Environment access functions
     
    2929#include "macros.h"
    3030#include "env.h"
     31
     32/*******************************************************************************
     33*   Internal Functions                                                         *
     34*******************************************************************************/
     35const char *GetEnv1(BOOL fExecChild);
     36const char *GetEnv2(BOOL fExecChild);
    3137
    3238
     
    116122     *  2), testing will show which one of them are the better.
    117123     */
    118 
    119124    #if 1
     125    return GetEnv1(fExecChild);
     126    #else
     127    const char *pszEnv = GetEnv2(fExecChild);
     128    if (pszEnv == NULL)
     129        pszEnv = GetEnv1(fExecChild);
     130    return pszEnv;
     131    #endif
     132}
     133
     134
     135/**
     136 * Method 1.
     137 */
     138const char *GetEnv1(BOOL fExecChild)
     139{
    120140    PPTDA   pPTDACur;                   /* Pointer to the current (system context) PTDA */
    121141    PPTDA   pPTDA;                      /* PTDA in question. */
     
    162182
    163183    return NULL;
    164 
    165 
    166     #else
    167 
    168 
     184}
     185
     186
     187/**
     188 * Method 2.
     189 */
     190const char *GetEnv2(BOOL fExecChild)
     191{
    169192    struct InfoSegLDT * pLIS;           /* Pointer to local infosegment. */
    170193    PVOID               pv;             /* Address to return. */
     
    194217        kprintf(("GetEnv: VirtToLin2 failed to thunk %04x:0000 to linar address\n", pLIS->LIS_AX));
    195218    }
     219
    196220    return (const char *)pv;
    197     #endif
    198 }
     221}
     222
     223
     224
     225
     226/**
     227 * Relase environment block retrieved by GetEnv.
     228 * @param   pszEnv  Pointer to environment block.
     229 */
     230void RelaseEnv(const char *pszEnv)
     231{
     232    #if 0
     233    pszEnv = pszEnv; /* nothing to do! */
     234    #else
     235    pszEnv = pszEnv; /* nothing to do yet! */
     236    #endif
     237}
Note: See TracChangeset for help on using the changeset viewer.