Changeset 6296 for trunk/src/win32k/k32/k32SetEnvironment.cpp
- Timestamp:
- Jul 10, 2001, 6:41:10 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/k32/k32SetEnvironment.cpp
r6214 r6296 1 /* $Id: k32SetEnvironment.cpp,v 1. 1 2001-07-08 02:52:11bird Exp $1 /* $Id: k32SetEnvironment.cpp,v 1.2 2001-07-10 16:39:17 bird Exp $ 2 2 * 3 3 * k32SetEnvironment - Sets the Odin32 environment for a process. … … 15 15 #define INCL_DOSERRORS 16 16 #define INCL_OS2KRNL_TK 17 #define INCL_OS2KRNL_PTDA 17 18 #define INCL_OS2KRNL_SEM 18 19 #define INCL_OS2KRNL_LDR … … 24 25 *******************************************************************************/ 25 26 #include <os2.h> 27 #include <memory.h> 26 28 #include "devSegDf.h" /* Win32k segment definitions. */ 27 29 #include "OS2Krnl.h" … … 56 58 PPTD pptd; 57 59 58 59 60 /* 60 61 * Validate pid a little bit... … … 63 64 { 64 65 kprintf(("k32SetEnvironment: invalid pid=%x\n", pid)); 66 return ERROR_INVALID_PARAMETER; 67 } 68 69 if (pid != 0) 70 { 71 kprintf(("k32SetEnvironment: currently only supported for current pid. pid=%x\n", pid)); 65 72 return ERROR_INVALID_PARAMETER; 66 73 } … … 81 88 * Get Per Task Data and try set next environment pointer. 82 89 */ 83 pptd = GetTaskData(p id);90 pptd = GetTaskData(ptdaGetCur(), TRUE); 84 91 if (pptd) 85 92 { 86 if (pptd->cUsage != 0 && pptd->pszzOdin32Env) 93 if (*(PULONG)&pptd->lockOdin32Env) 94 { 87 95 D32Hlp_VMUnLock(&pptd->lockOdin32Env); 96 memset(&pptd->lockOdin32Env, 0, sizeof(pptd->lockOdin32Env)); 97 } 88 98 pptd->pszzOdin32Env = NULL; 89 99 if (pptd->cUsage != 0 && pszzEnvironment != NULL && cchEnvironment != 0) 90 100 { 91 /*92 * Currently we're limited to the current process.93 */94 if (pid != 0 || GetTaskData(0) != pptd)95 {96 kprintf(("k32SetEnvironment: not current process (pid=%d)\n", pid));97 LDRClearSem();98 return ERROR_INVALID_PARAMETER;99 }100 101 102 101 /* 103 102 * Lock the memory (so we don't block or trap during environment searchs). … … 110 109 { 111 110 kprintf(("k32SetEnvironment: VMLock2 failed with rc=%d\n", rc)); 111 memset(&pptd->lockOdin32Env, 0, sizeof(pptd->lockOdin32Env)); 112 112 } 113 113 }
Note:
See TracChangeset
for help on using the changeset viewer.