Changeset 1467 for trunk/src/win32k/dev32/d32init.c
- Timestamp:
- Oct 27, 1999, 4:03:01 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/dev32/d32init.c
r847 r1467 1 /* $Id: d32init.c,v 1. 1 1999-09-06 02:19:56bird Exp $1 /* $Id: d32init.c,v 1.2 1999-10-27 02:02:54 bird Exp $ 2 2 * 3 3 * d32init.c - 32-bits init routines. … … 12 12 #define MAXSIZE_PROLOG 0x10 /* Note that this must be synced with */ 13 13 /* the one used in calltab.asm. */ 14 #define static 14 15 15 16 #define INCL_DOSERRORS … … 31 32 #include "log.h" 32 33 #include "asmutils.h" 33 #include "cout.h"34 34 #include "malloc.h" 35 35 #include "ldr.h" … … 58 58 * @returns Status word. 59 59 * @param pRpInit Pointer init request packet. 60 * @sketch Set TKSSBase32. 61 * Set default parameters. 62 * Parse command line options. 63 * Show (kprint) configuration. 64 * Init heap. 65 * Init ldr. 66 * Init procs. (overloaded ldr procedures) 67 * @status completely implemented. 68 * @author knut st. osmundsen 60 69 */ 61 70 USHORT _loadds _Far32 _Pascal R0Init32(RP32INIT *pRpInit) … … 64 73 char *pszTmp; 65 74 66 TKSSBase32 =_TKSSBase16;75 pulTKSSBase32 = (PULONG)_TKSSBase16; 67 76 68 77 SET_OPTIONS_TO_DEFAULT(options); … … 80 89 switch (*pszTmp) 81 90 { 82 case 'C': /* -C[1|2] - com-port no */91 case 'C': /* -C[1|2] - com-port no, def:-C2 */ 83 92 switch (pszTmp[1]) 84 93 { … … 86 95 options.usCom = OUTPUT_COM1; 87 96 break; 97 88 98 case '2': 99 default: 89 100 options.usCom = OUTPUT_COM2; 90 break;91 101 } 92 102 break; 93 103 94 case 'L': /* -L:[Y|N or ]*/104 case 'L': /* -L[..]<:|=| >[<Y..|E..| > | <N..|D..>] */ 95 105 pszTmp2 = strpbrk(pszTmp, ":=/- "); 96 if (pszTmp2 != NULL && (int)(pszTmp2-pszTmp) < cch-1 && (*pszTmp2 == '=' || *pszTmp2 == ':' || *pszTmp2 == ' ' && (pszTmp2[1] != '-' || pszTmp2[1] != '/'))) 97 { 98 switch (pszTmp2[1]) 99 { 100 case 'D': /*disable*/ 101 options.fLogging = FALSE; 102 break; 103 case 'E': /*enable*/ 104 options.fLogging = TRUE; 105 break; 106 case 'Y': /*yes*/ 107 options.fLogging = TRUE; 108 break; 109 case 'N': /*no*/ 110 options.fLogging = FALSE; 111 break; 112 } 113 } 106 if (pszTmp2 != NULL && (int)(pszTmp2-pszTmp) < cch-1 107 && (pszTmp2[1] == 'N' ||pszTmp2[1] == 'n' || pszTmp2[1] == 'D' || pszTmp2[1] == 'd') 108 ) 109 options.fLogging = FALSE; 114 110 else 115 111 options.fLogging = TRUE; … … 126 122 127 123 case 'V': /* verbose initialization */ 128 options.fQuiet = TRUE;124 options.fQuiet = FALSE; 129 125 break; 130 126 … … 164 160 * init sub-parts 165 161 */ 166 167 162 /* heap */ 168 163 if (heapInit(HEAP_SIZE) != NO_ERROR) 169 164 return STATUS_DONE | STERR | ERROR_I24_QUIET_INIT_FAIL; 170 171 /* cout init */172 coutInit(options.usCom);173 165 174 166 /* loader */ … … 201 193 { 202 194 kprintf(("VerifyProcTab32: procedure no.%d was not found!\n", i)); 203 return 1; 204 } 205 206 /* verify read/writeable. - NOT IMPLEMENTED (yet) */ 195 return STATUS_DONE | STERR | 1; 196 } 197 198 /* verify read/writeable. - FIXME */ 199 if (_aProcTab[i].ulAddress < 0xffe00000UL) 200 { 201 kprintf(("VerifyProcTab32: procedure no.%d has an invlalid address, %#08x!\n", 202 i, _aProcTab[i].ulAddress)); 203 return STATUS_DONE | STERR | 2; 204 } 207 205 208 206 /* verify known function prolog. (only EPT_PROC) */ … … 212 210 { 213 211 kprintf(("VerifyProcTab32: verify failed for procedure no.%d\n",i)); 214 return 2;212 return STATUS_DONE | STERR | 3; 215 213 } 216 214 } … … 218 216 { 219 217 kprintf(("VerifyProcTab32: only EPT_PROC is implemented\n",i)); 220 return 3;221 } 222 } 223 224 return 0;218 return STATUS_DONE | STERR | 4; 219 } 220 } 221 222 return STATUS_DONE; 225 223 } 226 224 … … 228 226 /** 229 227 * Get kernel OTEs 230 * @returns 0 if ok. !0 on failiure. 228 * @returns Strategy return code: 229 * STATUS_DONE on success. 230 * STATUS_DONE | STERR | errorcode on failure. 231 231 * @param pOTEBuf Pointer to output buffer. 232 * @status completely implemented and tested. 233 * @author knut st. osmundsen 232 234 * @remark Called from IOCtl. 233 235 */ … … 271 273 kprintf(("GetOTEs32: failed. usRc = %d\n", usRc)); 272 274 273 return usRc ;275 return usRc | (usRc != 0 ? STATUS_DONE | STERR : STATUS_DONE); 274 276 } 275 277 … … 292 294 * push ebp 293 295 * mov ebp,esp 296 * or 297 * push ebp 298 * mov ecx, dword ptr [123407452] 294 299 */ 295 300 296 if (p[0] == 0x55 && p[1] == 0x8b && p[2] == 0xec) 297 { 298 rc = 3; 301 if (p[0] == 0x55 && p[1] == 0x8b) 302 { 303 if (p[2] == 0xec) 304 rc = 3; 305 else 306 rc = 1; 299 307 while (rc < 5) 300 308 { … … 308 316 case 0x33: /* xor (ldrClose, ldrOpen) */ 309 317 rc +=2; 318 break; 319 case 0x8b: 320 if (p[rc+1] == 0x0d) 321 rc += 6; 322 else 323 rc += 2; /*????!*/ 310 324 break; 311 325 case 0x8d: /* lea (ldrRead) */ … … 341 355 for (i = 0; i < NUMBER_OF_PROCS; i++) 342 356 { 343 if ((cb = interpretFunctionProlog((char*)_aProcTab[i].ulAddress)) <= 0 && cb + 5 >= MAXSIZE_PROLOG) 344 { 345 kprintf(("rehookFunctions: verify failed for procedure no.%d\n", i)); 357 cb = interpretFunctionProlog((char*)_aProcTab[i].ulAddress); 358 if (cb <= 0 || cb + 5 >= MAXSIZE_PROLOG) 359 { 360 kprintf(("rehookFunctions: verify failed for procedure no.%d, cb=%d\n", i, cb)); 346 361 return 1; 347 362 } … … 369 384 370 385 /* copy function prolog */ 371 memcpy(callTab[i], ( char*)_aProcTab[i].ulAddress,cb);386 memcpy(callTab[i], (void*)_aProcTab[i].ulAddress, (size_t)cb); 372 387 373 388 /* jump from calltab to original function */ … … 386 401 return 1; 387 402 } 388 i++;389 403 } 390 404
Note:
See TracChangeset
for help on using the changeset viewer.