- Timestamp:
- Aug 22, 2000, 5:00:22 AM (25 years ago)
- Location:
- branches
- Files:
-
- 13 edited
-
GRACE/src/win32k/Makefile (modified) (2 diffs)
-
GRACE/src/win32k/dev16/probkrnl.c (modified) (3 diffs)
-
GRACE/src/win32k/include/LdrCalls.h (modified) (3 diffs)
-
GRACE/src/win32k/include/OS2KSEM.h (modified) (6 diffs)
-
GRACE/src/win32k/include/ldr.h (modified) (2 diffs)
-
GRACE/src/win32k/include/pe2lx.h (modified) (2 diffs)
-
GRACE/src/win32k/include/probkrnl.h (modified) (2 diffs)
-
GRACE/src/win32k/ldr/ldr.cpp (modified) (4 diffs)
-
GRACE/src/win32k/ldr/myldrOpen.cpp (modified) (3 diffs)
-
GRACE/src/win32k/pe2lx/pe2lx.cpp (modified) (4 diffs)
-
GRACE/src/win32k/win32k.vpj (modified) (3 diffs)
-
Grace/src/win32k/ldr/mytkExecPgm.asm (modified) (7 diffs)
-
Grace/src/win32k/ldr/mytkStartProcess.asm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/GRACE/src/win32k/Makefile
r4017 r4068 1 1 ################################################################################ 2 # $Id: Makefile,v 1.43.4. 4 2000-08-15 06:15:55bird Exp $2 # $Id: Makefile,v 1.43.4.5 2000-08-22 03:00:16 bird Exp $ 3 3 # 4 4 # Win32k makefile. … … 343 343 $(WIN32KOBJ)\d32Win32kIOCtl.obj \ 344 344 $(WIN32KOBJ)\k32AllocMemEx.obj \ 345 $(WIN32KOBJ)\mytkExecPgm.obj 345 $(WIN32KOBJ)\mytkExecPgm.obj\ 346 $(WIN32KOBJ)\mytkStartProcess.obj 346 347 347 348 -
branches/GRACE/src/win32k/dev16/probkrnl.c
r4065 r4068 1 /* $Id: probkrnl.c,v 1.20.4. 8 2000-08-21 22:59:34bird Exp $1 /* $Id: probkrnl.c,v 1.20.4.9 2000-08-22 03:00:16 bird Exp $ 2 2 * 3 3 * Description: Autoprobes the os2krnl file and os2krnl[*].sym files. … … 103 103 {FALSE, -1, 11, "_VMGetOwner", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 12 */ 104 104 {FALSE, -1, 11, "g_tkExecPgm", -1, -1, -1, -1, EPT_PROC32}, /* 13 */ 105 {FALSE, -1, 11, "f_FuStrLenZ", -1, -1, -1, -1, EPT_PROCIMPORT16}, /* 14 */ 106 {FALSE, -1, 10, "f_FuStrLen", -1, -1, -1, -1, EPT_PROCIMPORT16}, /* 15 */ 107 {FALSE, -1, 8, "f_FuBuff", -1, -1, -1, -1, EPT_PROCIMPORT16}, /* 16 */ 108 {FALSE, -1, 16, "_VMObjHandleInfo", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 17 */ 109 {FALSE, -1, 18, "_VMPseudoHandleMap", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 18 */ 110 {FALSE, -1, 12, "_ldrOpenPath", -1, -1, -1, -1, EPT_PROC32}, /* 19 */ 111 {FALSE, -1, 12, "_LDRClearSem", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 20 */ 112 {FALSE, -1, 14, "_ldrFindModule", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 21 */ 113 {FALSE, -1, 17, "_KSEMRequestMutex", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 22 */ 114 {FALSE, -1, 17, "_KSEMReleaseMutex", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 23 */ 115 {FALSE, -1, 7, "_LdrSem", -1, -1, -1, -1, EPT_VARIMPORT32}, /* 24 */ 116 {FALSE, -1, 11, "_LDRLibPath", -1, -1, -1, -1, EPT_VARIMPORT32}, /* 25 */ 117 {FALSE, -1, 9, "_TKSuBuff", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 26 */ 118 {FALSE, -1, 9, "_TKFuBuff", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 27 */ 119 {FALSE, -1, 11, "_TKFuBufLen", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 28 */ 120 {FALSE, -1, 21, "_ldrValidateMteHandle",-1, -1, -1, -1, EPT_PROCIMPORT32}, /* 29 */ 121 {FALSE, -1, 8, "_pTCBCur", -1, -1, -1, -1, EPT_VARIMPORT16}, /* 30 */ 122 {FALSE, -1, 9, "_pPTDACur", -1, -1, -1, -1, EPT_VARIMPORT16}, /* 31 */ 123 {FALSE, -1, 10, "ptda_start", -1, -1, -1, -1, EPT_VARIMPORT16}, /* 32 */ 124 {FALSE, -1, 12, "ptda_environ", -1, -1, -1, -1, EPT_VARIMPORT16}, /* 33 */ 125 {FALSE, -1, 11, "ptda_module", -1, -1, -1, -1, EPT_VARIMPORT16}, /* 34 */ 126 {FALSE, -1, 18, "ptda_pBeginLIBPATH", -1, -1, -1, -1, EPT_VARIMPORT16}, /* 35 */ 127 {FALSE, -1, 16, "_ldrpFileNameBuf", -1, -1, -1, -1, EPT_VARIMPORT32}, /* 36 */ 105 {FALSE, -1, 16, "g_tkStartProcess", -1, -1, -1, -1, EPT_PROC32}, /* 14 */ 106 {FALSE, -1, 11, "f_FuStrLenZ", -1, -1, -1, -1, EPT_PROCIMPORT16}, /* 15 */ 107 {FALSE, -1, 10, "f_FuStrLen", -1, -1, -1, -1, EPT_PROCIMPORT16}, /* 16 */ 108 {FALSE, -1, 8, "f_FuBuff", -1, -1, -1, -1, EPT_PROCIMPORT16}, /* 17 */ 109 {FALSE, -1, 16, "_VMObjHandleInfo", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 18 */ 110 {FALSE, -1, 18, "_VMPseudoHandleMap", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 19 */ 111 {FALSE, -1, 12, "_ldrOpenPath", -1, -1, -1, -1, EPT_PROC32}, /* 20 */ 112 {FALSE, -1, 12, "_LDRClearSem", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 21 */ 113 {FALSE, -1, 14, "_ldrFindModule", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 22 */ 114 {FALSE, -1, 17, "_KSEMRequestMutex", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 23 */ 115 {FALSE, -1, 17, "_KSEMReleaseMutex", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 24 */ 116 {FALSE, -1, 15, "_KSEMQueryMutex", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 25 */ 117 {FALSE, -1, 9, "_KSEMInit", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 26 */ 118 {FALSE, -1, 7, "_LdrSem", -1, -1, -1, -1, EPT_VARIMPORT32}, /* 27 */ 119 {FALSE, -1, 11, "_LDRLibPath", -1, -1, -1, -1, EPT_VARIMPORT32}, /* 28 */ 120 {FALSE, -1, 9, "_TKSuBuff", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 29 */ 121 {FALSE, -1, 9, "_TKFuBuff", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 30 */ 122 {FALSE, -1, 11, "_TKFuBufLen", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 31 */ 123 {FALSE, -1, 21, "_ldrValidateMteHandle",-1, -1, -1, -1, EPT_PROCIMPORT32}, /* 32 */ 124 {FALSE, -1, 8, "_pTCBCur", -1, -1, -1, -1, EPT_VARIMPORT16}, /* 33 */ 125 {FALSE, -1, 9, "_pPTDACur", -1, -1, -1, -1, EPT_VARIMPORT16}, /* 34 */ 126 {FALSE, -1, 10, "ptda_start", -1, -1, -1, -1, EPT_VARIMPORT16}, /* 35 */ 127 {FALSE, -1, 12, "ptda_environ", -1, -1, -1, -1, EPT_VARIMPORT16}, /* 36 */ 128 {FALSE, -1, 11, "ptda_module", -1, -1, -1, -1, EPT_VARIMPORT16}, /* 37 */ 129 {FALSE, -1, 18, "ptda_pBeginLIBPATH", -1, -1, -1, -1, EPT_VARIMPORT16}, /* 38 */ 130 {FALSE, -1, 16, "_ldrpFileNameBuf", -1, -1, -1, -1, EPT_VARIMPORT32}, /* 39 */ 128 131 129 132 }; … … 1667 1670 int i; 1668 1671 1669 printf16("/* $Id: probkrnl.c,v 1.20.4. 8 2000-08-21 22:59:34bird Exp $\n"1672 printf16("/* $Id: probkrnl.c,v 1.20.4.9 2000-08-22 03:00:16 bird Exp $\n" 1670 1673 "*\n" 1671 1674 "* Autogenerated kernel symbol database.\n" -
branches/GRACE/src/win32k/include/LdrCalls.h
r4065 r4068 1 /* $Id: LdrCalls.h,v 1.3.4. 5 2000-08-21 22:59:38bird Exp $1 /* $Id: LdrCalls.h,v 1.3.4.6 2000-08-22 03:00:19 bird Exp $ 2 2 * 3 3 * Prototypes for the loader overrided function. … … 192 192 * OS2 errorcode on failure. (ERROR_INTERRUPT?) 193 193 */ 194 #define LDRRequestSem() KSEMRequestMutex( (HKMTX)pLdrSem, (ULONG)-1)194 #define LDRRequestSem() KSEMRequestMutex(pLdrSem, (ULONG)-1) 195 195 196 196 … … 199 199 */ 200 200 #ifdef _OS2KSEM_h_ 201 extern HKMTX *pLdrSem;201 extern PKSEMMTX pLdrSem; 202 202 #endif 203 203 -
branches/GRACE/src/win32k/include/OS2KSEM.h
r3829 r4068 1 /* $Id: OS2KSEM.h,v 1.1 2000-07-16 22:21:19bird Exp $1 /* $Id: OS2KSEM.h,v 1.1.2.1 2000-08-22 03:00:18 bird Exp $ 2 2 * 3 3 * OS/2 kernel Semaphore functions. … … 16 16 * Defined Constants And Macros * 17 17 *******************************************************************************/ 18 #define KSEM_INDEFINITE_WAIT -1L 19 #define KSEM_IMMEDIATE_RETURN 0L 18 #define KSEM_INDEFINITE_WAIT -1L 19 #define KSEM_IMMEDIATE_RETURN 0L 20 21 /* 22 * Semaphore type. ( Used with the generic KSEM routines. ) 23 */ 24 #define KSEM_EVENT 0 25 #define KSEM_MUTEX 1 26 #define KSEM_SHARED 2 27 28 /* 29 * Sempahore flags. (according to SG24-4640-00) 30 */ 31 #define KSEM_DEFAULT 0 32 #define KSEM_NOINTERRUPT 1 33 #define KSEM_WRITE 2 34 #define KSEM_DISPLAYID 4 35 #define KSEM_NOBLOCKED 8 20 36 21 37 … … 23 39 * Structures and Typedefs * 24 40 *******************************************************************************/ 25 typedef ULONG HKSEM; /* Handle to kernel semaphore. */ 26 typedef HKSEM PHKSEM; /* Pointer to kernel semaphore handle. */ 27 typedef HKSEM HKMTX; /* Handle to kernel mutex semaphore. */ 28 typedef HKSEM HKEV; /* Handle to kernel event semaphore. */ 41 /* (This is according to SG24-4640-00.) */ 42 43 typedef struct _KSEMSHR 44 { 45 /** 46 * Astrict 16 is byte while retail 12 is bytes. 47 * We'll reserve 20 bytes just to be sure!. 48 */ 49 char achDummy[20]; 50 } KSEMSHR, 51 *PKSEMSHR, 52 *HKSEMSHR; /* Handle to kernel shared semphore. */ 53 typedef HKSEMSHR * PHKSEMSHR; 54 55 56 typedef struct _KSEMMTX 57 { 58 /** 59 * Astrict is 12 byte while retail is 8 bytes. 60 * We'll reserve 20 bytes just to be sure! 61 */ 62 char achDummy[20]; 63 } KSEMMTX, 64 *PKSEMMTX, 65 *HKSEMMTX; /* Handle to kernel mutex semaphore. */ 66 typedef HKSEMMTX * PHKSEMMTX; 67 68 69 typedef struct _KSEMEVT 70 { 71 /** 72 * Astrict is 16 byte while retail is 12 bytes. 73 * We'll reserve 20 bytes just to be sure! 74 */ 75 char achDummy[20]; 76 } KSEMEVT, 77 *PKSEMEVT, 78 *HKSEMEVT; /* Handle to kernel event sempahore. */ 79 typedef HKSEMEVT * PHKSEMEVT; 80 81 82 typedef union _KSEM 83 { 84 KSEMSHR shr; 85 KSEMMTX mtx; 86 KSEMEVT evt; 87 } KSEM, *PKSEM, *HKSEM; /* Generic kernel semaphore handle. */ 88 typedef HKSEM * PHKSEM; 29 89 30 90 … … 34 94 /* 35 95 * Mutex semaphores. 36 * NOTE! Only is KSEMRequestMutex currently is imported!37 96 */ 38 extern ULONG KRNLCALL KSEMRequestMutex(HK MTX hkmtx, ULONG ulTimeout);39 extern VOID KRNLCALL KSEMReleaseMutex(HK MTX hkmtx);40 extern ULONG KRNLCALL KSEMQueryMutex(HK MTX hkmtx, PUSHORT pus);97 extern ULONG KRNLCALL KSEMRequestMutex(HKSEMMTX hkmtx, ULONG ulTimeout); 98 extern VOID KRNLCALL KSEMReleaseMutex(HKSEMMTX hkmtx); 99 extern ULONG KRNLCALL KSEMQueryMutex(HKSEMMTX hkmtx, PUSHORT pcusNest); 41 100 42 101 … … 48 107 extern VOID KRNLCALL KSEMPostEvent(HKEV hkevent); 49 108 extern ULONG KRNLCALL KSEMWaitEvent(HKEV hkevent); 109 #endif 50 110 51 111 /* 52 112 * Some other KSEM prefixed functions - parameters's not that obvious... 53 113 */ 114 #if 0 54 115 extern ULONG KRNLCALL KSEMAlloc(PHKSEM phksem, ULONG p1, ULONG p2); 55 116 extern ULONG KRNLCALL KSEMCreate(PHKSEM phksem, ULONG type); … … 57 118 extern ULONG KRNLCALL KSEMRequestShared(HKSEM hksem, ULONG); 58 119 extern VOID KRNLCALL KSEMDestroy(HKSEM hksem); 59 extern VOID KRNLCALL KSEMInit(HKSEM hksem, ULONG p1, ULONG p2); 120 #endif 121 extern VOID KRNLCALL KSEMInit(PKSEM pksem, ULONG fulType, ULONG fulFlags); 122 #if 0 60 123 extern VOID KRNLCALL KSEMQuery(HKSEM hksem, ULONG p2) 61 124 extern VOID KRNLCALL KSEMRelease(HKSEM hksem); -
branches/GRACE/src/win32k/include/ldr.h
r4065 r4068 1 /* $Id: ldr.h,v 1.5.4. 4 2000-08-21 22:59:38bird Exp $1 /* $Id: ldr.h,v 1.5.4.5 2000-08-22 03:00:19 bird Exp $ 2 2 * 3 3 * ldr - Our loader "subsystem" public header file. … … 217 217 #define CCHFILENAME 261 /* This is defined in mytkExecPgm.asm too. */ 218 218 #define CCHARGUMENTS 1536 /* This is defined in mytkExecPgm.asm too. */ 219 extern char fLdrSemTaken;220 219 extern const char fTkExecPgm; 221 220 extern char achTkExecPgmFilename[CCHFILENAME]; -
branches/GRACE/src/win32k/include/pe2lx.h
r4065 r4068 1 /* $Id: pe2lx.h,v 1.9.4. 3 2000-08-21 22:59:38bird Exp $1 /* $Id: pe2lx.h,v 1.9.4.4 2000-08-22 03:00:19 bird Exp $ 2 2 * 3 3 * Pe2Lx class declarations. Ring 0 and Ring 3 … … 75 75 BOOL isExe(); 76 76 BOOL isDll(); 77 static HMTEgetKernel32SFN() { return sfnKernel32; }77 static SFN getKernel32SFN() { return sfnKernel32; } 78 78 static VOID setKernel32SFN(SFN sfn) { sfnKernel32 = sfn; } 79 79 static VOID invalidateOdin32Path(); -
branches/GRACE/src/win32k/include/probkrnl.h
r4065 r4068 1 /* $Id: probkrnl.h,v 1.13.4. 6 2000-08-21 22:59:39bird Exp $1 /* $Id: probkrnl.h,v 1.13.4.7 2000-08-22 03:00:20 bird Exp $ 2 2 * 3 3 * Include file for ProbKrnl. … … 16 16 * Defined Constants And Macros * 17 17 *******************************************************************************/ 18 #define NBR_OF_KRNLIMPORTS 37/* When this is changed make sure to */18 #define NBR_OF_KRNLIMPORTS 40 /* When this is changed make sure to */ 19 19 /* update the arrays in d32init.c and */ 20 20 /* probkrnl.c */ -
branches/GRACE/src/win32k/ldr/ldr.cpp
r4065 r4068 1 /* $Id: ldr.cpp,v 1.7.4. 2 2000-08-21 22:59:39bird Exp $1 /* $Id: ldr.cpp,v 1.7.4.3 2000-08-22 03:00:20 bird Exp $ 2 2 * 3 3 * ldr.cpp - Loader helpers. … … 14 14 #define INCL_DOSERRORS 15 15 #define INCL_NOPMAPI 16 16 #define INCL_OS2KRNL_SEM 17 17 18 18 /******************************************************************************* … … 238 238 } 239 239 240 /*241 * Increment the object counters.242 */243 switch (fFlags & MOD_TYPE_MASK)244 {245 case MOD_TYPE_PE2LX: Pe2Lx::cLoadedModules++;246 #ifdef DEBUG247 /*case MOD_TYPE_ELF2LX: Elf2Lx::cElf2Lx++;*/248 default:249 kprintf(("addModule: fFlags don't have any MOD_TYPE_* (%x).\n", fFlags));250 #endif251 }252 253 240 return NO_ERROR; 254 241 } … … 290 277 case MOD_TYPE_PE2LX: 291 278 delete pMod->Data.pPe2Lx; 292 Pe2Lx::cLoadedModules--;293 279 break; 294 280 /* 295 281 case MOD_TYPE_ELF2LX: 296 Elf2Lx::cLoadedModules--;297 282 break; 298 283 */ -
branches/GRACE/src/win32k/ldr/myldrOpen.cpp
r4046 r4068 1 /* $Id: myldrOpen.cpp,v 1.10.4. 4 2000-08-19 14:37:15bird Exp $1 /* $Id: myldrOpen.cpp,v 1.10.4.5 2000-08-22 03:00:21 bird Exp $ 2 2 * 3 3 * myldrOpen - ldrOpen. … … 116 116 { 117 117 kprintf(("myldrOpen-%d: rmalloc(640) failed\n", cNesting)); 118 goto semcleanup;118 goto ret; 119 119 } 120 120 … … 640 640 #endif 641 641 642 semcleanup: 643 /* 644 * We have to clean the smaphore which was taken by mytkExecPgm here 645 * because we might not return before the new child is finsished 646 * executing. 647 * It is not risk in releasing the semphore here since it's taken 648 * three times now. First by tkExecPgm then by LDROpenExe. 649 */ 650 if (isLdrStateExecPgm() && fLdrSemTaken) 651 { 652 KSEMReleaseMutex((HKMTX)pLdrSem); 653 fLdrSemTaken = 0; 654 } 655 642 ret: 656 643 /** @sketch 657 644 * Return rc. -
branches/GRACE/src/win32k/pe2lx/pe2lx.cpp
r4065 r4068 1 /* $Id: pe2lx.cpp,v 1.18.4. 5 2000-08-21 22:59:40bird Exp $1 /* $Id: pe2lx.cpp,v 1.18.4.6 2000-08-22 03:00:22 bird Exp $ 2 2 * 3 3 * Pe2Lx class implementation. Ring 0 and Ring 3 … … 170 170 {NULL, NULL} /* end-of-list entry */ 171 171 }; 172 173 LONG Pe2Lx::cLoadedModules; /* Count of existing objects. Updated by constructor and destructor. */ 174 const char * Pe2Lx::pszOdin32Path; /* Odin32 base path (include a slash). */ 175 SFN Pe2Lx::sfnKernel32; /* Odin32 Kernel32 filehandle. */ 172 176 173 177 … … 4692 4696 BOOL Pe2Lx::initOdin32Path() 4693 4697 { 4698 #if 0 4694 4699 APIRET rc; 4695 4700 PMTE pMTE; … … 4754 4759 4755 4760 return rc == NO_ERROR; 4761 #else 4762 return FALSE; 4763 #endif 4756 4764 } 4757 4765 -
branches/GRACE/src/win32k/win32k.vpj
r4065 r4068 1 1 [COMPILER] 2 2 MACRO=odin32_maketagfile();\n 3 FILTEREXPANSION=1 1 1 10 0 0 0 1 0 0 0 0 13 FILTEREXPANSION=1 1 0 0 0 0 0 0 1 0 0 0 0 1 4 4 compile=concur|capture|clear|:Compile:&Compile,nmake %n.obj 5 5 make=concur|capture|clear|:Build:&Build,nmake … … 102 102 ldr\myldrRead.cpp 103 103 ldr\mytkExecPgm.asm 104 ldr\mytkStartProcess.asm 104 105 ldr\myVMAllocMem.cpp 105 106 lib\libDosAllocMemEx.c … … 143 144 test\init.asm 144 145 test\win32ktst.c 146 [ASSOCIATION] 147 [STATE] 148 SCREEN: 1600 1200 176 176 1244 800 0 0 M 0 0 0 0 1275 898 149 CWD: H:\CODING\WORK\ODIN32\src\win32k 150 BUFFER: BN="F:\VSLICK40\OS2\vrestore.slk" 151 BI: MA=1 254 1 TABS=1 9 WWS=3 IWT=0 ST=0 IN=0 BW=0 US=0 RO=0 SE=0 SN=0 BIN=0 MN=Fundamental HM=0 MF=1 152 VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=5 BI=22 HT=0 HN=0 HF=0 HC=4 153 BUFFER: BN="H:\coding\work\odin32\src\win32k\libconv.c" 154 BI: MA=1 74 1 TABS=1 5 WWS=1 IWT=0 ST=0 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN=C HM=0 MF=0 155 VIEW: LN=.11148 CL=33 LE=0 CX=32 CY=37 WI=5 BI=17 HT=0 HN=0 HF=0 HC=4 156 BUFFER: BN="H:\CODING\WORK\ODIN32\src\win32k\dev16\probkrnl.c" 157 BI: MA=1 74 1 TABS=1 5 WWS=1 IWT=0 ST=0 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN=C HM=0 MF=0 158 VIEW: LN=.5619 CL=30 LE=0 C CY=1 WI=5 BI=9 HT=0 HN=0 HF=0 HC=4 159 BUFFER: BN="H:\CODING\WORK\ODIN32\src\win32k\test\win32ktst.c" 160 BI: MA=1 74 1 TABS=1 5 WWS=1 IWT=0 ST=0 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN=C HM=0 MF=872 161 VIEW: LN=.6408 CL=13 LE=0 CX=12 CY=38 WI=5 BI=10 HT=0 HN=0 HF=0 HC=4 162 WINDOW: 26 25 967 704 -1 -1 M WF=0 WT=2 "System Monospaced,10,0,1" 163 BUFFER: BN="H:\CODING\WORK\ODIN32\src\win32k\test\win32ktst.c" 164 VIEW: LN=.6119 CL=76 LE=0 CX=75 CY=29 WI=194 BI=10 HT=0 HN=0 HF=0 HC=4 165 FILEHIST: 5 166 F:\VSLICK40\OS2\vrestore.slk 167 H:\coding\work\odin32\src\win32k\libconv.c 168 H:\coding\work\odin32\src\win32k\makefile 169 H:\CODING\WORK\ODIN32\src\win32k\include\test.h 170 H:\CODING\WORK\ODIN32\src\win32k\test\win32ktst.c 171 PRINTER: 2 145 172 173 -
branches/Grace/src/win32k/ldr/mytkExecPgm.asm
r4065 r4068 1 ; $Id: mytkExecPgm.asm,v 1.10.4. 4 2000-08-21 22:59:40bird Exp $1 ; $Id: mytkExecPgm.asm,v 1.10.4.5 2000-08-22 03:00:21 bird Exp $ 2 2 ; 3 3 ; mytkExecPgm - tkExecPgm overload … … 54 54 extrn _TKFuBuff@16:PROC 55 55 56 57 56 ; 58 57 ; LDR semaphore 59 58 ; 60 extrn pLDRSem:DWORD 61 extrn _KSEMRequestMutex@8:PROC 62 extrn _LDRClearSem@0:PROC 59 extrn pLdrSem:DWORD 60 extrn _LDRClearSem@0:PROC 61 extrn _KSEMRequestMutex@8:PROC 62 extrn _KSEMQueryMutex@8:PROC 63 63 64 64 ; … … 77 77 extrn D32Hlp_VirtToLin:PROC 78 78 79 ; 80 ; TKSSBase (32-bit) 81 ; 82 extrn pulTKSSBase32:DWORD 79 83 80 84 ; … … 84 88 public tkExecPgmCopyEnv 85 89 86 public fLdrSemTaken87 90 public fTkExecPgm 88 91 public achTkExecPgmFilename … … 101 104 ; (and you'll have to be behind the loader semaphore of course!) 102 105 DATA16 SEGMENT 103 fLdrSemTaken db 0 ; 0 - Loader Semaphore not taken104 ; 1 - Loader semaphore is taken and will be freed at exit.105 106 fTkExecPgm db 0 ; 0 - achTkExecPgmFilename and achTkExecPgmArguments is INVALID 106 107 ; 1 - achTkExecPgmFilename and achTkExecPgmArguments is VALID. … … 221 222 ASSUME DS:FLAT, ES:FLAT 222 223 223 mov eax, pL DRSem ; Load pointer to pLDRSem224 or eax, eax ; Check NULL pointer.225 j e tkepgm_backout ; BACKOUT on NULL pointer. (paranoia)224 mov eax, pLdrSem ; Get pointer to the loader semaphore. 225 or eax, eax ; Check if null. (paranoia) 226 jz tkepgm_backout ; Fail if null. 226 227 227 228 push 0ffffffffh ; Wait indefinitely. 228 push eax ; LDRSem handle.229 push eax ; Push LdrSem address (which is the handle). 229 230 call near ptr FLAT:_KSEMRequestMutex@8 230 231 or eax, eax ; Check if failed. 231 232 jnz tkepgm_backout ; Backout on failure. 232 mov fLdrSemTaken, 1 ; Marks that the loader semaphore is taken233 233 234 234 … … 328 328 329 329 ; 330 ; Clear loader semaphore .330 ; Clear loader semaphore? 331 331 ; and clear loader state, current exe module and tkExecPgm global data flag. 332 332 ; 333 cmp fLdrSemTaken, 0 ; is the semaphore still taken? 334 je tkepgm_callbehindret ; jmp if not taken. 333 push 0 ; Usage count variable. 334 mov eax, pulTKSSBase32 ; Get TKSSBase 335 mov eax, [eax] 336 add eax, esp ; Added TKSSBase to the usage count pointer 337 push eax ; Push address of usage count pointer. 338 push pLdrSem ; Push pointer to loader semaphore ( = handle). 339 call _KSEMQueryMutex@8 340 or eax, eax ; Check return code. (1 = our / free; 0 = not our but take) 341 je tkepgm_callbehindret ; jmp if not taken by us (FALSE). 342 pop eax ; Pops usage count. 343 or eax, eax ; Check usage count. 344 jz tkepgm_callbehindret ; jmp if 0 (=free). 335 345 mov ulLDRState, 0 ; Clears loaderstate. (LDRSTATE_UNKNOWN) 336 346 mov pExeModule, 0 ; Sets the exemodule pointer to NULL. 337 347 mov fTkExecPgm, 0 ; Marks global data invalid. 338 348 call near ptr FLAT:_LDRClearSem@0 339 mov fLdrSemTaken, 0 ; Loader semaphore is not taken any longer!340 349 341 350 ; -
branches/Grace/src/win32k/ldr/mytkStartProcess.asm
r4065 r4068 1 ; $Id: mytkStartProcess.asm,v 1.1.2. 1 2000-08-21 22:59:40bird Exp $1 ; $Id: mytkStartProcess.asm,v 1.1.2.2 2000-08-22 03:00:22 bird Exp $ 2 2 ; 3 3 ; tkStartProcess overloader. Needed to clear the loader semaphore … … 20 20 ; Imported Functions and variables. 21 21 ; 22 22 23 ; 23 24 ; LDR semaphore 24 25 ; 25 extrn pLDRSem:DWORD 26 extrn _KSEMRequestMutex@8:PROC 27 extrn _LDRClearSem@0:PROC 26 extrn pLdrSem:DWORD 27 extrn _LDRClearSem@0:PROC 28 extrn _KSEMRequestMutex@8:PROC 29 extrn _KSEMQueryMutex@8:PROC 28 30 29 31 ; … … 33 35 34 36 ; 37 ; mytkExecPgm stuff. 35 38 ; 36 ;37 extrn fLdrSemTaken:BYTE38 39 extrn fTkExecPgm:BYTE 39 40 … … 44 45 45 46 ; 46 ; Exported symbols47 ; TKSSBase (32-bit) 47 48 ; 49 extrn pulTKSSBase32:DWORD 50 51 ; 52 ; Calltable entry for tkStartProcess 53 ; 54 extrn _g_tkStartProcess:PROC 55 56 ; 57 ; Exported symbols 58 ; 48 59 public mytkStartProcess 49 60 50 61 51 62 CODE32 SEGMENT 63 64 ;; 65 ; Overloads tkStartProcess. If the loader semahore is taken by us we'll release it. 66 ; @returns 67 ; @param 68 ; @uses eax, ecx, edx 69 ; @sketch 70 ; @status 71 ; @author knut st. osmundsen (knut.stange.osmundsen@pmsc.no) 72 ; @remark 52 73 mytkStartProcess PROC NEAR 53 74 ASSUME CS:CODE32, DS:FLAT, ES:NOTHING, SS:NOTHING 54 75 55 76 ; 56 ; Check if the loader semphore is take .77 ; Check if the loader semphore is take by us. 57 78 ; Clear it (and other vars) if it is. 58 79 ; 59 cmp fLdrSemTaken, 0 60 jz finished 80 push eax 81 push ecx 82 push edx 61 83 84 push 0 ; Usage count variable. 85 mov eax, pulTKSSBase32 ; Get TKSSBase 86 mov eax, [eax] 87 add eax, esp ; Added TKSSBase to the usage count pointer 88 push eax ; Push address of usage count pointer. 89 push pLdrSem ; Push pointer to loader semaphore ( = handle). 90 call _KSEMQueryMutex@8 91 or eax, eax ; Check return code. (1 = our / free; 0 = not our but take) 92 jz mtksp_ret ; jmp if not taken by us (FALSE). 93 pop eax ; Pops usage count. 94 or eax, eax ; Check usage count. 95 jz mtksp_ret ; jmp if 0 (=free). 62 96 mov ulLDRState, 0 ; Clears loaderstate. (LDRSTATE_UNKNOWN) 63 97 mov pExeModule, 0 ; Sets the exemodule pointer to NULL. 64 98 mov fTkExecPgm, 0 ; Marks global data invalid. 99 cmp eax, 1 ; If usage count > 1 then issue a release. (should not happen here) 100 je mtksp_ret ; jmp if usage count < 2. (tkStartProcess or tkExecPgm will free the last usage). 65 101 call near ptr FLAT:_LDRClearSem@0 66 mov fLdrSemTaken, 0 ; Loader semaphore is not taken any longer!67 102 68 finished: 69 call ktStartProcess 70 ret 103 mtksp_ret: 104 pop edx 105 pop ecx 106 pop eax 107 jmp _g_tkStartProcess 71 108 mytkStartProcess ENDP 72 109
Note:
See TracChangeset
for help on using the changeset viewer.
