Changeset 4185 for trunk/src/win32k/dev16
- Timestamp:
- Sep 4, 2000, 6:40:50 PM (25 years ago)
- Location:
- trunk/src/win32k/dev16
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/dev16/d16init.c
r4164 r4185 1 /* $Id: d16init.c,v 1. 7 2000-09-02 21:07:55bird Exp $1 /* $Id: d16init.c,v 1.8 2000-09-04 16:40:47 bird Exp $ 2 2 * 3 3 * d16init - init routines for both drivers. … … 47 47 #include "log.h" 48 48 #include "options.h" 49 49 #include "errors.h" 50 50 51 51 … … 98 98 USHORT usAction = 0; 99 99 NPSZ npszErrMsg = NULL; 100 NPSZ npszErrMsg2 = NULL; 100 101 101 102 /* … … 119 120 if (rc == NO_ERROR) 120 121 { 121 if ( (rc = data.Status) == STATUS_DONE)122 if (data.usRcInit32 == NO_ERROR) 122 123 { 123 124 if (!options.fQuiet) 124 125 printf16("Win32k.sys succesfully initiated!\n"); 125 pRpOut->Status = pRpOut->rph.Status = data.Status;126 pRpOut->Status = pRpOut->rph.Status = STATUS_DONE; 126 127 } 127 128 else 128 npszErrMsg = "Ring-0 initiation failed. rc=%d\n"; 129 { 130 /* set correct error message and rc */ 131 rc = data.usRcInit32; 132 npszErrMsg = "Ring-0 initiation failed. rc=%x\n"; 133 if (rc >= ERROR_D32_FIRST && rc <= ERROR_D32_LAST) 134 npszErrMsg2 = GetErrorMsg(data.usRcInit32 + ERROR_PROB_SYM_D32_FIRST - ERROR_D32_FIRST); 135 } 129 136 } 130 137 else … … 152 159 { 153 160 printf16(npszErrMsg, rc); 154 pRpOut->Status = pRpOut->rph.Status = STATUS_DONE | STERR | ERROR_I24_QUIET_INIT_FAIL; 161 if (npszErrMsg2) 162 printf16("%s\n", npszErrMsg2); 163 pRpOut->Status = pRpOut->rph.Status = STATUS_DONE | STERR | ERROR_I24_GEN_FAILURE; 155 164 } 156 165 … … 167 176 * R0 16-bit initiation. 168 177 * This gets TKSSBase, thunks parameters and calls R0 32-bit initiation function. 169 * @returns Status word. 170 * @param pRp Generic IO Control request packet. 178 * @returns Status word. We don't fail on R0Init32 but forwards the result 179 * using the usRcInit32. 180 * @param pRp Generic IO Control request packet. 171 181 */ 172 182 USHORT NEAR R0Init16(PRP_GENIOCTL pRp) … … 212 222 !DevHelp_VirtToLin(SELECTOROF(rp32init.InitArgs), OFFSETOF(rp32init.InitArgs), (PLIN)&rp32init.InitArgs) 213 223 ) 214 { 224 { /* call 32-bit init routine and set 32 bit rc. */ 215 225 usRc = CallR0Init32(SSToDS_16(&rp32init)); 226 ((PD16R0INITDATA)pRp->DataPacket)->usRcInit32 = usRc; 227 228 /* set status to done (success). (R0Init32 RC is return as usRcInit32.) */ 229 usRc = STATUS_DONE; 216 230 } 217 231 else 218 usRc |= ERROR_I24_INVALID_PARAMETER; 219 220 ((PD16R0INITDATA)pRp->DataPacket)->Status = usRc; 232 usRc |= STERR | ERROR_I24_INVALID_PARAMETER; 233 221 234 222 235 /* 223 * finished - unlock data and parm 236 * finished - unlock data and parm; 224 237 */ 225 238 DevHelp_VMUnLock((LIN)SSToDS_16(&hLockParm[0])); … … 227 240 } 228 241 else 229 usRc |= ERROR_I24_INVALID_PARAMETER;242 usRc |= STERR | ERROR_I24_INVALID_PARAMETER; 230 243 } 231 244 else 232 usRc |= ERROR_I24_INVALID_PARAMETER;245 usRc |= STERR | ERROR_I24_INVALID_PARAMETER; 233 246 } 234 247 else 235 usRc |= ERROR_I24_GEN_FAILURE;248 usRc |= STERR | ERROR_I24_GEN_FAILURE; 236 249 237 250 return usRc; -
trunk/src/win32k/dev16/d16strat.c
r4164 r4185 1 /* $Id: d16strat.c,v 1. 9 2000-09-02 21:07:56bird Exp $1 /* $Id: d16strat.c,v 1.10 2000-09-04 16:40:48 bird Exp $ 2 2 * 3 3 * d16strat.c - 16-bit strategy routine, device headers, device_helper (ptr) … … 174 174 if (TKSSBase16 == 0) 175 175 initGetDosTableData(); 176 return CallVerifyImportTab32(); 176 rc = CallVerifyImportTab32(); 177 if (pRp->DataPacket) 178 ((PD16VERIFYIMPORTTABDATA)pRp->DataPacket)->usRc = rc; 179 return STATUS_DONE; 177 180 } 178 181 break; -
trunk/src/win32k/dev16/probkrnl.c
r4164 r4185 1 /* $Id: probkrnl.c,v 1.2 1 2000-09-02 21:07:56bird Exp $1 /* $Id: probkrnl.c,v 1.22 2000-09-04 16:40:48 bird Exp $ 2 2 * 3 3 * Description: Autoprobes the os2krnl file and os2krnl[*].sym files. … … 137 137 }; 138 138 139 char DATA16_GLOBAL szUsrSym[50] = {0}; 139 /** 140 * szSymbolFile holds the name of the symbol file used. 141 * 142 */ 143 char DATA16_GLOBAL szSymbolFile[60] = {0}; 144 145 /** 146 * iProc holds the number of the procedure which failed during verify. 147 */ 148 int DATA16_GLOBAL iProc = -1; /* The procedure number which failed Verify. */ 140 149 141 150 … … 204 213 205 214 /* 206 * ProbeSymFile error messages 215 * ProbeSymFile error messages + some extra ones. 207 216 */ 208 217 {ERROR_PROB_SYM_FILE_NOT_FOUND, "Sym: Symbol file was not found."}, … … 212 221 {ERROR_PROB_SYM_SEG_DEF_SEEK, "Sym: Failed to seek to a segment definition."}, 213 222 {ERROR_PROB_SYM_SEG_DEF_READ, "Sym: Failed to read a segment definition."}, 214 {ERROR_PROB_SYM_IMPORTS_NOTFOUND, "Sym: Allthe imports wasn't found."},223 {ERROR_PROB_SYM_IMPORTS_NOTFOUND, "Sym: Some of the imports wasn't found."}, 215 224 {ERROR_PROB_SYM_V_PROC_NOT_FND, "Sym: Verify failed: Procedure not found."}, 216 225 {ERROR_PROB_SYM_V_OBJ_OR_ADDR, "Sym: Verify failed: Invalid object or address."}, … … 218 227 {ERROR_PROB_SYM_V_PROLOG, "Sym: Verify failed: Invalid prolog."}, 219 228 {ERROR_PROB_SYM_V_NOT_IMPL, "Sym: Verify failed: Not implemented."}, 229 {ERROR_PROB_SYM_V_GETOS2KRNL, "GetOs2Krnl: failed."}, 230 {ERROR_PROB_SYM_V_NO_SWAPMTE, "GetOs2Krnl: No Swap MTE."}, 231 {ERROR_PROB_SYM_V_OBJECTS, "GetOs2Krnl: Too many objects."}, 232 {ERROR_PROB_SYM_V_OBJECT_TABLE, "GetOs2Krnl: No object table."}, 233 {ERROR_PROB_SYM_V_BUILD_INFO, "GetOs2Krnl: Build info not found."}, 234 {ERROR_PROB_SYM_V_INVALID_BUILD, "GetOs2Krnl: Unsupported build."}, 235 {ERROR_PROB_SYM_V_VERIFY, "importTabInit: Import failed."}, 236 {ERROR_PROB_SYM_V_IPE, "importTabInit: Internal-Processing-Error."}, 237 {ERROR_PROB_SYM_V_HEAPINIT, "R0Init32: HeapInit Failed."}, 238 {ERROR_PROB_SYM_V_D32_LDR_INIT, "R0Init32: ldrInit Failed."}, 220 239 221 240 {ERROR_PROB_SYMDB_KRNL_NOT_FOUND, "SymDB: Kernel was not found."} … … 253 272 static int kargncpy(char *pszTarget, const char *pszArg, unsigned cchMaxlen); 254 273 255 static const char * GetErrorMsg(short sErr);256 257 274 /* Workers */ 258 275 static int LookupKrnlEntry(unsigned short usBuild, unsigned short fKernel, unsigned char cObjects); … … 262 279 263 280 /* Ouput */ 264 static void ShowResult(int rc , int iSym);281 static void ShowResult(int rc); 265 282 266 283 /* Others used while debugging in R3. */ … … 570 587 * @author knut st. osmundsen (knut.stange.osmundsen@pmsc.no) 571 588 */ 572 staticconst char * GetErrorMsg(short sErr)589 const char * GetErrorMsg(short sErr) 573 590 { 574 591 int i; … … 639 656 rc = VerifyPrologs(); 640 657 641 /* set sym name */658 /* set sym name on success or complain on error */ 642 659 if (rc == 0) 643 kstrcpy(szUsrSym, "Win32k Symbol Database"); 660 kstrcpy(szSymbolFile, "Win32k Symbol Database"); 661 else 662 { 663 printf16("Warning: The Win32k Symbol Database entry found.\n" 664 " But, VerifyPrologs() returned rc=0x%x and iProc=%d\n", rc, iProc); 665 DosSleep(3000); 666 } 667 644 668 return rc; 645 669 } … … 655 679 * Verifies the that the addresses in aImportTab are valid. 656 680 * This is done at Ring-0 of course. 657 * @returns 0 if ok, not 0 if not ok. 681 * @returns NO_ERROR (ie. 0) on success. iProc = -1 682 * The appropriate OS/2 or Win32k return code on success. iProc 683 * is set to the failing procedure (if appliable). 658 684 */ 659 685 static int VerifyPrologs(void) … … 664 690 USHORT usAction = 0; 665 691 692 /* Set the failing procedure number to -1. */ 693 iProc = -1; 694 695 /* Open the elf device driver. */ 666 696 rc = DosOpen("\\dev\\elf$", &hDev0, &usAction, 0UL, FILE_NORMAL, 667 697 OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS, … … 670 700 if (rc == NO_ERROR) 671 701 { 672 rc = DosDevIOCtl("", "", D16_IOCTL_VERIFYIMPORTTAB, D16_IOCTL_CAT, hDev0); 702 D16VERIFYIMPORTTABDATA Data = {0}; 703 704 /* Issue the VerifyImportTab IOCtl call. */ 705 rc = DosDevIOCtl(&Data, "", D16_IOCTL_VERIFYIMPORTTAB, D16_IOCTL_CAT, hDev0); 673 706 DosClose(hDev0); 674 if (rc != NO_ERROR) 675 { 676 register APIRET rc2 = rc & STECODE; 677 if (rc2 >= ERROR_D32_VERIFYIMPORTTAB_FIRST && rc2 <= ERROR_D32_VERIFYIMPORTTAB_LAST) 678 rc = rc2 + ERROR_PROB_SYM_VERIFY_FIRST - ERROR_D32_VERIFYIMPORTTAB_FIRST; 707 if (rc == NO_ERROR) 708 { 709 if (Data.usRc != NO_ERROR) 710 { 711 /* set the appropriate return values. */ 712 rc = (Data.usRc & ERROR_D32_ERROR_MASK) + ERROR_PROB_SYM_D32_FIRST; 713 if (Data.usRc & ERROR_D32_PROC_FLAG) 714 iProc = (Data.usRc & ERROR_D32_PROC_MASK) >> ERROR_D32_PROC_SHIFT; 715 }/* else success */ 716 } 717 else 718 { 719 dprintf(("DosDevIOCtl failed with rc=%d\n", rc)); 720 DosSleep(3000); 679 721 } 680 722 } … … 682 724 { 683 725 dprintf(("DosOpen Failed with rc=%d\n", rc)); 684 DosSleep( 2000);726 DosSleep(3000); 685 727 } 686 728 … … 1042 1084 * Shows result of kernelprobing if not quiet or on error. 1043 1085 * @param rc Return code. 1044 * @param iSym index of .sym-file into static struct.1045 1086 */ 1046 1087 #ifndef EXTRACT 1047 static void ShowResult(int rc , int iSym)1088 static void ShowResult(int rc) 1048 1089 { 1049 1090 int i; … … 1075 1116 * symbol-file 1076 1117 */ 1077 if (rc == NO_ERROR || (rc > ERROR_PROB_SYM_LAST && (szUsrSym[0] != '\0' || apszSym[iSym] != NULL))) 1078 printf16(" Found symbolfile: %s\n", 1079 szUsrSym[0] == '\0' ? apszSym[iSym] : szUsrSym); 1118 if (rc == NO_ERROR || (rc > ERROR_PROB_SYM_LAST && szSymbolFile[0] != '\0')) 1119 printf16(" Found symbolfile: %s\n", (NPSZ)szSymbolFile); 1080 1120 else if (rc >= ERROR_PROB_SYM_FIRST) 1081 1121 printf16(" Failed to find symbolfile!\n"); … … 1086 1126 * function listing 1087 1127 */ 1088 if (options.fLogging || rc != NO_ERROR)1128 if (options.fLogging)/* || rc != NO_ERROR)*/ 1089 1129 { 1090 1130 for (i = 0; i < NBR_OF_KRNLIMPORTS; i++) … … 1105 1145 { 1106 1146 const char *psz = GetErrorMsg(rc); 1107 printf16("ProbeKernel failed with rc=%d. \n", rc);1147 printf16("ProbeKernel failed with rc=%d. iProc=%x\n", rc, iProc); 1108 1148 if (psz) printf16("%s\n", psz); 1109 1149 } … … 1167 1207 && pReqPack->InitArgs[i] != 'm' && pReqPack->InitArgs[i] != 'M' 1168 1208 ) /* -script and -smp is ignored */ 1169 i += kargncpy(sz UsrSym, &pReqPack->InitArgs[i], sizeof(szUsrSym));1209 i += kargncpy(szSymbolFile, &pReqPack->InitArgs[i], sizeof(szSymbolFile)); 1170 1210 break; 1171 1211 … … 1222 1262 { 1223 1263 rc = 1; 1224 if (sz UsrSym[0] != '\0')1225 { 1226 rc = ProbeSymFile(sz UsrSym);1264 if (szSymbolFile[0] != '\0') 1265 { 1266 rc = ProbeSymFile(szSymbolFile); 1227 1267 if (rc) 1228 1268 { 1229 printf16("Warning: Invalid symbol file specified. Tries defaults.\n"); 1230 szUsrSym[0] = '\0'; 1269 printf16("Warning: Invalid symbol file specified. rc=%x iProc=%d\n" 1270 " Tries defaults.\n", rc, iProc); 1271 szSymbolFile[0] = '\0'; 1272 DosSleep(3000); 1231 1273 } 1232 1274 } … … 1255 1297 { 1256 1298 i++; 1257 if (rc2 >= ERROR_PROB_SYM_ VERIFY_FIRST)1299 if (rc2 >= ERROR_PROB_SYM_D32_FIRST) 1258 1300 rc = rc2; 1259 1301 } 1260 if (rc == 1 || rc2 == NO_ERROR) 1302 if (rc == NO_ERROR) 1303 kstrcpy(szSymbolFile, apszSym[i]); 1304 else if (rc == 1 || rc2 == NO_ERROR) 1261 1305 rc = rc2; 1262 1306 #endif … … 1265 1309 } 1266 1310 1267 /* show the result and set return-value */ 1268 dprintf(("rc=%d; i=%d\n", rc, i)); 1269 ShowResult(rc, i); 1270 1271 /* Copy the symbol file name to szUsrSym. */ 1272 if (szUsrSym[0] == '\0' && apszSym[i] != NULL) 1273 kstrcpy(szUsrSym, apszSym[i]); 1311 /* Show the result and set return-value */ 1312 dprintf(("rc=%d(0x%x); i=%d; iProc=%d\n", rc, rc, i, iProc)); 1313 ShowResult(rc); 1274 1314 1275 1315 return rc; … … 1714 1754 int i; 1715 1755 1716 printf16("/* $Id: probkrnl.c,v 1.2 1 2000-09-02 21:07:56bird Exp $\n"1756 printf16("/* $Id: probkrnl.c,v 1.22 2000-09-04 16:40:48 bird Exp $\n" 1717 1757 "*\n" 1718 1758 "* Autogenerated kernel symbol database.\n"
Note:
See TracChangeset
for help on using the changeset viewer.