Index: trunk/src/win32k/Makefile
===================================================================
--- trunk/src/win32k/Makefile	(revision 3410)
+++ trunk/src/win32k/Makefile	(revision 3411)
@@ -1,4 +1,4 @@
 ################################################################################
-# $Id: Makefile,v 1.41 2000-04-05 18:40:36 bird Exp $
+# $Id: Makefile,v 1.42 2000-04-17 01:56:47 bird Exp $
 #
 # Win32k makefile.
@@ -120,58 +120,125 @@
     @$(ECHO) compiling 16bit: $<
     @$(CC16) $(CFLAGS16) $(CDEFINES16) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES16) $<
+{dev16}.c.obj:
+    @$(ECHO) compiling 16bit: $<
+    @$(CC16) $(CFLAGS16) $(CDEFINES16) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES16) $<
+
 
 {dev32}.asm{$(WIN32KOBJ)}.obj:
     @$(ECHO) assembling:      $<
     @$(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$@ -Fl:$(WIN32KLIST)\$(*B).lst
+{dev32}.asm.obj:
+    @$(ECHO) assembling:      $<
+    @$(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$(WIN32KOBJ)\$(@F) -Fl:$(WIN32KLIST)\$(*B).lst
+
 {dev32}.c{$(WIN32KOBJ)}.obj:
     @$(ECHO) compiling 32bit: $<
     @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+{dev32}.c.obj:
+    @$(ECHO) compiling 32bit: $<
+    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
+
 {dev32}.cpp{$(WIN32KOBJ)}.obj:
     @$(ECHO) compiling 32bit: $<
     @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+{dev32}.cpp.obj:
+    @$(ECHO) compiling 32bit: $<
+    @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
+
 
 {k32}.asm{$(WIN32KOBJ)}.obj:
     @$(ECHO) assembling:      $<
     @$(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$@ -Fl:$(WIN32KLIST)\$(*B).lst
+{k32}.asm.obj:
+    @$(ECHO) assembling:      $<
+    @$(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$(WIN32KOBJ)\$(@F) -Fl:$(WIN32KLIST)\$(*B).lst
+
 {k32}.c{$(WIN32KOBJ)}.obj:
     @$(ECHO) compiling 32bit: $<
     @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+{k32}.c.obj:
+    @$(ECHO) compiling 32bit: $<
+    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
+
 {k32}.cpp{$(WIN32KOBJ)}.obj:
     @$(ECHO) compiling 32bit: $<
     @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+{k32}.cpp.obj:
+    @$(ECHO) compiling 32bit: $<
+    @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
+
 
 {ldr}.asm{$(WIN32KOBJ)}.obj:
     @$(ECHO) assembling:      $<
     @$(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$@ -Fl:$(WIN32KLIST)\$(*B).lst
+{ldr}.asm.obj:
+    @$(ECHO) assembling:      $<
+    @$(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$(WIN32KOBJ)\$(@F) -Fl:$(WIN32KLIST)\$(*B).lst
+
 {ldr}.c{$(WIN32KOBJ)}.obj:
     @$(ECHO) compiling 32bit: $<
     @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+{ldr}.c.obj:
+    @$(ECHO) compiling 32bit: $<
+    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
+
 {ldr}.cpp{$(WIN32KOBJ)}.obj:
     @$(ECHO) compiling 32bit: $<
     @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+{ldr}.cpp.obj:
+    @$(ECHO) compiling 32bit: $<
+    @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
+
 
 {misc}.asm{$(WIN32KOBJ)}.obj:
     @$(ECHO) assembling:      $<
     $(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$@ -Fl:$(WIN32KLIST)\$(*B).lst
+{misc}.asm.obj:
+    @$(ECHO) assembling:      $<
+    $(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$(WIN32KOBJ)\$(@F) -Fl:$(WIN32KLIST)\$(*B).lst
+
 {misc}.c{$(WIN32KOBJ)}.obj:
     @$(ECHO) compiling 32bit: $<
     @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+{misc}.c.obj:
+    @$(ECHO) compiling 32bit: $<
+    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
+
 {misc}.cpp{$(WIN32KOBJ)}.obj:
     @$(ECHO) compiling 32bit: $<
     @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+{misc}.cpp.obj:
+    @$(ECHO) compiling 32bit: $<
+    @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
+
 
 {pe2lx}.c{$(WIN32KOBJ)}.obj 32bit:
     @$(ECHO) compiling: $<
     @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+{pe2lx}.c.obj 32bit:
+    @$(ECHO) compiling: $<
+    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
+
 {pe2lx}.cpp{$(WIN32KOBJ)}.obj:
     @$(ECHO) compiling 32bit: $<
     @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+{pe2lx}.cpp.obj:
+    @$(ECHO) compiling 32bit: $<
+    @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
+
 
 {elf2lx}.c{$(WIN32KOBJ)}.obj 32bit:
     @$(ECHO) compiling: $<
     @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+{elf2lx}.c.obj 32bit:
+    @$(ECHO) compiling: $<
+    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
+
 {elf2lx}.cpp{$(WIN32KOBJ)}.obj:
     @$(ECHO) compiling 32bit: $<
     @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+{elf2lx}.cpp.obj:
+    @$(ECHO) compiling 32bit: $<
+    @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
 
 
Index: trunk/src/win32k/dev16/probkrnl.c
===================================================================
--- trunk/src/win32k/dev16/probkrnl.c	(revision 3410)
+++ trunk/src/win32k/dev16/probkrnl.c	(revision 3411)
@@ -1,3 +1,3 @@
-/* $Id: probkrnl.c,v 1.19 2000-04-05 18:40:38 bird Exp $
+/* $Id: probkrnl.c,v 1.20 2000-04-17 01:56:48 bird Exp $
  *
  * Description:   Autoprobes the os2krnl file and os2krnl[*].sym files.
@@ -102,6 +102,7 @@
     {FALSE, -1, 11, "g_tkExecPgm",          -1,  -1,  -1,  -1, EPT_PROC32},        /* 13 */
     {FALSE, -1, 11, "f_FuStrLenZ",          -1,  -1,  -1,  -1, EPT_PROCIMPORT16},  /* 14 */
-    {FALSE, -1, 10, "f_FuStrLen",           -1,  -1,  -1,  -1, EPT_PROCIMPORT16},  /* 14 */
-    {FALSE, -1,  8, "f_FuBuff",             -1,  -1,  -1,  -1, EPT_PROCIMPORT16}   /* 15 */
+    {FALSE, -1, 10, "f_FuStrLen",           -1,  -1,  -1,  -1, EPT_PROCIMPORT16},  /* 15 */
+    {FALSE, -1,  8, "f_FuBuff",             -1,  -1,  -1,  -1, EPT_PROCIMPORT16},  /* 16 */
+    {FALSE, -1, 16, "_VMObjHandleInfo",     -1,  -1,  -1,  -1, EPT_PROCIMPORT}     /* 17 */
 /*    {FALSE, -1, 11, "",          -1,  -1, -1, EPT_PROCIMPORT16} */ /* 16 */
 };
@@ -983,7 +984,8 @@
     int         i;
     int         n;
-    SEL         GDT;
-    SEL         LDT;
-    PGINFOSEG   pInfoSeg;
+    SEL         selGIS;
+    SEL         selLIS;
+    PGINFOSEG   pGIS;
+    PLINFOSEG   pLIS;
     USHORT      usBootDrive;
 
@@ -1035,12 +1037,13 @@
     /* determin boot drive */
     /*---------------------*/
-    rc = DosGetInfoSeg(&GDT, &LDT);
+    rc = DosGetInfoSeg(&selGIS, &selLIS);
     if (rc != NO_ERROR)
         return rc;
 
-    pInfoSeg  = MAKEPGINFOSEG(GDT);
-    usBootDrive = pInfoSeg->bootdrive;
-    usVerMajor  = pInfoSeg->uchMajorVersion;
-    usVerMinor  = pInfoSeg->uchMinorVersion;
+    pLIS = MAKEPLINFOSEG(selLIS);
+    pGIS = MAKEPGINFOSEG(selGIS);
+    usBootDrive = pGIS->bootdrive;
+    usVerMajor  = pGIS->uchMajorVersion;
+    usVerMinor  = pGIS->uchMinorVersion;
     dprintf(("BootDrive: %d\n", usBootDrive));
 
@@ -1495,5 +1498,5 @@
         int         i;
 
-        printf16("/* $Id: probkrnl.c,v 1.19 2000-04-05 18:40:38 bird Exp $\n"
+        printf16("/* $Id: probkrnl.c,v 1.20 2000-04-17 01:56:48 bird Exp $\n"
                  "*\n"
                  "* Autogenerated kernel symbol database.\n"
Index: trunk/src/win32k/dev32/d32init.c
===================================================================
--- trunk/src/win32k/dev32/d32init.c	(revision 3410)
+++ trunk/src/win32k/dev32/d32init.c	(revision 3411)
@@ -1,3 +1,3 @@
-/* $Id: d32init.c,v 1.17 2000-04-05 18:40:40 bird Exp $
+/* $Id: d32init.c,v 1.18 2000-04-17 01:56:48 bird Exp $
  *
  * d32init.c - 32-bits init routines.
@@ -1046,4 +1046,5 @@
         0,
         0,
+        0,
         0
     };
@@ -1234,5 +1235,5 @@
              * callTab-entry + 8 holds the selector for the object. (These two fields is the 16:32-bit pointer to the variable.)
              * callTab-entry + a holds the 16-bit offset for the variable.
-             * callTab-entry + c holds the selector for the object. (These two fiels is the 16:16-bit pointer to the variable.)
+             * callTab-entry + c holds the selector for the object. (These two fields is the 16:16-bit pointer to the variable.)
              */
             case EPT_VARIMPORT32:
@@ -1369,4 +1370,9 @@
         0x2d, 0xa8, 0x0a, 0x00, 0x00, 0x65, 0x67, 0xff,
         0xb5, 0xb4, 0x1f, 0x00, 0x00, 0x65, 0x67, 0x66
+    };
+    char achf_VMObjHandleInfo[] =  {
+        0x55, 0x8B, 0x0D, 0x9C, 0xBF, 0x0D, 0x00, 0x8B,
+        0xEC, 0x83, 0xEC, 0x0C, 0x53, 0x57, 0x8D, 0x55,
+        0xF8
     };
 
@@ -1391,4 +1397,5 @@
         achf_FuStrLen          ,
         achf_FuBuff            ,
+        achf_VMObjHandleInfo   ,
         NULL
     };
@@ -1400,5 +1407,5 @@
         unsigned cb;
         printf("Proc.no.%i\n", i);
-        if (i < 14 )
+        if (i < 14 || i > 16)
             cb = interpretFunctionProlog32(aProcs[i], i < 5 || i == 13);
         else
Index: trunk/src/win32k/include/OS2KVM.h
===================================================================
--- trunk/src/win32k/include/OS2KVM.h	(revision 3410)
+++ trunk/src/win32k/include/OS2KVM.h	(revision 3411)
@@ -1,3 +1,3 @@
-/* $Id: OS2KVM.h,v 1.3 2000-02-18 19:27:29 bird Exp $
+/* $Id: OS2KVM.h,v 1.4 2000-04-17 01:56:49 bird Exp $
  *
  * OS/2 kernel VM functions.
@@ -103,5 +103,8 @@
     PVMAC   pvmac);
 
-
+APIRET KRNLCALL VMObjHandleInfo(
+    USHORT  usHob,
+    PULONG  pulAddr,
+    PUSHORT pushPTDA);
 
 #endif
Index: trunk/src/win32k/include/env.h
===================================================================
--- trunk/src/win32k/include/env.h	(revision 3411)
+++ trunk/src/win32k/include/env.h	(revision 3411)
@@ -0,0 +1,29 @@
+/* $Id: env.h,v 1.1 2000-04-17 01:56:49 bird Exp $
+ *
+ * Enviroment access functions
+ *
+ * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
+#ifndef _env_h_
+#define _env_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/*******************************************************************************
+*   Prototypes                                                                 *
+*******************************************************************************/
+const char *ScanEnv(const char *paszEnv, const char *pszVar);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
Index: trunk/src/win32k/include/probkrnl.h
===================================================================
--- trunk/src/win32k/include/probkrnl.h	(revision 3410)
+++ trunk/src/win32k/include/probkrnl.h	(revision 3411)
@@ -1,3 +1,3 @@
-/* $Id: probkrnl.h,v 1.12 2000-04-05 18:40:42 bird Exp $
+/* $Id: probkrnl.h,v 1.13 2000-04-17 01:56:49 bird Exp $
  *
  * Include file for ProbKrnl.
@@ -16,7 +16,7 @@
 *   Defined Constants And Macros                                               *
 *******************************************************************************/
-#define NBR_OF_KRNLIMPORTS      17      /* When this is changed make sure to   */
+#define NBR_OF_KRNLIMPORTS      18      /* When this is changed make sure to   */
                                         /* update the arrays in d32init.c and  */
-                                        /* probkrnl32.c */
+                                        /* probkrnl.c */
 #define MAX_LENGTH_NAME         32      /* Max length for the function. */
 
Index: trunk/src/win32k/include/ptda.h
===================================================================
--- trunk/src/win32k/include/ptda.h	(revision 3411)
+++ trunk/src/win32k/include/ptda.h	(revision 3411)
@@ -0,0 +1,16 @@
+/* $Id: ptda.h,v 1.1 2000-04-17 01:56:49 bird Exp $
+ *
+ * PTDA access functions.
+ *
+ * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+#ifndef _ptda_h_
+#define _ptda_h_
+
+
+
+
+#endif
Index: trunk/src/win32k/ldr/calltab.asm
===================================================================
--- trunk/src/win32k/ldr/calltab.asm	(revision 3410)
+++ trunk/src/win32k/ldr/calltab.asm	(revision 3411)
@@ -1,3 +1,3 @@
-; $Id: calltab.asm,v 1.11 2000-02-21 14:53:39 bird Exp $
+; $Id: calltab.asm,v 1.12 2000-04-17 01:56:49 bird Exp $
 ;
 ; callTab - Call back again table - table with entry for each function which is overrided.
@@ -127,4 +127,8 @@
 _f_FuBuff ENDP
 
+_VMObjHandleInfo@12 PROC NEAR
+    db MAXSIZE_PROLOG dup(0cch)
+_VMObjHandleInfo@12 ENDP
+
 CALLTAB ENDS
 
Index: trunk/src/win32k/misc/env.c
===================================================================
--- trunk/src/win32k/misc/env.c	(revision 3411)
+++ trunk/src/win32k/misc/env.c	(revision 3411)
@@ -0,0 +1,165 @@
+/* $Id: env.c,v 1.1 2000-04-17 01:56:50 bird Exp $
+ *
+ * Enviroment access functions
+ *
+ * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
+
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
+#include <os2.h>
+#include "dev32.h"
+#include "dev32hlp.h"
+#include <string.h>
+
+#include "env.h"
+#include <infoseg.h>                    /* Infosegments definitions. */
+
+
+/**
+ * Scans the given environment data for a given enviroment variable and returns
+ * its value if found.
+ * @returns   Pointer to environment variable value for the variable given in
+ *            pszVar.
+ *            If the variable wasn't found NULL is returned.
+ * @param     paszEnv   Pointer to the environment data to search.
+ *                      The environment data is a list of zero-strings terminated
+ *                      by an empty string. The strings are paired, that means
+ *                      that the first string is the variable name and the
+ *                      following string is the value of the variable.
+ *                      AFAIK a variable can't have an empty value string!
+ * @param     pszVar    Name of the environment variable to find.
+ */
+const char *ScanEnv(const char *paszEnv, const char *pszVar)
+{
+    /*
+     * Loop thru the environment data until an empty string is reached.
+     */
+    while (*paszEnv != '\0')
+    {
+        register int i;                 /* Variable use to store the compare result. */
+
+        /*
+         * Variable name.
+         * Check if it's matching the name we're searching for and skip the variable name.
+         */
+        i = stricmp(paszEnv, pszVar);
+        paszEnv += strlen(paszEnv) + 1;
+        if (i == 0)
+        {   /* Variable was found. Return pointer to the value. */
+            return paszEnv;
+        }
+
+        /*
+         * !Paranoia!
+         * If no value string we'll quit. This may be an IPE, if not it might
+         * cause one if we continue processing the environment data.
+         */
+        if (*paszEnv == '\0')
+            break;
+
+        /* Skip value */
+        paszEnv += strlen(paszEnv) + 1;
+    }
+
+    return NULL;
+}
+
+
+/**
+ * Get the linear pointer to the environment data.
+ * @returns   Pointer to environment data.
+ *            NULL on failure.
+ */
+const char *GetEnv()
+{
+    /*  There is probably two ways of getting the environment data for a the
+     *  current process: 1) get it from the PTDA->ptda_environ
+     *                   2) Local infosegment (LIS from GetDosVar devhlp)
+     *  I am not sure which one of these works best. What I know is that
+     *  method 1) is used by the w_GetEnv API worker. This API is called at
+     *  Ring-0 from some delete file operation. (Which uses it to get the
+     *  DELETEDIR environment variable.) The w_GetEnv API worker is 16-bit
+     *  I don't want to thunk around using that. There for I'll implement
+     *  my own GetEnv. So, currently I'll write the code for both 1) and
+     *  2), testing will show which one of them are most handy.
+     */
+
+    #if 0
+    PPTDA   pPTDA;                      /* Current PTDA */
+    PPTDA   pPTDAExecChild;             /* Current PTDAs pPTDAExecChild */
+    USHORT  hobEnviron;                 /* Object handle of the environ block */
+    APIRET  rc;                         /* Return from VMObjHandleInfo. */
+    USHORT  ushPTDA;                    /* Handle of the context PTDA. (VMObjH..) */
+    ULONG   ulAddr = 0;                 /* Address of the environment data.  */
+
+    /*
+     *  Use PTDA (1):
+     *  Get the current PTDA. (Fail if this call failes.)
+     *  IF pPTDAExecChild isn't NULL THEN try get environment for that first.
+     *  IF failed or no pPTDAExecChild THEN try get enviroment from pPTDA.
+     */
+    pPTDA = ptdaGetCur();
+    if (pPTDA == NULL)
+    {
+        kprintf(("GetEnv: Failed to get current PTDA.\n"));
+    }
+    pPTDAExecChild = ptdaGetpPTDAExecChild(pPTDA);
+    if (pPTDAExecChild != NULL)
+    {
+        hobEnviron = ptdaGetptda_environ(pPTDAExecChild);
+        if (hobEnviron != 0)
+        {
+            rc = VMObjHandleInfo(hobEnviron, &ulAddr, &ushPTDA);
+            if (rc != NO_ERROR)
+                ulAddr = 0;
+        }
+    }
+
+    if (ulAddr == 0) /* failed or non pPTDAExecChild */
+    {
+        hobEnviron = ptdaGetptda_environ(pPTDA);
+        if (hobEnviron != 0)
+        {
+            rc = VMObjHandleInfo(hobEnviron, &ulAddr, &ushPTDA);
+            if (rc != NO_ERROR)
+                ulAddr = 0;
+        }
+    }
+
+    return (const char *)ulAddr;
+    #else
+    struct InfoSegLDT * pLIS;           /* Pointer to local infosegment. */
+    PVOID               pv;             /* Address to return. */
+
+
+    /*
+     *  Use LocalInfoSegment (2)
+     *  Get the LIS using Dh32_GetDosVar
+     */
+    pLIS = (struct InfoSegLDT*)D32Hlp_GetDOSVar(DHGETDOSV_LOCINFOSEG, 0);
+    if (pLIS == NULL)
+    {
+        kprintf(("GetEnv: Failed to get local info segment\n"));
+        return NULL
+    }
+
+    if (pLIS->LIS_AX <= 3)
+    {
+        kprintf(("GetEnv: enviroment selector is %d, ie. NULL\n", pLIS->LIS_AX));
+        return NULL;
+    }
+
+    pv = D32Hlp_VirtToLin2(pLIS->LIS_AX, 0);
+    if (pv != NULL)
+    {
+        kprintf(("GetEnv: VirtToLin2 failed to thunk %04x:0000 to linar address\n", pLIS->LIS_AX));
+    }
+    return (const char *)pv;
+    #endif
+}
Index: trunk/src/win32k/misc/ptda.c
===================================================================
--- trunk/src/win32k/misc/ptda.c	(revision 3411)
+++ trunk/src/win32k/misc/ptda.c	(revision 3411)
@@ -0,0 +1,19 @@
+/* $Id: ptda.c,v 1.1 2000-04-17 01:56:50 bird Exp $
+ *
+ * PTDA access functions.
+ *
+ * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
+
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
+#include <os2.h>
+#include "ptda.h"
+
+
+
