Changeset 6296 for trunk/src/win32k/misc/PerTaskW32kData.c
- Timestamp:
- Jul 10, 2001, 6:41:10 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/misc/PerTaskW32kData.c
r6230 r6296 1 /* $Id: PerTaskW32kData.c,v 1. 1 2001-07-08 03:09:03bird Exp $1 /* $Id: PerTaskW32kData.c,v 1.2 2001-07-10 16:39:19 bird Exp $ 2 2 * 3 3 * Per Task (Win32k) Data. … … 17 17 #define INCL_OS2KRNL_VM /* OS2KRNL: Virtual Memory Management */ 18 18 #define INCL_OS2KRNL_TK /* OS2KRNL: Task Stuff */ 19 #define INCL_OS2KRNL_PTDA 19 20 20 21 /******************************************************************************* … … 52 53 * If it doesn't exist we'll allocate a new one. 53 54 * @returns Pointer to task data structure. 54 * @param pid Process id. 0 means current pid. 55 * Might be NULL (see fCreate). 56 * @param pPTDA Pointer to PTDA for the task. 57 * @param fCreate TRUE: Create structure if not found. 58 * FALSE: Return NULL if not found. 55 59 * @status completely implemented. 56 60 * @author knut st. osmundsen (kosmunds@csc.no) 57 * @remark Do we need a Get function which doesn't make a node if no data was found?58 61 */ 59 PPTD GetTaskData(P ID pid)62 PPTD GetTaskData(PPTDA pPTDA, BOOL fCreate) 60 63 { 61 64 PPTD pptd; 62 if (p id== 0)63 p id = InternalGetPid();64 pptd = (PPTD)(void*)AVLGet(&pPTDTree, pid);65 if (!pptd )65 if (pPTDA == 0) 66 pPTDA = ptdaGetCur(); 67 pptd = (PPTD)(void*)AVLGet(&pPTDTree, (AVLKEY)pPTDA); 68 if (!pptd && fCreate) 66 69 { 67 70 pptd = rmalloc(sizeof(*pptd)); … … 72 75 } 73 76 memset(pptd, 0, sizeof(*pptd)); 74 pptd->core.Key = pid;77 pptd->core.Key = (AVLKEY)pPTDA; 75 78 AVLInsert(&pPTDTree, &pptd->core); 76 79 } … … 81 84 /** 82 85 * Remove the give process id. 83 * @param p id Process id to remove. 0 means current pid.86 * @param pPTDA Pointer to PTDA for the task. 84 87 * @status completely implemented. 85 88 * @author knut st. osmundsen (kosmunds@csc.no) 86 89 */ 87 void RemoveTaskData(P ID pid)90 void RemoveTaskData(PPTDA pPTDA) 88 91 { 89 92 PPTD pptd; 90 if (p id== 0)91 p id = InternalGetPid();92 pptd = (PPTD)(void*)AVLRemove(&pPTDTree, pid);93 if (pPTDA == 0) 94 pPTDA = ptdaGetCur(); 95 pptd = (PPTD)(void*)AVLRemove(&pPTDTree, (AVLKEY)pPTDA); 93 96 if (pptd) 94 97 { 95 98 /* perhaps free data here... */ 99 if (*(PULONG)(void*)&pptd->lockOdin32Env) 100 { 101 D32Hlp_VMUnLock(&pptd->lockOdin32Env); 102 memset(&pptd->lockOdin32Env, 0, sizeof(pptd->lockOdin32Env)); 103 } 104 pptd->pszzOdin32Env = NULL; 96 105 rfree(pptd); 97 106 }
Note:
See TracChangeset
for help on using the changeset viewer.