Changeset 8155
- Timestamp:
- Apr 1, 2002, 11:06:11 AM (23 years ago)
- Location:
- branches/splittup/src/win32k/src
- Files:
-
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/splittup/src/win32k/src/ModuleBase.cpp ¶
r8149 r8155 1 /* $Id: ModuleBase.cpp,v 1.1.2. 1 2002-03-31 20:09:03bird Exp $1 /* $Id: ModuleBase.cpp,v 1.1.2.2 2002-04-01 09:06:02 bird Exp $ 2 2 * 3 3 * ModuleBase - Implementetation. … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: ModuleBase.cpp,v 1.1.2.2 2002-04-01 09:06:02 bird Exp $"; 12 #endif 10 13 11 14 /******************************************************************************* -
TabularUnified branches/splittup/src/win32k/src/Xx2Lx.mak ¶
r8149 r8155 1 # $Id: Xx2Lx.mak,v 1.1.2. 1 2002-03-31 20:09:04bird Exp $1 # $Id: Xx2Lx.mak,v 1.1.2.2 2002-04-01 09:06:02 bird Exp $ 2 2 3 3 # 4 # Odin32 API4 # xx2lx makefile. 5 5 # 6 # xx2lx.exe makefile7 6 # 8 7 9 8 10 9 # 11 # Tell buildenvironment that we're making an vio exe and to invoke additional dep rule10 # Load the build setup. 12 11 # 13 VIO=1 14 EXETARGET=1 12 PATH_ROOT = ..\..\.. 13 !include $(PATH_ROOT)\tools\make\setup.mak 15 14 16 15 17 16 # 18 # Co mpiler, tools, and interference rules thru the win32k makefile.inc file.17 # Config. 19 18 # 20 !include ..\..\makefile.inc 21 !include makefile.inc 22 23 24 # 25 # Sanity check 26 # 27 !ifndef WIN32KINCLUDE 28 !error "Fatal error! WIN32KINCLUDE is undefined!" 29 !endif 30 31 32 # 33 # Tools and Flags Addjustments 34 # 35 CINCLUDES = -I$(WIN32KINCLUDE) -I$(KKRNLLIBINCLUDE) $(CINCLUDES) 36 CDEFINES = $(CDEFINES) -DRING3 -DXX2LX 37 !if "$(VAC3)" == "1" || "$(VAC36)" == "1" 38 CFLAGS = $(CFLAGS) -Ge+ -Gm- -Gn- -Ti+ -Rn -Wall+ppt-ppc-inl-cnv-gnr-vft-gen-uni-ext- 39 CXXFLAGS = $(CXXFLAGS) -Ge+ -Gm- -Gn- -Ti+ -Rn -Gx -Wall+ppt-ppc-inl-cnv-gnr-vft- 40 CLISTING = -Fa$(OBJDIR)\$(@B).s 41 COBJOUT = -Fo$(OBJDIR)\$(@B).obj 42 LD2FLAGS = $(LD2FLAGS) /A:16 /Stack:4096 43 !else 44 !error "Compiler is not yet supported." 45 !endif 46 47 48 # 49 # Interference rules. 50 # 51 !if "$(VAC3)" == "1" || "$(VAC36)" == "1" 52 {$(WIN32KMISC)}.c.obj: 53 @echo compiling: $(@B).c 54 @$(CC) $(CFLAGS) $(CINCLUDES) $(CDEFINES) -c $(CLISTING) $(COBJOUT) $< 55 56 {$(WIN32KMISC)}.cpp.obj: 57 @echo compiling: $(@B).cpp 58 @$(CXX) $(CXXFLAGS) $(CINCLUDES) $(CDEFINES) -c $(CLISTING) $(COBJOUT) $< 59 60 {$(WIN32KLDR)}.cpp.obj: 61 @echo compiling: $(@B).cpp 62 @$(CXX) $(CXXFLAGS) $(CINCLUDES) $(CDEFINES) -c $(CLISTING) $(COBJOUT) $< 63 64 {$(WIN32KPE2LX)}.cpp{$(OBJDIR)}.obj: 65 @echo compiling: $(@B).cpp 66 @$(CXX) $(CXXFLAGS) $(CINCLUDES) $(CDEFINES) -c $(CLISTING) $(COBJOUT) $< 67 68 {$(WIN32KELF2LX)}.cpp{$(OBJDIR)}.obj: 69 @echo compiling: $(@B).cpp 70 @$(CXX) $(CXXFLAGS) $(CINCLUDES) $(CDEFINES) -c $(CLISTING) $(COBJOUT) $< 71 72 !else 73 !error "Compiler is not yet supported." 74 !endif 19 TARGET_MODE = EXE 20 TARGET_NAME = Xx2Lx 21 MAKEFILE = Xx2Lx.mak 22 TARGET_STACKSIZE = 4096 23 ALL_INCLUDES = -I../include -I../kKrnlLib/include 24 ALL_DEFINES = -DRING3 -DXX2LX -D__WIN32OS2__ -D__WINE__ 25 CC_FLAGS_EXE = $(CC_FLAGS_SYS) -URING0 75 26 76 27 … … 78 29 # Object files. Prefix with OBJDIR and one space before the '\'. 79 30 # 80 OBJS =\81 $( OBJDIR)\xx2lxmain.obj\82 $( OBJDIR)\modulebase.obj\83 $( OBJDIR)\pe2lx.obj\84 $( OBJDIR)\elf2lx.obj\85 $(OBJDIR)\malloc.obj\86 $(OBJDIR)\smalloc_avl.obj\87 $(OBJDIR)\avl.obj\88 $(OBJDIR)\rmalloc_avl.obj\89 $(OBJDIR)\new.obj\90 $(OBJDIR)\stricmp.obj\91 $(OBJDIR)\vprintf.obj31 TARGET_OBJS =\ 32 $(PATH_TARGET)\xx2lxmain.$(EXT_OBJ)\ 33 $(PATH_TARGET)\modulebase.$(EXT_OBJ)\ 34 $(PATH_TARGET)\pe2lx.$(EXT_OBJ)\ 35 $(PATH_TARGET)\elf2lx.$(EXT_OBJ)\ 36 #malloc.obj\ 37 #smalloc_avl.obj\ 38 #avl.obj\ 39 #rmalloc_avl.obj\ 40 #new.obj\ 41 #stricmp.obj\ 42 #vprintf.obj 92 43 93 44 … … 95 46 # Libraries. One space before the '\'. 96 47 # 97 LIBS =\98 $( RTLLIB_NRE)\99 os2386.lib 48 TARGET_LIBS =\ 49 $(LIB_C_OBJ)\ 50 $(LIB_OS)\ 100 51 101 52 102 53 # 103 # Target name - name of the exe without extention and path.54 # Load the build process rules. 104 55 # 105 TARGET = xx2lx 56 !include $(MAKE_INCLUDE_PROCESS) 106 57 107 108 #109 # Includes the common rules.110 #111 !include $(ODIN32_POST_INC)112 -
TabularUnified branches/splittup/src/win32k/src/api.cpp ¶
r8149 r8155 1 /* $Id: api.cpp,v 1.1.2. 1 2002-03-31 20:09:04bird Exp $1 /* $Id: api.cpp,v 1.1.2.2 2002-04-01 09:06:02 bird Exp $ 2 2 * 3 3 * API Overload Init and Helper Function. … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: api.cpp,v 1.1.2.2 2002-04-01 09:06:02 bird Exp $"; 12 #endif 10 13 11 14 /******************************************************************************* … … 118 121 APIRET apiReadIniFile(PSZ pszIniFile) 119 122 { 123 KLOGENTRY1("APIRET","PSZ pszIniFile", pszIniFile); 120 124 SFN sfn; 121 125 APIRET rc; … … 172 176 kprintf(("apiReadIniFile: Failed to open file %s, rc=%d\n", pszIniFile, rc)); 173 177 178 KLOGEXIT(rc); 174 179 return rc; 175 180 } … … 187 192 APIRET apiParseIniFile(PSZ pszFile) 188 193 { 194 KLOGENTRY1("APIRET","PSZ pszFile", pszFile); 189 195 PAPIDATAENTRY paNewApiData; 190 196 PSZ * ppszFile = (PSZ*)SSToDS(&pszFile); … … 199 205 { 200 206 kprintf(("apiParseIniFile: failed to allocate temporary struct.\n")); 207 KLOGEXIT(ERROR_NOT_ENOUGH_MEMORY); 201 208 return ERROR_NOT_ENOUGH_MEMORY; 202 209 } … … 304 311 rfree(paNewApiData); 305 312 313 KLOGEXIT(rc); 306 314 return rc; 307 315 } … … 321 329 PSZ apiStripIniLine(PSZ pszFile, PSZ * ppszFile) 322 330 { 331 KLOGENTRY2("PSZ","PSZ pszFile, PSZ * ppszFile", pszFile, ppszFile); 323 332 PSZ pszComment; 324 333 PSZ pszLine; … … 329 338 */ 330 339 if (*pszFile) 340 { 341 KLOGEXIT(NULL); 331 342 return NULL; 343 } 332 344 333 345 /* … … 375 387 pszComment[1] = '\0'; 376 388 389 KLOGEXIT(pszLine); 377 390 return pszLine; 378 391 } … … 394 407 int apiInterpretApiNo(PSZ pszSection) 395 408 { 409 KLOGENTRY1("int","PSZ pszSection", pszSection); 396 410 int iApi = 0; 397 411 398 412 pszSection++; /* skip '[' */ 399 413 if (*pszSection < '0' || *pszSection > '9') 414 { 415 KLOGEXIT(-1); 400 416 return -1; 417 } 401 418 402 419 while (*pszSection == ' ' || *pszSection == '\t') … … 409 426 } 410 427 428 KLOGEXIT(iApi); 411 429 return iApi; 412 430 } … … 423 441 void apiSortApiData(PAPIDATAENTRY paApiData) 424 442 { 443 KLOGENTRY1("void","PAPIDATAENTRY paApiData", paApiData); 425 444 int i; 426 445 … … 432 451 apiSortMaskArray(&paApiData[i].ModuleExc); 433 452 } 453 KLOGEXITVOID(); 434 454 } 435 455 … … 447 467 void apiSortMaskArray(PMASKARRAY pMasks) 448 468 { 469 KLOGENTRY1("void","PMASKARRAY pMasks", pMasks); 449 470 int i; 450 471 PSZ pszTmp; … … 469 490 } 470 491 } while (pszTmp != NULL); 492 KLOGEXITVOID(); 471 493 } 472 494 … … 482 504 void apiFreeApiData(PAPIDATAENTRY paApiData) 483 505 { 506 KLOGENTRY1("void","PAPIDATAENTRY paApiData", paApiData); 484 507 int i; 485 508 … … 495 518 rfree(paApiData[i].ModuleExc.papszMasks); 496 519 } 520 KLOGEXITVOID(); 497 521 } 498 522 … … 510 534 APIRET apiWriteIniFile(PSZ pszIniFile) 511 535 { 536 KLOGENTRY1("APIRET","PSZ pszIniFile", pszIniFile); 512 537 SFN sfn; 513 538 APIRET rc; … … 565 590 kprintf(("apiWriteIniFile: Failed open %s for write. rc=%d\n", pszIniFile, rc)); 566 591 592 KLOGEXIT(rc); 567 593 return rc; 568 594 } … … 584 610 APIRET apiWriteMasks(SFN sfn, PULONG poff, PMASKARRAY pMasks, PSZ pszType, BOOL fEnabled) 585 611 { 612 KLOGENTRY5("APIRET","SFN sfn, PULONG poff, PMASKARRAY pMasks, PSZ pszType, BOOL fEnabled", sfn, poff, pMasks, pszType, fEnabled); 586 613 char sz[48]; 587 614 PSZ psz = (PSZ)SSToDS(&sz[0]); … … 595 622 rc = apiWriteLine(sfn, poff, psz); 596 623 if (rc != NO_ERROR) 624 { 625 KLOGEXIT(rc); 597 626 return rc; 627 } 598 628 599 629 for (i = 0, rc = NO_ERROR; rc == NO_ERROR && i < pMasks->cMasks; i++) 600 630 rc = apiWriteLine(sfn, poff, pMasks->papszMasks[i]); 601 631 632 KLOGEXIT(rc); 602 633 return rc; 603 634 } … … 617 648 APIRET apiWriteLine(SFN sfn, PULONG poff, PSZ pszString) 618 649 { 650 KLOGENTRY3("APIRET","SFN sfn, PULONG poff, PSZ pszString", sfn, poff, pszString); 619 651 ULONG cb = strlen(pszString); 620 652 APIRET rc; … … 630 662 } 631 663 664 KLOGEXIT(rc); 632 665 return rc; 633 666 } … … 651 684 ) 652 685 { 686 KLOGENTRY5("APIRET","PSZ pszFilename, ULONG flOpenFlags, ULONG flOpenMode, PSFN phFile, PULONG pulsomething", pszFilename, flOpenFlags, flOpenMode, phFile, pulsomething); 653 687 APIRET rc; 654 688 ULONG ulAction = 0; … … 657 691 658 692 pulsomething = pulsomething; 693 KLOGEXIT(rc); 659 694 return rc; 660 695 } … … 677 712 ULONG ulOffset) 678 713 { 714 KLOGENTRY5("APIRET","SFN hFile, PULONG pcbActual, PVOID pvBuffer, ULONG flFlags, ULONG ulOffset", hFile, pcbActual, pvBuffer, flFlags, ulOffset); 679 715 APIRET rc; 680 716 ULONG ul; … … 683 719 rc = DosRead(hFile, pvBuffer, *pcbActual, pcbActual); 684 720 flFlags = flFlags; 721 KLOGEXIT(rc); 685 722 return rc; 686 723 } … … 704 741 ULONG ulOffset) 705 742 { 743 KLOGENTRY5("APIRET","SFN hFile, PULONG pcbActual, PVOID pvBuffer, ULONG flFlags, ULONG ulOffset", hFile, pcbActual, pvBuffer, flFlags, ulOffset); 706 744 APIRET rc; 707 745 ULONG ul; … … 710 748 rc = DosWrite(hFile, pvBuffer, *pcbActual, pcbActual); 711 749 flFlags = flFlags; 750 KLOGEXIT(rc); 712 751 return rc; 713 752 } … … 723 762 PULONG pcbFile) 724 763 { 764 KLOGENTRY2("APIRET","SFN hFile, PULONG pcbFile", hFile, pcbFile); 725 765 FILESTATUS3 fsts3; 726 766 APIRET rc; … … 729 769 if (rc == NO_ERROR) 730 770 *pcbFile = fsts3.cbFile; 771 KLOGEXIT(rc); 731 772 return rc; 732 773 } … … 747 788 BOOL apiFindNameInMaskArray(PSZ pszName, PMASKARRAY pMasks) 748 789 { 790 KLOGENTRY2("BOOL","PSZ pszName, PMASKARRAY pMasks", pszName, pMasks); 791 KLOGEXIT(FALSE); 749 792 return FALSE; 750 793 } … … 767 810 APIRET apiGetProccessName(PSZ pszName) 768 811 { 812 KLOGENTRY1("APIRET","PSZ pszName", pszName); 769 813 PPTDA pPTDA = ptdaGetCur(); 770 814 if (pPTDA) … … 789 833 if (!psz) psz = psmte->smte_path; 790 834 strcpy(pszName, psz); 835 KLOGEXIT(NO_ERROR); 791 836 return NO_ERROR; 792 837 } … … 800 845 kprintf(("apiGetProcessName: No current PTDA!\n")); 801 846 847 KLOGEXIT(ERROR_INVALID_PARAMETER); 802 848 return ERROR_INVALID_PARAMETER; 803 849 } … … 819 865 APIRET apiGetModuleName(PSZ pszName, USHORT usCS, ULONG ulEIP) 820 866 { 867 KLOGENTRY3("APIRET","PSZ pszName, USHORT usCS, ULONG ulEIP", pszName, usCS, ulEIP); 821 868 HMTE hmte = VMGetOwner(usCS, ulEIP); 822 869 if (hmte) … … 838 885 if (!psz) psz = psmte->smte_path; 839 886 strcpy(pszName, psz); 887 KLOGEXIT(NO_ERROR); 840 888 return NO_ERROR; 841 889 } … … 849 897 * We failed. 850 898 */ 899 KLOGEXIT(ERROR_INVALID_PARAMETER); 851 900 return ERROR_INVALID_PARAMETER; 852 901 } … … 870 919 BOOL _Optlink APIQueryEnabled(int iApi, USHORT usCS, LONG ulEIP) 871 920 { 921 KLOGENTRY3("BOOL","int iApi, USHORT usCS, LONG ulEIP", iApi, usCS, ulEIP); 872 922 PAPIDATAENTRY pEntry; 873 923 … … 876 926 */ 877 927 if (isApiEnhDisabled()) 928 { 929 KLOGEXIT(FALSE); 878 930 return FALSE; 931 } 879 932 880 933 /* … … 925 978 RWLockReleaseRead(&ApiInfoRWLock); 926 979 980 KLOGEXIT(fRet); 927 981 return fRet; 928 982 } … … 939 993 APIRET _Optlink APIInit(void) 940 994 { 995 KLOGENTRY0("APIRET"); 941 996 APIRET rc; 942 997 943 998 rc = apiReadIniFile(&szWin32kIni[0]); 944 999 1000 KLOGEXIT(rc); 945 1001 return rc; 946 1002 } -
TabularUnified branches/splittup/src/win32k/src/d32Win32kIOCtl.c ¶
r8149 r8155 1 /* $Id: d32Win32kIOCtl.c,v 1.1.2. 1 2002-03-31 20:09:06bird Exp $1 /* $Id: d32Win32kIOCtl.c,v 1.1.2.2 2002-04-01 09:06:03 bird Exp $ 2 2 * 3 3 * Win32k driver IOCtl handler function. … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: d32Win32kIOCtl.c,v 1.1.2.2 2002-04-01 09:06:03 bird Exp $"; 12 #endif 13 10 14 /******************************************************************************* 11 15 * Defined Constants And Macros * … … 16 20 #define INCL_NOPMAPI 17 21 #define INCL_OS2KRNL_TK 22 #define INCL_KKL_LOG 18 23 19 24 #define NO_WIN32K_LIB_FUNCTIONS … … 48 53 USHORT _loadds _Far32 _Pascal Win32kIOCtl(PRP32GENIOCTL pRpIOCtl) 49 54 { 55 KLOGENTRY1("USHORT","PRP32GENIOCTL pRpIOCtl", pRpIOCtl); 50 56 /* validate parameter pointer */ 51 57 if (pRpIOCtl == NULL || pRpIOCtl->ParmPacket == NULL 52 58 || pRpIOCtl->Function == 0 || pRpIOCtl->Function > K32_LASTIOCTLFUNCTION) 59 { 60 KLOGEXIT(STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER); 53 61 return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER; 62 } 54 63 55 64 switch (pRpIOCtl->Category) … … 60 69 if ( rc != 0xdeadbeefUL 61 70 && TKSuULongNF(&((PK32HDR)pRpIOCtl->ParmPacket)->rc, SSToDS(&rc)) == NO_ERROR) 71 { 72 KLOGEXIT(STATUS_DONE); 62 73 return STATUS_DONE; /* Successfull return */ 74 } 63 75 break; 64 76 } 65 77 } 66 78 79 KLOGEXIT(STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER); 67 80 return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER; 68 81 } -
TabularUnified branches/splittup/src/win32k/src/d32Win32kOpenClose.c ¶
r8149 r8155 1 /* $Id: d32Win32kOpenClose.c,v 1.1.2. 1 2002-03-31 20:09:06bird Exp $1 /* $Id: d32Win32kOpenClose.c,v 1.1.2.2 2002-04-01 09:06:03 bird Exp $ 2 2 * 3 3 * Open and Close handlers for the Win32k driver. … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: d32Win32kOpenClose.c,v 1.1.2.2 2002-04-01 09:06:03 bird Exp $"; 12 #endif 10 13 11 14 … … 54 57 USHORT _loadds _Far32 _Pascal Win32kOpen(PRP32OPENCLOSE pRpOpen) 55 58 { 59 KLOGENTRY1("USHORT","PRP32OPENCLOSE pRpOpen", pRpOpen); 56 60 APIRET rc; 57 61 PPTD pptd; … … 73 77 pRpOpen = pRpOpen; 74 78 LDRClearSem(); 79 KLOGEXIT(STATUS_DONE); 75 80 return STATUS_DONE; 76 81 } … … 86 91 USHORT _loadds _Far32 _Pascal Win32kClose(PRP32OPENCLOSE pRpClose) 87 92 { 93 KLOGENTRY1("USHORT","PRP32OPENCLOSE pRpClose", pRpClose); 88 94 APIRET rc; 89 95 PPTD pptd; … … 110 116 111 117 LDRClearSem(); 118 KLOGEXIT(STATUS_DONE); 112 119 return STATUS_DONE; 113 120 } -
TabularUnified branches/splittup/src/win32k/src/d32globals.c ¶
r8149 r8155 1 /* $Id: d32globals.c,v 1.1.2. 1 2002-03-31 20:09:07bird Exp $1 /* $Id: d32globals.c,v 1.1.2.2 2002-04-01 09:06:03 bird Exp $ 2 2 * 3 3 * d32globals - global data (32-bit) … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: d32globals.c,v 1.1.2.2 2002-04-01 09:06:03 bird Exp $"; 12 #endif 10 13 11 14 /******************************************************************************* -
TabularUnified branches/splittup/src/win32k/src/d32init.c ¶
r8149 r8155 1 /* $Id: d32init.c,v 1.1.2. 1 2002-03-31 20:09:07bird Exp $1 /* $Id: d32init.c,v 1.1.2.2 2002-04-01 09:06:04 bird Exp $ 2 2 * 3 3 * d32init.c - 32-bits init routines. … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: d32init.c,v 1.1.2.2 2002-04-01 09:06:04 bird Exp $"; 12 #endif 10 13 11 14 /******************************************************************************* … … 49 52 * Internal Functions * 50 53 *******************************************************************************/ 51 54 ULONG readnum(const char *pszNum); 52 55 53 56 … … 68 71 ULONG _System R0Init(RP32INIT *pRpInit) 69 72 { 73 KLOGENTRY1("ULONG _System","RP32INIT * pRpInit", pRpInit); 70 74 char * pszTmp2; 71 75 char * pszTmp; … … 266 270 /* loader */ 267 271 if ((rc = ldrInit()) != NO_ERROR) 272 { 273 KLOGEXIT(rc); 268 274 return rc; 275 } 269 276 270 277 /* apis */ 271 278 #if 0 272 279 if ((rc = APIInit()) != NO_ERROR) 280 { 281 KLOGEXIT(rc); 273 282 return rc; 283 } 274 284 #endif 275 285 … … 279 289 { 280 290 kprintf(("R0Init32: InitCallGate failed with rc=%d\n", rc)); 291 KLOGEXIT(rc); 281 292 return rc; 282 293 } … … 305 316 kprintf(("data segment lock failed with with rc=%d\n", rc)); 306 317 318 KLOGEXIT(NO_ERROR); 307 319 return NO_ERROR; 308 320 } … … 318 330 ULONG readnum(const char *pszNum) 319 331 { 332 KLOGENTRY1("ULONG","const char * pszNum", pszNum); 320 333 ULONG ulRet = 0; 321 334 ULONG ulBase = 10; … … 349 362 } 350 363 364 KLOGEXIT(i > 0 ? ulRet : ~0UL); 351 365 return i > 0 ? ulRet : ~0UL; 352 366 } -
TabularUnified branches/splittup/src/win32k/src/elf2lx.cpp ¶
r8149 r8155 1 /* $Id: elf2lx.cpp,v 1.1.2. 1 2002-03-31 20:09:08bird Exp $1 /* $Id: elf2lx.cpp,v 1.1.2.2 2002-04-01 09:06:04 bird Exp $ 2 2 * 3 3 * Elf2Lx - implementation. … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: elf2lx.cpp,v 1.1.2.2 2002-04-01 09:06:04 bird Exp $"; 12 #endif 10 13 11 14 … … 16 19 #define INCL_DOSERRORS /* DOS Error codes. */ 17 20 #define INCL_OS2KRNL_LDR /* LdrRead */ 21 #define INCL_KKL_LOG 22 #define INCL_KKL_AVL 23 #define INCL_KKL_HEAP 18 24 #ifdef RING0 19 25 #define INCL_NOAPI /* RING0: No apis. */ … … 27 33 *******************************************************************************/ 28 34 #include <os2.h> /* OS/2 header file. */ 29 #include "types.h" /* Types used by the next two files. */ 30 #include <newexe.h> /* OS/2 NE structs and definitions. */ 31 #include <exe386.h> /* OS/2 LX structs and definitions. */ 32 #include "elf.h" /* Elf binary format definitions. */ 33 34 #include "devSegDf.h" /* Win32k segment definitions. */ 35 36 #include "malloc.h" /* win32k malloc (resident). Not C library! */ 37 #include "smalloc.h" /* win32k swappable heap. */ 38 #include "rmalloc.h" /* win32k resident heap. */ 35 36 #include "NEexe.h" /* Wine NE structs and definitions. */ 37 #include "LXexe.h" /* OS/2 LX structs and definitions. */ 38 #include "ELFexe.h" /* Elf binary format definitions. */ 39 #include <OS2Krnl.h> /* kernel structs. (SFN) */ 40 #include <kKrnlLib.h> 39 41 40 42 #include <string.h> /* C library string.h. */ … … 43 45 #include <stdarg.h> /* C library stdarg.h. */ 44 46 45 #include " vprintf.h" /* win32k printf and vprintf. Not C library!*/47 #include "devSegDf.h" /* Win32k segment definitions. */ 46 48 #include "dev32.h" /* 32-Bit part of the device driver. (SSToDS) */ 47 #include "OS2Krnl.h" /* kernel structs. (SFN) */48 49 49 #include "modulebase.h" /* ModuleBase class definitions, ++. */ 50 50 #include "elf2lx.h" /* Elf2Lx class definitions. */ -
TabularUnified branches/splittup/src/win32k/src/k32AllocMemEx.cpp ¶
r8149 r8155 1 /* $Id: k32AllocMemEx.cpp,v 1.1.2. 1 2002-03-31 20:09:08bird Exp $1 /* $Id: k32AllocMemEx.cpp,v 1.1.2.2 2002-04-01 09:06:04 bird Exp $ 2 2 * 3 3 * k32AllocMemEx - Equivalent to DosAllocMem, but this one … … 9 9 * 10 10 */ 11 #ifndef NOFILEID 12 static const char szFileId[] = "$Id: k32AllocMemEx.cpp,v 1.1.2.2 2002-04-01 09:06:04 bird Exp $"; 13 #endif 11 14 12 15 … … 106 109 APIRET k32AllocMemEx(PPVOID ppv, ULONG cb, ULONG flFlags, ULONG ulCS, ULONG ulEIP) 107 110 { 111 KLOGENTRY5("APIRET","PPVOID ppv, ULONG cb, ULONG flFlags, ULONG ulCS, ULONG ulEIP", ppv, cb, flFlags, ulCS, ulEIP); 108 112 APIRET rc; 109 113 ULONG flVMFlags; … … 137 141 { 138 142 kprintf(("k32AllocMemEx: Bad param (1)\n")); 143 KLOGEXIT(ERROR_INVALID_PARAMETER); 139 144 return ERROR_INVALID_PARAMETER; 140 145 } … … 144 149 { 145 150 kprintf(("k32AllocMemEx: Bad size cb=%d\n", cb)); 151 KLOGEXIT(ERROR_NOT_ENOUGH_MEMORY); 146 152 return ERROR_NOT_ENOUGH_MEMORY; 147 153 } … … 153 159 { 154 160 kprintf(("k32AllocMemEx: Failed to fetch *ppv. rc=%d\n", rc)); 161 KLOGEXIT(rc); 155 162 return rc; 156 163 } … … 162 169 { 163 170 kprintf(("k32AllocMemEx: *ppv has an invalid address. *ppv=0x%08x\n", vmac.ac_va)); 171 KLOGEXIT(ERROR_INVALID_ADDRESS); 164 172 return ERROR_INVALID_ADDRESS; 165 173 } … … 243 251 244 252 kprintf(("k32AllocMemEx: returns rc=%d (*ppv=0x%08x)\n", rc, vmac.ac_va)); 253 KLOGEXIT(rc); 245 254 return rc; 246 255 } -
TabularUnified branches/splittup/src/win32k/src/k32HandleSystemEvent.cpp ¶
r8149 r8155 1 /* $Id: k32HandleSystemEvent.cpp,v 1.1.2. 1 2002-03-31 20:09:09bird Exp $1 /* $Id: k32HandleSystemEvent.cpp,v 1.1.2.2 2002-04-01 09:06:04 bird Exp $ 2 2 * 3 3 * k32HandleSystemEvent - Override system events like Ctrl-Alt-Delete … … 9 9 * 10 10 */ 11 #ifndef NOFILEID 12 static const char szFileId[] = "$Id: k32HandleSystemEvent.cpp,v 1.1.2.2 2002-04-01 09:06:04 bird Exp $"; 13 #endif 11 14 12 15 … … 88 91 APIRET k32HandleSystemEvent(ULONG ulEvent, HEV hev, BOOL fHandle) 89 92 { 93 KLOGENTRY3("APIRET","ULONG ulEvent, HEV hev, BOOL fHandle", ulEvent, hev, fHandle); 90 94 /* 91 95 * Validate parameters. … … 96 100 || ((ULONG)hev & 0xFFFF0000UL) != 0x80010000UL /* 0x80010000 seems to be the shared event semaphore handle bits. */ 97 101 ) 102 { 103 KLOGEXIT(ERROR_INVALID_PARAMETER); 98 104 return ERROR_INVALID_PARAMETER; 105 } 99 106 100 107 … … 105 112 || (!fHandle && aSysEventsOverrides[ulEvent].hev != hev && !aSysEventsOverrides[ulEvent].fBad) 106 113 ) 114 { 115 KLOGEXIT(ERROR_ACCESS_DENIED); 107 116 return ERROR_ACCESS_DENIED; 117 } 108 118 109 119 … … 121 131 } 122 132 133 KLOGEXIT(NO_ERROR); 123 134 return NO_ERROR; 124 135 } -
TabularUnified branches/splittup/src/win32k/src/k32KillProcessEx.cpp ¶
r8149 r8155 1 /* $Id: k32KillProcessEx.cpp,v 1.1.2. 1 2002-03-31 20:09:09bird Exp $1 /* $Id: k32KillProcessEx.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $ 2 2 * 3 3 * k32KillProcessEx - DosKillProcessEx extention. … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: k32KillProcessEx.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $"; 12 #endif 10 13 11 14 … … 54 57 APIRET k32KillProcessEx(ULONG flAction, PID pid) 55 58 { 59 KLOGENTRY2("APIRET","ULONG flAction, PID pid", flAction, pid); 56 60 APIRET rc; 57 61 … … 63 67 { 64 68 kprintf(("k32KillProcessEx(flAction=0x%08x, pid=0x%04x): flags are invalid\n", flAction, pid)); 69 KLOGEXIT(ERROR_INVALID_PARAMETER); 65 70 return ERROR_INVALID_PARAMETER; 66 71 } … … 70 75 { 71 76 kprintf(("k32KillProcessEx(flAction=0x%08x, pid=0x%04x): pid is out of range\n", flAction, pid)); 77 KLOGEXIT(ERROR_INVALID_PROCID); 72 78 return ERROR_INVALID_PROCID; 73 79 } … … 94 100 } 95 101 102 KLOGEXIT(rc); 96 103 return rc; 97 104 } -
TabularUnified branches/splittup/src/win32k/src/k32ProcessReadWrite.cpp ¶
r8149 r8155 1 /* $Id: k32ProcessReadWrite.cpp,v 1.1.2. 1 2002-03-31 20:09:09bird Exp $1 /* $Id: k32ProcessReadWrite.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $ 2 2 * 3 3 * k32ProcessReadWrite - Read or write to another process. … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: k32ProcessReadWrite.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $"; 12 #endif 10 13 11 14 … … 53 56 APIRET k32ProcessReadWrite(PID pid, ULONG cb, PVOID pvSource, PVOID pvTarget, BOOL fRead) 54 57 { 58 KLOGENTRY5("APIRET","PID pid, ULONG cb, PVOID pvSource, PVOID pvTarget, BOOL fRead", pid, cb, pvSource, pvTarget, fRead); 55 59 ULONG ulAddrAlias; 56 60 ULONG cbAlias; … … 66 70 cbAlias = (cb + 0xfffUL) & ~0xfffUL; 67 71 if (cbAlias - 1 + ulAddrAlias < ulAddrAlias) 72 { 73 KLOGEXIT(ERROR_INVALID_ACCESS); 68 74 return ERROR_INVALID_ACCESS; 75 } 69 76 70 77 /* … … 78 85 { 79 86 kprintf(("k32ProcessReadWrite: Failed with invalid PID.\n")); 87 KLOGEXIT(rc != NO_ERROR ? rc : ERROR_INVALID_PARAMETER); 80 88 return rc != NO_ERROR ? rc : ERROR_INVALID_PARAMETER; 81 89 } … … 88 96 { 89 97 kprintf(("k32ProcessReadWrite: LDRRequestSem failed with rc=%d\n", rc)); 98 KLOGEXIT(rc); 90 99 return rc; 91 100 } … … 103 112 { 104 113 kprintf(("k32ProcessReadWrite: VMMapDebugAlias failed with rc=%d\n")); 114 KLOGEXIT(rc); 105 115 return rc; 106 116 } … … 129 139 kprintf(("k32ProcessReadWrite: VMFreeMem failed!\n")); 130 140 141 KLOGEXIT(rc); 131 142 return rc; 132 143 } -
TabularUnified branches/splittup/src/win32k/src/k32QueryCallGate.cpp ¶
r8149 r8155 1 /* $Id: k32QueryCallGate.cpp,v 1.1.2. 1 2002-03-31 20:09:10bird Exp $1 /* $Id: k32QueryCallGate.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $ 2 2 * 3 3 * k32QueryCallGate - Query the callgate selector for the callgate to the k32 APIs. … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: k32QueryCallGate.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $"; 12 #endif 10 13 11 14 … … 16 19 #define INCL_DOSERRORS 17 20 #define INCL_OS2KRNL_TK 21 #define INCL_KKL_LOG 18 22 19 23 #define NO_WIN32K_LIB_FUNCTIONS … … 51 55 APIRET k32QueryCallGate(PUSHORT pusCGSelector) 52 56 { 57 KLOGENTRY1("APIRET","PUSHORT pusCGSelector", pusCGSelector); 53 58 APIRET rc; 54 59 … … 58 63 rc = ERROR_INVALID_CALLGATE; 59 64 65 KLOGEXIT(rc); 60 66 return rc; 61 67 } -
TabularUnified branches/splittup/src/win32k/src/k32QueryOTEs.cpp ¶
r8149 r8155 1 /* $Id: k32QueryOTEs.cpp,v 1.1.2. 1 2002-03-31 20:09:10bird Exp $1 /* $Id: k32QueryOTEs.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $ 2 2 * 3 3 * k32QueryOTEs - Get's the object table entries (OTEs) for a given … … 9 9 * 10 10 */ 11 #ifndef NOFILEID 12 static const char szFileId[] = "$Id: k32QueryOTEs.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $"; 13 #endif 11 14 12 15 … … 49 52 APIRET k32QueryOTEs(HMTE hMTE, PQOTEBUFFER pQOte, ULONG cbQOte) 50 53 { 54 KLOGENTRY3("APIRET","HMTE hMTE, PQOTEBUFFER pQOte, ULONG cbQOte", hMTE, pQOte, cbQOte); 51 55 APIRET rc; 52 56 PMTE pMTE; … … 58 62 */ 59 63 if ((ULONG)pQOte < 0x10000 || cbQOte < sizeof(QOTEBUFFER)) 64 { 65 KLOGEXIT(ERROR_INVALID_PARAMETER); 60 66 return ERROR_INVALID_PARAMETER; 67 } 61 68 62 69 /* … … 67 74 { 68 75 kprintf(("k32QueryOTEs: LDRRequestSem failed with rc = %d\n", rc)); 76 KLOGEXIT(rc); 69 77 return rc; 70 78 } … … 115 123 LDRClearSem(); 116 124 125 KLOGEXIT(rc); 117 126 return rc; 118 127 } -
TabularUnified branches/splittup/src/win32k/src/k32QueryOptionsStatus.cpp ¶
r8149 r8155 1 /* $Id: k32QueryOptionsStatus.cpp,v 1.1.2. 1 2002-03-31 20:09:11bird Exp $1 /* $Id: k32QueryOptionsStatus.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $ 2 2 * 3 3 * k32QueryOptionsStatus - Queries the options and/or the status of … … 9 9 * 10 10 */ 11 #ifndef NOFILEID 12 static const char szFileId[] = "$Id: k32QueryOptionsStatus.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $"; 13 #endif 11 14 12 15 … … 30 33 *******************************************************************************/ 31 34 #include <os2.h> /* OS/2 header file. */ 32 #include <peexe.h> /* Wine PE structs and definitions. */ 33 #include <neexe.h> /* Wine NE structs and definitions. */ 34 #include <newexe.h> /* OS/2 NE structs and definitions. */ 35 #include <exe386.h> /* OS/2 LX structs and definitions. */ 35 #include <NEexe.h> /* Wine NE structs and definitions. */ 36 #include <LXexe.h> /* OS/2 LX structs and definitions. */ 37 #include <PEexe.h> /* Wine PE structs and definitions. */ 36 38 #include <OS2Krnl.h> 37 39 #include <kKrnlLib.h> … … 68 70 APIRET k32QueryOptionsStatus(PK32OPTIONS pOptions, PK32STATUS pStatus) 69 71 { 72 KLOGENTRY2("APIRET","PK32OPTIONS pOptions, PK32STATUS pStatus", pOptions, pStatus); 70 73 APIRET rc; 71 74 ULONG cb; … … 88 91 rc = TKFuULongNF(SSToDS(&cb), &pOptions->cb); 89 92 if (rc) 93 { 94 KLOGEXIT(rc); 90 95 return rc; 96 } 91 97 if (cb != sizeof(K32OPTIONS)) 98 { 99 KLOGEXIT(ERROR_INVALID_PARAMETER); 92 100 return ERROR_INVALID_PARAMETER; 101 } 93 102 } 94 103 … … 97 106 rc = TKFuULongNF(SSToDS(&cb), &pStatus->cb); 98 107 if (rc) 108 { 109 KLOGEXIT(rc); 99 110 return rc; 111 } 100 112 if (cb != sizeof(K32STATUS)) 113 { 114 KLOGEXIT(ERROR_INVALID_PARAMETER); 101 115 return ERROR_INVALID_PARAMETER; 116 } 102 117 } 103 118 … … 110 125 { 111 126 kprintf(("k32QueryOptionsStatus: LDRRequestSem failed with rc = %d\n", rc)); 127 KLOGEXIT(rc); 112 128 return rc; 113 129 } … … 216 232 LDRClearSem(); 217 233 234 KLOGEXIT(rc); 218 235 return rc; 219 236 } -
TabularUnified branches/splittup/src/win32k/src/k32QuerySystemMemInfo.cpp ¶
r8149 r8155 1 /* $Id: k32QuerySystemMemInfo.cpp,v 1.1.2. 1 2002-03-31 20:09:11bird Exp $1 /* $Id: k32QuerySystemMemInfo.cpp,v 1.1.2.2 2002-04-01 09:06:06 bird Exp $ 2 2 * 3 3 * k32QuerySystemMemInfo - Collects more or less useful information on the … … 9 9 * 10 10 */ 11 #ifndef NOFILEID 12 static const char szFileId[] = "$Id: k32QuerySystemMemInfo.cpp,v 1.1.2.2 2002-04-01 09:06:06 bird Exp $"; 13 #endif 11 14 12 15 … … 31 34 *******************************************************************************/ 32 35 #include <os2.h> /* OS/2 header file. */ 33 #include <peexe.h> /* Wine PE structs and definitions. */ 34 #include <neexe.h> /* Wine NE structs and definitions. */ 35 #include <newexe.h> /* OS/2 NE structs and definitions. */ 36 #include <exe386.h> /* OS/2 LX structs and definitions. */ 36 #include "LXexe.h" /* OS/2 LX structs and definitions. */ 37 #include "PEexe.h" /* Wine PE structs and definitions. */ 37 38 #include <OS2Krnl.h> 38 39 #include <kKrnlLib.h> … … 62 63 APIRET k32QuerySystemMemInfo(PK32SYSTEMMEMINFO pMemInfo) 63 64 { 65 KLOGENTRY1("APIRET","PK32SYSTEMMEMINFO pMemInfo", pMemInfo); 64 66 APIRET rc; 65 67 K32SYSTEMMEMINFO MemInfo; … … 75 77 rc = TKFuBuff(SSToDS(&MemInfo.cb), &pMemInfo->cb, sizeof(ULONG)*2, TK_FUSU_NONFATAL); 76 78 if (rc) 79 { 80 KLOGEXIT(rc); 77 81 return rc; 82 } 78 83 if (MemInfo.cb != sizeof(K32SYSTEMMEMINFO)) 84 { 85 KLOGEXIT(ERROR_INVALID_PARAMETER); 79 86 return ERROR_INVALID_PARAMETER; 87 } 80 88 if (MemInfo.flFlags > 7) 89 { 90 KLOGEXIT(ERROR_INVALID_PARAMETER); 81 91 return ERROR_INVALID_PARAMETER; 92 } 82 93 83 94 … … 161 172 kprintf(("k32QuerySystemMemInfo: Failed to copy meminfo to user memory. rc=%d\n", rc)); 162 173 174 KLOGEXIT(rc); 163 175 return rc; 164 176 } -
TabularUnified branches/splittup/src/win32k/src/k32SendSystemEvent.cpp ¶
r8149 r8155 1 /* $Id: k32SendSystemEvent.cpp,v 1.1.2. 1 2002-03-31 20:09:12bird Exp $1 /* $Id: k32SendSystemEvent.cpp,v 1.1.2.2 2002-04-01 09:06:06 bird Exp $ 2 2 * 3 3 * k32SendSystemEvent - Send a system event like Ctrl-Alt-Delete … … 9 9 * 10 10 */ 11 #ifndef NOFILEID 12 static const char szFileId[] = "$Id: k32SendSystemEvent.cpp,v 1.1.2.2 2002-04-01 09:06:06 bird Exp $"; 13 #endif 11 14 12 15 … … 16 19 #define INCL_DOSMEMMGR 17 20 #define INCL_DOSERRORS 18 19 21 #define INCL_OS2KRNL_TK 20 22 #define INCL_OS2KRNL_SEM 21 23 #define INCL_KKL_LOG 22 24 #define NO_WIN32K_LIB_FUNCTIONS 23 25 … … 58 60 APIRET k32SendSystemEvent(ULONG ulEvent, BOOL fHandle) 59 61 { 62 KLOGENTRY2("APIRET","ULONG ulEvent, BOOL fHandle", ulEvent, fHandle); 60 63 /* 61 64 * Validate parameters. … … 66 69 || ((ULONG)hev & 0xFFFF0000UL) != 0x80010000UL /* 0x80010000 seems to be the shared event semaphore handle bits. */ 67 70 ) 71 { 72 KLOGEXIT(ERROR_INVALID_PARAMETER); 68 73 return ERROR_INVALID_PARAMETER; 74 } 69 75 70 76 … … 75 81 || (!fHandle && aSysEventsOverrides[ulEvent].hev != hev && !aSysEventsOverrides[ulEvent].fBad) 76 82 ) 83 { 84 KLOGEXIT(ERROR_ACCESS_DENIED); 77 85 return ERROR_ACCESS_DENIED; 86 } 78 87 79 88 … … 91 100 } 92 101 102 KLOGEXIT(NO_ERROR); 93 103 return NO_ERROR; 94 104 } -
TabularUnified branches/splittup/src/win32k/src/k32SetEnvironment.cpp ¶
r8149 r8155 1 /* $Id: k32SetEnvironment.cpp,v 1.1.2. 1 2002-03-31 20:09:13bird Exp $1 /* $Id: k32SetEnvironment.cpp,v 1.1.2.2 2002-04-01 09:06:06 bird Exp $ 2 2 * 3 3 * k32SetEnvironment - Sets the Odin32 environment for a process. … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: k32SetEnvironment.cpp,v 1.1.2.2 2002-04-01 09:06:06 bird Exp $"; 12 #endif 10 13 11 14 … … 56 59 APIRET k32SetEnvironment(PSZ pszzEnvironment, ULONG cchEnvironment, PID pid) 57 60 { 61 KLOGENTRY3("APIRET","PSZ pszzEnvironment, ULONG cchEnvironment, PID pid", pszzEnvironment, cchEnvironment, pid); 58 62 APIRET rc; 59 63 PPTD pptd; … … 65 69 { 66 70 kprintf(("k32SetEnvironment: invalid pid=%x\n", pid)); 71 KLOGEXIT(ERROR_INVALID_PARAMETER); 67 72 return ERROR_INVALID_PARAMETER; 68 73 } … … 71 76 { 72 77 kprintf(("k32SetEnvironment: currently only supported for current pid. pid=%x\n", pid)); 78 KLOGEXIT(ERROR_INVALID_PARAMETER); 73 79 return ERROR_INVALID_PARAMETER; 74 80 } … … 82 88 { 83 89 kprintf(("k32SetEnvironment: LDRRequestSem failed with rc = %d\n", rc)); 90 KLOGEXIT(rc); 84 91 return rc; 85 92 } … … 120 127 121 128 LDRClearSem(); 129 KLOGEXIT(rc); 122 130 return rc; 123 131 } -
TabularUnified branches/splittup/src/win32k/src/k32SetOptions.cpp ¶
r8149 r8155 1 /* $Id: k32SetOptions.cpp,v 1.1.2. 1 2002-03-31 20:09:13bird Exp $1 /* $Id: k32SetOptions.cpp,v 1.1.2.2 2002-04-01 09:06:06 bird Exp $ 2 2 * 3 3 * k32SetOptions - Sets the changable options of win32k.sys the options. … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: k32SetOptions.cpp,v 1.1.2.2 2002-04-01 09:06:06 bird Exp $"; 12 #endif 10 13 11 14 … … 28 31 *******************************************************************************/ 29 32 #include <os2.h> /* OS/2 header file. */ 30 #include <peexe.h> /* Wine PE structs and definitions. */ 31 #include <neexe.h> /* Wine NE structs and definitions. */ 32 #include <newexe.h> /* OS/2 NE structs and definitions. */ 33 #include <exe386.h> /* OS/2 LX structs and definitions. */ 33 #include "LXexe.h" /* OS/2 LX structs and definitions. */ 34 #include "PEexe.h" /* Wine PE structs and definitions. */ 34 35 #include <OS2Krnl.h> 35 36 #include <kKrnlLib.h> … … 65 66 APIRET k32SetOptions(PK32OPTIONS pOptions) 66 67 { 68 KLOGENTRY1("APIRET","PK32OPTIONS pOptions", pOptions); 67 69 APIRET rc; 68 70 ULONG cb; … … 80 82 rc = TKFuULongNF(SSToDS(&cb), &pOptions->cb); 81 83 if (rc) 84 { 85 KLOGEXIT(rc); 82 86 return rc; 87 } 83 88 if (cb != sizeof(K32OPTIONS)) 89 KLOGEXIT(ERROR_INVALID_PARAMETER); 84 90 return ERROR_INVALID_PARAMETER; 85 91 } … … 102 108 && TmpOptions.usCom != OUTPUT_COM3 103 109 && TmpOptions.usCom != OUTPUT_COM4) 104 return ERROR_INVALID_PARAMETER; 110 { 111 KLOGEXIT(ERROR_INVALID_PARAMETER); 112 return ERROR_INVALID_PARAMETER; 113 } 105 114 #endif 106 115 if (TmpOptions.fLogging > 1) 107 return ERROR_INVALID_PARAMETER; 116 { 117 KLOGEXIT(ERROR_INVALID_PARAMETER); 118 return ERROR_INVALID_PARAMETER; 119 } 108 120 if (TmpOptions.fPE > 4) 109 return ERROR_INVALID_PARAMETER; 121 { 122 KLOGEXIT(ERROR_INVALID_PARAMETER); 123 return ERROR_INVALID_PARAMETER; 124 } 110 125 if (TmpOptions.fPEOneObject > 2) 111 return ERROR_INVALID_PARAMETER; 126 { 127 KLOGEXIT(ERROR_INVALID_PARAMETER); 128 return ERROR_INVALID_PARAMETER; 129 } 112 130 if (TmpOptions.ulInfoLevel > 4) 113 return ERROR_INVALID_PARAMETER; 131 { 132 KLOGEXIT(ERROR_INVALID_PARAMETER); 133 return ERROR_INVALID_PARAMETER; 134 } 114 135 if (TmpOptions.fElf > 1) 115 return ERROR_INVALID_PARAMETER; 136 { 137 KLOGEXIT(ERROR_INVALID_PARAMETER); 138 return ERROR_INVALID_PARAMETER; 139 } 116 140 if (TmpOptions.fUNIXScript > 1) 117 return ERROR_INVALID_PARAMETER; 141 { 142 KLOGEXIT(ERROR_INVALID_PARAMETER); 143 return ERROR_INVALID_PARAMETER; 144 } 118 145 if (TmpOptions.fREXXScript > 1) 119 return ERROR_INVALID_PARAMETER; 146 { 147 KLOGEXIT(ERROR_INVALID_PARAMETER); 148 return ERROR_INVALID_PARAMETER; 149 } 120 150 if (TmpOptions.fJava > 1) 121 return ERROR_INVALID_PARAMETER; 151 { 152 KLOGEXIT(ERROR_INVALID_PARAMETER); 153 return ERROR_INVALID_PARAMETER; 154 } 122 155 if (TmpOptions.fNoLoader > 1) 123 return ERROR_INVALID_PARAMETER; 156 { 157 KLOGEXIT(ERROR_INVALID_PARAMETER); 158 return ERROR_INVALID_PARAMETER; 159 } 124 160 if (TmpOptions.fREXXScript > 1) 125 return ERROR_INVALID_PARAMETER; 161 { 162 KLOGEXIT(ERROR_INVALID_PARAMETER); 163 return ERROR_INVALID_PARAMETER; 164 } 126 165 if (TmpOptions.fDllFixes > 1) 127 return ERROR_INVALID_PARAMETER; 166 { 167 KLOGEXIT(ERROR_INVALID_PARAMETER); 168 return ERROR_INVALID_PARAMETER; 169 } 128 170 if (TmpOptions.fExeFixes > 1) 129 return ERROR_INVALID_PARAMETER; 171 { 172 KLOGEXIT(ERROR_INVALID_PARAMETER); 173 return ERROR_INVALID_PARAMETER; 174 } 130 175 if (TmpOptions.fForcePreload > 1) 131 return ERROR_INVALID_PARAMETER; 176 { 177 KLOGEXIT(ERROR_INVALID_PARAMETER); 178 return ERROR_INVALID_PARAMETER; 179 } 132 180 if (TmpOptions.fApiEnh > 1) 133 return ERROR_INVALID_PARAMETER; 181 { 182 KLOGEXIT(ERROR_INVALID_PARAMETER); 183 return ERROR_INVALID_PARAMETER; 184 } 134 185 #if 0 135 186 if (TmpOptions.cbSwpHeapMax > (32768*1024) || TmpOptions.cbSwpHeapMax < options.cbSwpHeapInit) 136 return ERROR_INVALID_PARAMETER; 187 { 188 KLOGEXIT(ERROR_INVALID_PARAMETER); 189 return ERROR_INVALID_PARAMETER; 190 } 137 191 if (TmpOptions.cbResHeapMax > (32768*1024) || TmpOptions.cbResHeapMax < options.cbResHeapInit) 138 return ERROR_INVALID_PARAMETER; 192 { 193 KLOGEXIT(ERROR_INVALID_PARAMETER); 194 return ERROR_INVALID_PARAMETER; 195 } 139 196 #endif 140 197 … … 146 203 { 147 204 kprintf(("k32QueryOptionsStatus: LDRRequestSem failed with rc = %d\n", rc)); 205 KLOGEXIT(rc); 148 206 return rc; 149 207 } … … 183 241 } 184 242 243 KLOGEXIT(rc); 185 244 return rc; 186 245 } -
TabularUnified branches/splittup/src/win32k/src/ldr.cpp ¶
r8149 r8155 1 /* $Id: ldr.cpp,v 1.1.2. 1 2002-03-31 20:09:14bird Exp $1 /* $Id: ldr.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $ 2 2 * 3 3 * ldr.cpp - Loader helpers. … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: ldr.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $"; 12 #endif 10 13 11 14 /******************************************************************************* … … 25 28 *******************************************************************************/ 26 29 #include <os2.h> 27 #include <peexe.h>28 #include <exe386.h>30 #include "LXexe.h" /* OS/2 LX structs and definitions. */ 31 #include "PEexe.h" /* Wine PE structs and definitions. */ 29 32 #include <OS2Krnl.h> 30 33 #include <kKrnlLib.h> … … 87 90 PMODULE getModuleBySFN(SFN hFile) 88 91 { 89 return (PMODULE)AVLULGet(&pSFNRoot, (AVLULKEY)hFile); 92 KLOGENTRY1("PMODULE","SFN hFile", hFile); 93 PMODULE pMod = (PMODULE)AVLULGet(&pSFNRoot, (AVLULKEY)hFile); 94 KLOGEXIT(pMod); 95 return pMod; 90 96 } 91 97 … … 113 119 PMODULE getModuleByMTE(PMTE pMTE) 114 120 { 121 KLOGENTRY1("PMODULE","PMTE pMTE", pMTE); 115 122 #if 0 116 123 /* Not 100% sure that this will work correctly! */ … … 122 129 { 123 130 kprintf(("getModuleByMTE: invalid pMTE pointer - %#8x\n", pMTE)); 131 KLOGEXIT(NULL); 124 132 return NULL; 125 133 } … … 135 143 else 136 144 pMod = (PMODULE)((unsigned)pMod - offsetof(MODULE, coreMTE)); 145 { 146 KLOGEXIT(pMod); 137 147 return pMod; 148 } 138 149 #else 139 150 /* Use this for the time being. */ … … 142 153 { 143 154 kprintf(("getModuleByMTE: invalid pMTE pointer - %#8x\n", pMTE)); 155 KLOGEXIT(NULL); 144 156 return NULL; 145 157 } 146 158 #endif 147 159 if (GetState(pMTE->mte_sfn) == HSTATE_OUR) 148 return (PMODULE)AVLULGet(&pSFNRoot, (AVLULKEY)pMTE->mte_sfn); 149 160 { 161 PMODULE pMod = (PMODULE)AVLULGet(&pSFNRoot, (AVLULKEY)pMTE->mte_sfn); 162 KLOGEXIT(pMod); 163 return pMod; 164 } 165 166 KLOGEXIT(NULL); 150 167 return NULL; 151 168 #endif … … 164 181 PMODULE getModuleByhMTE(HMTE hMTE) 165 182 { 183 KLOGENTRY1("PMODULE","HMTE hMTE", hMTE); 166 184 PMTE pMTE; 167 185 168 186 pMTE = ldrValidateMteHandle(hMTE); 169 187 if (pMTE != NULL) 170 return getModuleByMTE(pMTE); 171 188 { 189 PMODULE pMod = getModuleByMTE(pMTE); 190 KLOGEXIT(pMod); 191 return pMod; 192 } 193 194 KLOGEXIT(NULL); 172 195 return NULL; 173 196 } … … 184 207 PMODULE getModuleByFilename(PCSZ pszFilename) 185 208 { 209 KLOGENTRY1("PMODULE","PCSZ pszFilename", pszFilename); 186 210 pszFilename = pszFilename; 211 KLOGEXIT(NULL); 187 212 return NULL; 188 213 } … … 207 232 ULONG addModule(SFN hFile, PMTE pMTE, ULONG fFlags, ModuleBase *pModObj) 208 233 { 234 KLOGENTRY4("ULONG","SFN hFile, PMTE pMTE, ULONG fFlags, ModuleBase * pModObj", hFile, pMTE, fFlags, pModObj); 209 235 PMODULE pMod; 210 236 #ifdef DEBUG … … 214 240 { 215 241 kprintf(("addModule: invalid parameter: hFile = 0\n")); 242 KLOGEXIT(ERROR_INVALID_PARAMETER); 216 243 return ERROR_INVALID_PARAMETER; 217 244 } … … 219 246 { 220 247 kprintf(("addModule: invalid parameter: fFlags = 0x%#8x\n", fFlags)); 248 KLOGEXIT(ERROR_INVALID_PARAMETER); 221 249 return ERROR_INVALID_PARAMETER; 222 250 } … … 228 256 { 229 257 kprintf(("addModule: out of memory!\n")); 258 KLOGEXIT(ERROR_NOT_ENOUGH_MEMORY); 230 259 return ERROR_NOT_ENOUGH_MEMORY; 231 260 } … … 247 276 } 248 277 278 KLOGEXIT(NO_ERROR); 249 279 return NO_ERROR; 250 280 } … … 265 295 ULONG removeModule(SFN hFile) 266 296 { 297 KLOGENTRY1("ULONG","SFN hFile", hFile); 267 298 PMODULE pMod = (PMODULE)AVLULRemove(&pSFNRoot, (AVLULKEY)hFile); 268 299 if (pMod == NULL) 269 300 { 270 301 kprintf(("removeModule: Module not found! hFile=%#4x\n", hFile)); 302 KLOGEXIT(ERROR_INVALID_PARAMETER); 271 303 return ERROR_INVALID_PARAMETER; 272 304 } … … 300 332 free(pMod); 301 333 334 KLOGEXIT(NO_ERROR); 302 335 return NO_ERROR; 303 336 } … … 317 350 PSZ ldrGetExePath(PSZ pszPath, BOOL fExecChild) 318 351 { 352 KLOGENTRY2("PSZ","PSZ pszPath, BOOL fExecChild", pszPath, fExecChild); 319 353 PCSZ pszFilename; 320 354 PCSZ psz; … … 355 389 { /* Not called at task time? No current task! */ 356 390 kprintf(("ldrGetExePath: Failed to get current PTDA.\n")); 391 KLOGEXIT(NULL); 357 392 return NULL; 358 393 } … … 362 397 { 363 398 kprintf(("ldrGetExePath: Failed to get hMTE from the PTDAs.\n")); 399 KLOGEXIT(NULL); 364 400 return NULL; 365 401 } … … 370 406 { 371 407 kprintf(("ldrGetExePath: ldrASMpMTEFromHandle failed for hMTE=0x%04.\n", hMTE)); 408 KLOGEXIT(NULL); 372 409 return NULL; 373 410 } … … 375 412 { 376 413 kprintf(("ldrGetExePath: mte_swapmte is NULL.\n")); 414 KLOGEXIT(NULL); 377 415 return NULL; 378 416 } … … 383 421 { 384 422 kprintf(("ldrGetExePath: smte_path is NULL.\n")); 423 KLOGEXIT(NULL); 385 424 return NULL; 386 425 } … … 391 430 { 392 431 kprintf(("ldrGetExePath: pszFilename is empty!\n")); 432 KLOGEXIT(NULL); 393 433 return NULL; 394 434 } … … 407 447 { 408 448 kprintf(("ldrGetExePath: Exepath is empty.\n")); 449 KLOGEXIT(NULL); 409 450 return NULL; 410 451 } … … 415 456 memcpy(pszPath, pszFilename, psz - pszFilename); 416 457 pszPath[psz - pszFilename] = '\0'; 458 KLOGEXIT(pszPath); 417 459 return pszPath; 418 460 } … … 425 467 ULONG ldrInit(void) 426 468 { 469 KLOGENTRY0("ULONG"); 427 470 int rc = NO_ERROR; 428 471 … … 437 480 ModuleBase::ulInfoLevel = options.ulInfoLevel; 438 481 482 KLOGEXIT(rc); 439 483 return rc; 440 484 } -
TabularUnified branches/splittup/src/win32k/src/mmf.cpp ¶
r8149 r8155 1 /* $Id: mmf.cpp,v 1.1.2. 1 2002-03-31 20:09:14bird Exp $1 /* $Id: mmf.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $ 2 2 * 3 3 * Memory Mapped Files. … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: mmf.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $"; 12 #endif 10 13 11 14 /** @design Memory Mapped Files - Ring 0 -
TabularUnified branches/splittup/src/win32k/src/myLDRGetProcAddr.cpp ¶
r8149 r8155 1 /* $Id: myLDRGetProcAddr.cpp,v 1.1.2. 1 2002-03-31 20:09:14bird Exp $1 /* $Id: myLDRGetProcAddr.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $ 2 2 * 3 3 * LDRGetProcAddr - Get an entry point to a module. … … 9 9 * 10 10 */ 11 #ifndef NOFILEID 12 static const char szFileId[] = "$Id: myLDRGetProcAddr.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $"; 13 #endif 11 14 12 15 /******************************************************************************* … … 24 27 *******************************************************************************/ 25 28 #include <os2.h> 26 #include <peexe.h>27 #include <exe386.h>29 #include "LXexe.h" /* OS/2 LX structs and definitions. */ 30 #include "PEexe.h" /* Wine PE structs and definitions. */ 28 31 #include <OS2Krnl.h> 29 32 #include <kKrnlLib.h> … … 68 71 PULONG pulProcType) 69 72 { 73 KLOGENTRY6("ULONG","HMTE hmte, ULONG ulOrdinal, PCSZ pszName, PULONG pulAddress, BOOL fFlat, PULONG pulProcType", hmte, ulOrdinal, pszName, pulAddress, fFlat, pulProcType); 74 ULONG rc; 70 75 /* 71 76 * Check if the fix is enabled, and needed, and possible to apply. … … 82 87 * Let the real function do rest of the work. 83 88 */ 84 return LDRGetProcAddr(hmte, ulOrdinal, pszName, pulAddress, fFlat, pulProcType); 89 rc = LDRGetProcAddr(hmte, ulOrdinal, pszName, pulAddress, fFlat, pulProcType); 90 KLOGEXIT(rc); 91 return rc; 85 92 } 86 93 -
TabularUnified branches/splittup/src/win32k/src/myLDRQAppType.cpp ¶
r8149 r8155 1 /* $Id: myLDRQAppType.cpp,v 1.1.2. 1 2002-03-31 20:09:15bird Exp $1 /* $Id: myLDRQAppType.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $ 2 2 * 3 3 * _myLDRQAppType - _LDRQAppType overload. … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: myLDRQAppType.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $"; 12 #endif 10 13 11 14 /******************************************************************************* … … 46 49 ULONG LDRCALL myLDRQAppType(ULONG p1, ULONG p2) 47 50 { 51 KLOGENTRY2("ULONG","ULONG p1, ULONG p2", p1, p2); 48 52 APIRET rc; 49 53 50 kprintf(("myLDRQAppType: entry\n"));51 54 rc = KSEMRequestMutex(ptda_ptda_ptdasem(ptdaGetCur()), KSEM_INDEFINITE_WAIT); 52 55 if (rc != NO_ERROR) 53 56 { 54 57 kprintf(("myLDRQAppType: failed to get intra-process semaphore.\n")); 58 KLOGEXIT(rc); 55 59 return rc; 56 60 } … … 59 63 { 60 64 kprintf(("myLDRQAppType: failed to get loader semaphore.\n")); 65 KLOGEXIT(rc); 61 66 return rc; 62 67 } … … 72 77 LDRClearSem(); 73 78 KSEMReleaseMutex(ptda_ptda_ptdasem(ptdaGetCur())); 74 kprintf(("myLDRQAppType: exit\n"));75 79 80 KLOGEXIT(rc); 76 81 return rc; 77 82 } -
TabularUnified branches/splittup/src/win32k/src/myVMAllocMem.cpp ¶
r8149 r8155 1 /* $Id: myVMAllocMem.cpp,v 1.1.2. 1 2002-03-31 20:09:15bird Exp $1 /* $Id: myVMAllocMem.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $ 2 2 * 3 3 * Debug module - overloads VMAllocMem to analyse input parameters.... … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: myVMAllocMem.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $"; 12 #endif 10 13 11 14 /******************************************************************************* … … 51 54 APIRET KRNLCALL myVMAllocMem(ULONG p1, ULONG p2, ULONG p3, USHORT p4, USHORT p5, USHORT p6, ULONG p7, ULONG p8, ULONG p9) 52 55 { 56 KLOGENTRY9("APIRET","ULONG p1, ULONG p2, ULONG p3, USHORT p4, USHORT p5, USHORT p6, ULONG p7, ULONG p8, ULONG p9", p1, p2, p3, p4, p5, p6, p7, p8, p9); 53 57 APIRET rc; 54 58 55 59 rc = VMAllocMem(p1,p2,p3,p4,p5,p6,p7,p8,(PVMAC)p9); 56 60 61 KLOGEXIT(rc); 57 62 return rc; 58 63 } -
TabularUnified branches/splittup/src/win32k/src/myldrCheckInternalName.cpp ¶
r8149 r8155 1 /* $Id: myldrCheckInternalName.cpp,v 1.1.2. 1 2002-03-31 20:09:15bird Exp $1 /* $Id: myldrCheckInternalName.cpp,v 1.1.2.2 2002-04-01 09:06:08 bird Exp $ 2 2 * 3 3 * ldrCheckInternalName - ldrCheckInternalName replacement with support for … … 9 9 * 10 10 */ 11 11 #ifndef NOFILEID 12 static const char szFileId[] = "$Id: myldrCheckInternalName.cpp,v 1.1.2.2 2002-04-01 09:06:08 bird Exp $"; 13 #endif 12 14 13 15 /******************************************************************************* … … 25 27 *******************************************************************************/ 26 28 #include <os2.h> 27 #include <peexe.h>28 #include <exe386.h>29 #include "LXexe.h" /* OS/2 LX structs and definitions. */ 30 #include "PEexe.h" /* Wine PE structs and definitions. */ 29 31 #include <OS2Krnl.h> 30 32 #include <kKrnlLib.h> … … 62 64 ULONG LDRCALL myldrCheckInternalName(PMTE pMTE) 63 65 { 66 KLOGENTRY1("ULONG","PMTE pMTE", pMTE); 64 67 /* Check if this feature is enabled */ 65 68 if (isDllFixesDisabled()) … … 69 72 kprintf(("myldrCheckInternalName: pMTE=0x%08x intname=%.*s path=%s rc=%d\n", /* (original)\",*/ 70 73 pMTE, *(PCHAR)pMTE->mte_swapmte->smte_restab, (PCHAR)pMTE->mte_swapmte->smte_restab + 1, ldrpFileNameBuf, rc)); 74 KLOGEXIT(rc); 71 75 return rc; 72 76 #else 73 return ldrCheckInternalName(pMTE); 77 ULONG rc = ldrCheckInternalName(pMTE); 78 KLOGEXIT(rc); 79 return rc; 74 80 #endif 75 81 } … … 90 96 */ 91 97 if (!(pMTE->mte_flags1 & LIBRARYMOD)) 98 { 99 KLOGEXIT(NO_ERROR); 92 100 return NO_ERROR; 101 } 93 102 94 103 … … 185 194 pMTE, *(PCHAR)pMTE->mte_swapmte->smte_restab, (PCHAR)pMTE->mte_swapmte->smte_restab + 1, ldrpFileNameBuf, rc)); 186 195 196 KLOGEXIT(rc); 187 197 return rc; 188 198 } -
TabularUnified branches/splittup/src/win32k/src/myldrClose.cpp ¶
r8149 r8155 1 /* $Id: myldrClose.cpp,v 1.1.2. 1 2002-03-31 20:09:16bird Exp $1 /* $Id: myldrClose.cpp,v 1.1.2.2 2002-04-01 09:06:08 bird Exp $ 2 2 * 3 3 * myldrClose - ldrClose … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: myldrClose.cpp,v 1.1.2.2 2002-04-01 09:06:08 bird Exp $"; 12 #endif 10 13 11 14 /******************************************************************************* … … 22 25 *******************************************************************************/ 23 26 #include <os2.h> 24 #include <peexe.h>25 #include <exe386.h>27 #include "LXexe.h" /* OS/2 LX structs and definitions. */ 28 #include "PEexe.h" /* Wine PE structs and definitions. */ 26 29 #include <OS2Krnl.h> 27 30 #include <kKrnlLib.h> … … 44 47 ULONG LDRCALL myldrClose(SFN hFile) 45 48 { 49 KLOGENTRY1("ULONG","SFN hFile", hFile); 50 ULONG rc; 46 51 /* closes handle */ 47 52 kprintf(("myldrClose: hFile = %.4x\n", hFile)); … … 77 82 * Finally call the real close function. 78 83 */ 79 return ldrClose(hFile); 84 rc = ldrClose(hFile); 85 KLOGEXIT(rc); 86 return rc; 80 87 } -
TabularUnified branches/splittup/src/win32k/src/myldrEnum32bitRelRecs.cpp ¶
r8149 r8155 1 /* $Id: myldrEnum32bitRelRecs.cpp,v 1.1.2. 1 2002-03-31 20:09:16bird Exp $1 /* $Id: myldrEnum32bitRelRecs.cpp,v 1.1.2.2 2002-04-01 09:06:08 bird Exp $ 2 2 * 3 3 * myldrEnum32bitRelRecs - ldrEnum32bitRelRecs … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: myldrEnum32bitRelRecs.cpp,v 1.1.2.2 2002-04-01 09:06:08 bird Exp $"; 12 #endif 10 13 11 14 /******************************************************************************* … … 23 26 *******************************************************************************/ 24 27 #include <os2.h> 25 #include <peexe.h>26 #include <exe386.h>28 #include "LXexe.h" /* OS/2 LX structs and definitions. */ 29 #include "PEexe.h" /* Wine PE structs and definitions. */ 27 30 #include <OS2Krnl.h> 28 31 #include <kKrnlLib.h> … … 58 61 ) 59 62 { 63 KLOGENTRY6("ULONG","PMTE pMTE, ULONG iObject, ULONG iPageTable, PVOID pvPage, ULONG ulPageAddress, PVOID pvPTDA", pMTE, iObject, iPageTable, pvPage, ulPageAddress, pvPTDA); 60 64 PMODULE pMod; 65 ULONG rc; 61 66 62 67 pMod = getModuleByMTE(pMTE); … … 72 77 rc = pMod->Data.pModule->applyFixups(pMTE, iObject, iPageTable, pvPage, ulPageAddress, pvPTDA); 73 78 if (rc != NO_ERROR) 79 KLOGEXIT(rc); 74 80 return rc; 75 81 } 76 82 77 return ldrEnum32bitRelRecs(pMTE, iObject, iPageTable, pvPage, ulPageAddress, pvPTDA); 83 rc = ldrEnum32bitRelRecs(pMTE, iObject, iPageTable, pvPage, ulPageAddress, pvPTDA); 84 KLOGEXIT(rc); 85 return rc; 78 86 } -
TabularUnified branches/splittup/src/win32k/src/myldrFindModule.cpp ¶
r8149 r8155 1 /* $Id: myldrFindModule.cpp,v 1.1.2. 1 2002-03-31 20:09:16bird Exp $1 /* $Id: myldrFindModule.cpp,v 1.1.2.2 2002-04-01 09:06:08 bird Exp $ 2 2 * 3 3 * ldrFindModule - ldrFindModule replacement with support for long DLL names … … 9 9 * 10 10 */ 11 #ifndef NOFILEID 12 static const char szFileId[] = "$Id: myldrFindModule.cpp,v 1.1.2.2 2002-04-01 09:06:08 bird Exp $"; 13 #endif 11 14 12 15 /******************************************************************************* … … 23 26 *******************************************************************************/ 24 27 #include <os2.h> 25 #include <peexe.h>26 #include <exe386.h>28 #include "LXexe.h" /* OS/2 LX structs and definitions. */ 29 #include "PEexe.h" /* Wine PE structs and definitions. */ 27 30 #include <OS2Krnl.h> 28 31 #include <kKrnlLib.h> … … 69 72 ULONG LDRCALL myldrFindModule(PCHAR pachFilename, USHORT cchFilename, USHORT usClass, PPMTE ppMTE) 70 73 { 74 KLOGENTRY4("ULONG","PCHAR pachFilename, USHORT cchFilename, USHORT usClass, PPMTE ppMTE", pachFilename, cchFilename, usClass, ppMTE); 71 75 /* 72 76 * Log. … … 87 91 *ppMTE, (*ppMTE)->mte_handle, (*ppMTE)->mte_modname, 88 92 (*ppMTE)->mte_swapmte->smte_path, (*ppMTE)->mte_flags1 & CLASS_MASK)); 93 KLOGEXIT(rc); 89 94 return rc; 90 95 #else 96 KLOGEXIT(ldrFindModule(pachFilename, cchFilename, usClass, ppMTE)); 91 97 return ldrFindModule(pachFilename, cchFilename, usClass, ppMTE); 92 98 #endif … … 122 128 { 123 129 kprintf(("myldrFindModule: Unknown class flag! usClass=%d\n", usClass)); 130 KLOGEXIT(ldrFindModule(pachFilename, cchFilename, usClass, ppMTE)); 124 131 return ldrFindModule(pachFilename, cchFilename, usClass, ppMTE); 125 132 } … … 129 136 { 130 137 kprintf(("myldrFindModule: Invalid pointer(s); pachFilename=0x%08x ppMTE=0x%08x", pachFilename, ppMTE)); 138 KLOGEXIT(ERROR_INVALID_ACCESS); 131 139 return ERROR_INVALID_ACCESS; 132 140 } … … 140 148 *ppMTE = NULL; 141 149 kprintf(("myldrFindModule: Not found; cchFilename = 0\n")); 150 KLOGEXIT(ERROR_FILE_NOT_FOUND); 142 151 return ERROR_FILE_NOT_FOUND; 143 152 } … … 162 171 rc = ldrTransPath(pachFilename); 163 172 if (rc) 173 { 174 KLOGEXIT(rc); 164 175 return rc; 176 } 165 177 pachFilename = ldrpFileNameBuf; 166 178 cchFilename = (USHORT)(strlen(pachFilename) + 1); … … 224 236 { 225 237 kprintf(("myldrFindModule: Invalid name in class global; name=%.*s\n", cchFilename, pachFilename)); 238 KLOGEXIT(ERROR_INVALID_NAME); 226 239 return ERROR_INVALID_NAME; 227 240 } … … 240 253 { 241 254 kprintf(("myldrFindModule: Invalid name! ldrGetFileName2 failed; name=%.*s\n", cchFilename, pachFilename)); 255 KLOGEXIT(ERROR_INVALID_NAME); 242 256 return ERROR_INVALID_NAME; 243 257 } … … 366 380 kprintf(("myldrFindModule: Found pmte=0x%08x hmte=0x%04x modname=%.8s path=%s (GLOBAL)\n", 367 381 pmte, pmte->mte_handle, pmte->mte_modname, pmte->mte_swapmte->smte_path)); 382 KLOGEXIT(NO_ERROR); 368 383 return NO_ERROR; 369 384 } … … 386 401 kprintf(("myldrFindModule: Found pmte=0x%08x hmte=0x%04x modname=%.8s path=%s (%x)\n", 387 402 pmte, pmte->mte_handle, pmte->mte_modname, pSMTE->smte_path, pmte->mte_flags1 & CLASS_MASK)); 403 KLOGEXIT(NO_ERROR); 388 404 return NO_ERROR; 389 405 } … … 397 413 *ppMTE = NULL; 398 414 kprintf(("myldrFindModule: Not Found\n")); 415 KLOGEXIT(NO_ERROR); 399 416 return NO_ERROR; 400 417 } -
TabularUnified branches/splittup/src/win32k/src/myldrOpen.cpp ¶
r8149 r8155 1 /* $Id: myldrOpen.cpp,v 1.1.2. 1 2002-03-31 20:09:17bird Exp $1 /* $Id: myldrOpen.cpp,v 1.1.2.2 2002-04-01 09:06:09 bird Exp $ 2 2 * 3 3 * myldrOpen - ldrOpen. … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: myldrOpen.cpp,v 1.1.2.2 2002-04-01 09:06:09 bird Exp $"; 12 #endif 10 13 11 14 … … 29 32 *******************************************************************************/ 30 33 #include <os2.h> 31 #include <peexe.h> 32 #include <exe386.h> 34 #include "MZexe.h" /* LX structs and definitions. */ 35 #include "LXexe.h" /* LX structs and definitions. */ 36 #include "PEexe.h" /* PE structs and definitions. */ 37 #include "ELFexe.h" /* ELF structs and definitions. */ 33 38 #include <OS2Krnl.h> 34 39 #include <kKrnlLib.h> … … 41 46 42 47 #include "options.h" 43 #include "elf.h"44 #include "OS2Krnl.h"45 48 #include "dev32.h" 46 49 #include "ldr.h" … … 69 72 ULONG LDRCALL myldrOpen(PSFN phFile, PSZ pszFilename, PULONG pfl) 70 73 { 74 KLOGENTRY3("ULONG","PSFN phFile, PSZ pszFilename, PULONG pfl", phFile, pszFilename, pfl); 71 75 static int cNesting = 0; /* This is an variable which hold the nesting */ 72 76 /* level of this function. This is useful */ … … 779 783 *pfl &= ~0x1000UL; /* 0x1000 is the fixed media flag. */ 780 784 785 KLOGEXIT(rc); 781 786 return rc; 782 787 } … … 810 815 APIRET AddArgsToFront(int cArgs, ...) 811 816 { 817 KLOGENTRY2("APIRET","int cArgs, ...", cArgs, &cArgs); 812 818 va_list vaarg; /* Variable length argument list. */ 813 819 int cchOldArgs; /* Length of the old arguments (including the first argument). */ … … 832 838 { 833 839 kprintf(("AddArgsToFront: not in tkExecPgm state.\n")); 840 KLOGEXIT(ERROR_INVALID_PARAMETER); 834 841 return ERROR_INVALID_PARAMETER; 835 842 } … … 838 845 { 839 846 kprintf(("AddArgsToFront: called when not in tkExecPgm data is invalid!\n")); 847 KLOGEXIT(ERROR_INVALID_PARAMETER); 840 848 return ERROR_INVALID_PARAMETER; 841 849 } … … 855 863 { 856 864 kprintf(("AddArgsToFront: the size of the arguments to add is zero!\n")); 865 KLOGEXIT(ERROR_INVALID_PARAMETER); 857 866 return ERROR_INVALID_PARAMETER; 858 867 } … … 870 879 kprintf(("AddArgsToFront: argument buffer is too small to hold the arguments to add, cchOldArgs=%d, cchNewArgs=%d\n", 871 880 cchOldArgs, cchNewArgs)); 881 KLOGEXIT(ERROR_BAD_ARGUMENTS); 872 882 return ERROR_BAD_ARGUMENTS; 873 883 } … … 914 924 #endif 915 925 926 KLOGEXIT(NO_ERROR); 916 927 return NO_ERROR; 917 928 } … … 932 943 APIRET SetExecName(const char *pszExecName) 933 944 { 945 KLOGENTRY1("APIRET","const char * pszExecName", pszExecName); 934 946 #ifdef DEBUG 935 947 int cch; … … 938 950 { 939 951 kprintf(("ChangeExecName: filename is too long! cch=%d. name=%s\n", cch, pszExecName)); 952 KLOGEXIT(ERROR_FILENAME_EXCED_RANGE); 940 953 return ERROR_FILENAME_EXCED_RANGE; 941 954 } … … 943 956 { 944 957 kprintf(("ChangeExecName: called when not in tkExecPgm state!!! FATAL ERROR!\n")); 958 KLOGEXIT(ERROR_INVALID_PARAMETER); 945 959 return ERROR_INVALID_PARAMETER; 946 960 } … … 949 963 { 950 964 kprintf(("ChangeExecName: called when not in tkExecPgm data is invalid!!! FATAL ERROR!\n")); 965 KLOGEXIT(ERROR_INVALID_PARAMETER); 951 966 return ERROR_INVALID_PARAMETER; 952 967 } … … 954 969 strcpy(achTkExecPgmFilename, pszExecName); 955 970 971 KLOGEXIT(0); 956 972 return 0; 957 973 } … … 974 990 APIRET OpenPATH(PSFN phFile, char *pszFilename, PULONG pfl) 975 991 { 992 KLOGENTRY3("APIRET","PSFN phFile, char * pszFilename, PULONG pfl", phFile, pszFilename, pfl); 976 993 APIRET rc; 977 994 USHORT TCBFailErr_save; … … 984 1001 */ 985 1002 if (pszPath == NULL) 1003 { 1004 KLOGEXIT(ERROR_FILE_NOT_FOUND); 986 1005 return ERROR_FILE_NOT_FOUND; 1006 } 987 1007 988 1008 /**@sketch … … 1076 1096 default: 1077 1097 tcbSetTCBFailErr(tcbGetCur(), TCBFailErr_save); 1098 KLOGEXIT(rc); 1078 1099 return rc; 1079 1100 } … … 1097 1118 *phFile = 0; 1098 1119 tcbSetTCBFailErr(tcbGetCur(), TCBFailErr_save); 1120 KLOGEXIT(ERROR_FILE_NOT_FOUND); 1099 1121 return ERROR_FILE_NOT_FOUND; 1100 1122 } -
TabularUnified branches/splittup/src/win32k/src/myldrOpenPath.cpp ¶
r8149 r8155 1 /* $Id: myldrOpenPath.cpp,v 1.1.2. 1 2002-03-31 20:09:18bird Exp $1 /* $Id: myldrOpenPath.cpp,v 1.1.2.2 2002-04-01 09:06:09 bird Exp $ 2 2 * 3 3 * myldrOpenPath - ldrOpenPath used to open executables we'll override … … 9 9 * 10 10 */ 11 #ifndef NOFILEID 12 static const char szFileId[] = "$Id: myldrOpenPath.cpp,v 1.1.2.2 2002-04-01 09:06:09 bird Exp $"; 13 #endif 11 14 12 15 /******************************************************************************* … … 25 28 *******************************************************************************/ 26 29 #include <os2.h> 27 #include <peexe.h>28 #include <exe386.h>30 #include "LXexe.h" /* OS/2 LX structs and definitions. */ 31 #include "PEexe.h" /* Wine PE structs and definitions. */ 29 32 #include <OS2Krnl.h> 30 33 #include <kKrnlLib.h> … … 91 94 ) 92 95 { 93 96 KLOGENTRY5("ULONG","PCHAR pachFilename, USHORT cchFilename, ldrlv_t * plv, PULONG pful, ULONG lLibPath", pachFilename, cchFilename, plv, pful, lLibPath); 94 97 APIRET rc; 95 98 … … 108 111 pachFilename, cchFilename, plv, pful 109 112 )); 113 KLOGEXIT(ldrOpenPath(pachFilename, cchFilename, plv, pful, lLibPath)); 110 114 return ldrOpenPath(pachFilename, cchFilename, plv, pful, lLibPath); 111 115 } … … 209 213 fldrOpenExtentionFix = FALSE; 210 214 215 KLOGEXIT(rc); 211 216 return rc; 212 217 } … … 225 230 ) 226 231 { 227 return myldrOpenPath(pachFilename, cchFilename, plv, pful, 3); 232 KLOGENTRY4("ULONG","PCHAR pachFilename, USHORT cchFilename, ldrlv_t * plv, PULONG pful", pachFilename, cchFilename, plv, pful); 233 ULONG rc = myldrOpenPath(pachFilename, cchFilename, plv, pful, 3); 234 KLOGEXIT(rc); 235 return rc; 228 236 } 229 237 -
TabularUnified branches/splittup/src/win32k/src/myldrRead.cpp ¶
r8149 r8155 1 /* $Id: myldrRead.cpp,v 1.1.2. 1 2002-03-31 20:09:18bird Exp $1 /* $Id: myldrRead.cpp,v 1.1.2.2 2002-04-01 09:06:09 bird Exp $ 2 2 * 3 3 * myldrRead - ldrRead. … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: myldrRead.cpp,v 1.1.2.2 2002-04-01 09:06:09 bird Exp $"; 12 #endif 10 13 11 14 /******************************************************************************* … … 22 25 *******************************************************************************/ 23 26 #include <os2.h> 24 #include <peexe.h>25 #include <exe386.h>27 #include "LXexe.h" /* OS/2 LX structs and definitions. */ 28 #include "PEexe.h" /* Wine PE structs and definitions. */ 26 29 #include <OS2Krnl.h> 27 30 #include <kKrnlLib.h> … … 66 69 ) 67 70 { 71 KLOGENTRY6("ULONG","SFN hFile, ULONG ulOffset, PVOID pvBuffer, ULONG fpBuffer, ULONG cbToRead, PMTE pMTE", hFile, ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE); 68 72 ULONG rc; 69 73 … … 105 109 #endif 106 110 111 KLOGEXIT(rc); 107 112 return rc; 108 113 } -
TabularUnified branches/splittup/src/win32k/src/myldrSetVMflags.cpp ¶
r8149 r8155 1 /* $Id: myldrSetVMflags.cpp,v 1.1.2. 1 2002-03-31 20:09:19bird Exp $1 /* $Id: myldrSetVMflags.cpp,v 1.1.2.2 2002-04-01 09:06:10 bird Exp $ 2 2 * 3 3 * myldrSetVMflags - ldrSetVMflags … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: myldrSetVMflags.cpp,v 1.1.2.2 2002-04-01 09:06:10 bird Exp $"; 12 #endif 10 13 11 14 /******************************************************************************* … … 25 28 *******************************************************************************/ 26 29 #include <os2.h> 27 #include <peexe.h>28 #include <exe386.h>30 #include "LXexe.h" /* OS/2 LX structs and definitions. */ 31 #include "PEexe.h" /* Wine PE structs and definitions. */ 29 32 #include <OS2Krnl.h> 30 33 #include <kKrnlLib.h> … … 52 55 VOID LDRCALL myldrSetVMflags(PMTE pMTE, ULONG flObj, PULONG pflFlags1, PULONG pflFlags2) 53 56 { 57 KLOGENTRY4("VOID","PMTE pMTE, ULONG flObj, PULONG pflFlags1, PULONG pflFlags2", pMTE, flObj, pflFlags1, pflFlags2); 54 58 /* 55 59 * call the orignal and let it do it's work. … … 71 75 )); 72 76 } 77 KLOGEXITVOID(); 73 78 } -
TabularUnified branches/splittup/src/win32k/src/myldrWasLoadModuled.cpp ¶
r8149 r8155 1 /* $Id: myldrWasLoadModuled.cpp,v 1.1.2. 1 2002-03-31 20:09:19bird Exp $1 /* $Id: myldrWasLoadModuled.cpp,v 1.1.2.2 2002-04-01 09:06:10 bird Exp $ 2 2 * 3 3 * ldrWasLoadModuled - Tells OS/2 that the executable module was LoadModuled … … 10 10 * 11 11 */ 12 #ifndef NOFILEID 13 static const char szFileId[] = "$Id: myldrWasLoadModuled.cpp,v 1.1.2.2 2002-04-01 09:06:10 bird Exp $"; 14 #endif 12 15 13 16 /******************************************************************************* … … 25 28 *******************************************************************************/ 26 29 #include <os2.h> 27 #include <peexe.h> 28 #include <exe386.h> 30 #include "NEexe.h" /* Wine NE structs and definitions. */ 31 #include "LXexe.h" /* OS/2 LX structs and definitions. */ 32 #include "PEexe.h" /* Wine PE structs and definitions. */ 29 33 #include <OS2Krnl.h> 30 34 #include <kKrnlLib.h> … … 62 66 ULONG LDRCALL myldrWasLoadModuled(HMTE hmte, PPTDA pptda, PULONG pcUsage) 63 67 { 68 KLOGENTRY3("ULONG","HMTE hmte, PPTDA pptda, PULONG pcUsage", hmte, pptda, pcUsage); 69 ULONG rc; 70 64 71 /* 65 72 * Check if the fix is enabled. … … 82 89 * Let the real function do the work. 83 90 */ 84 return ldrWasLoadModuled(hmte, pptda, pcUsage); 91 rc = ldrWasLoadModuled(hmte, pptda, pcUsage); 92 KLOGEXIT(rc); 93 return rc; 85 94 } 86 95 -
TabularUnified branches/splittup/src/win32k/src/pe2lx.cpp ¶
r8149 r8155 1 /* $Id: pe2lx.cpp,v 1.1.2. 1 2002-03-31 20:09:20 bird Exp $1 /* $Id: pe2lx.cpp,v 1.1.2.2 2002-04-01 09:06:10 bird Exp $ 2 2 * 3 3 * Pe2Lx class implementation. Ring 0 and Ring 3 … … 10 10 * 11 11 */ 12 #ifndef NOFILEID 13 static const char szFileId[] = "$Id: pe2lx.cpp,v 1.1.2.2 2002-04-01 09:06:10 bird Exp $"; 14 #endif 12 15 13 16 … … 30 33 #define Yield() DosSleep(0) 31 34 #endif 32 35 #define DWORD ULONG 36 #define PDWORD PULONG 33 37 34 38 /* … … 84 88 *******************************************************************************/ 85 89 #include <os2.h> /* OS/2 header file. */ 86 #include <peexe.h> /* Wine PE structs and definitions. */87 #include <neexe.h>/* Wine NE structs and definitions. */88 #include <newexe.h> /* OS/2 NEstructs and definitions. */89 #include <exe386.h> /* OS/2 LXstructs and definitions. */90 #include "MZexe.h" /* Wine NE structs and definitions. */ 91 #include "NEexe.h" /* Wine NE structs and definitions. */ 92 #include "LXexe.h" /* OS/2 LX structs and definitions. */ 93 #include "PEexe.h" /* Wine PE structs and definitions. */ 90 94 #include <OS2Krnl.h> /* kernel structs. (SFN) */ 91 95 #include <kKrnlLib.h> … … 107 111 #include "modulebase.h" /* ModuleBase class definitions, ++. */ 108 112 #include "pe2lx.h" /* Pe2Lx class definitions, ++. */ 113 #define WIN32API 109 114 #include <versionos2.h> /* Pe2Lx version. */ 110 115 #include "options.h" /* Win32k options. */ … … 1137 1142 if (pbr->VirtualAddress + PAGESIZE >= ulRVAPage) 1138 1143 { 1139 P WORDpwoffFixup = &pbr->TypeOffset[0];1140 ULONG cRelocations = (pbr->SizeOfBlock - offsetof(IMAGE_BASE_RELOCATION, TypeOffset)) / sizeof( WORD); /* note that sizeof(BaseReloc) is 12 bytes! */1144 PUSHORT pwoffFixup = &pbr->TypeOffset[0]; 1145 ULONG cRelocations = (pbr->SizeOfBlock - offsetof(IMAGE_BASE_RELOCATION, TypeOffset)) / sizeof(USHORT); /* note that sizeof(BaseReloc) is 12 bytes! */ 1141 1146 1142 1147 /* Some bound checking just to be sure it works... */ … … 1144 1149 { 1145 1150 printWar(("Block ends after BaseRelocation datadirectory.\n")); 1146 cRelocations = (((unsigned)pBaseRelocs + cbBaseRelocs) - (unsigned)pbr - offsetof(IMAGE_BASE_RELOCATION, TypeOffset)) / sizeof( WORD);1151 cRelocations = (((unsigned)pBaseRelocs + cbBaseRelocs) - (unsigned)pbr - offsetof(IMAGE_BASE_RELOCATION, TypeOffset)) / sizeof(USHORT); 1147 1152 } 1148 1153 … … 1408 1413 if (pbr->VirtualAddress + PAGESIZE >= ulRVAPage) 1409 1414 { 1410 P WORDpwoffFixup = &pbr->TypeOffset[0];1411 ULONG cRelocations = (pbr->SizeOfBlock - offsetof(IMAGE_BASE_RELOCATION, TypeOffset)) / sizeof( WORD); /* note that sizeof(BaseReloc) is 12 bytes! */1415 PUSHORT pwoffFixup = &pbr->TypeOffset[0]; 1416 ULONG cRelocations = (pbr->SizeOfBlock - offsetof(IMAGE_BASE_RELOCATION, TypeOffset)) / sizeof(USHORT); /* note that sizeof(BaseReloc) is 12 bytes! */ 1412 1417 1413 1418 /* Some bound checking just to be sure it works... */ … … 1415 1420 { 1416 1421 printWar(("Block ends after BaseRelocation datadirectory.\n")); 1417 cRelocations = (((unsigned)pBaseRelocs + cbBaseRelocs) - (unsigned)pbr - offsetof(IMAGE_BASE_RELOCATION, TypeOffset)) / sizeof( WORD);1422 cRelocations = (((unsigned)pBaseRelocs + cbBaseRelocs) - (unsigned)pbr - offsetof(IMAGE_BASE_RELOCATION, TypeOffset)) / sizeof(USHORT); 1418 1423 } 1419 1424 … … 2953 2958 { 2954 2959 printInfA(("TibFix import fixup\n")); 2955 rc = add32OrdImportFixup(( WORD)((paObjects[iObj].Misc.offTIBFix + paObjects[iObj].ulRVA + TIBFIX_OFF_CALLADDRESS) & (PAGESIZE-1UL)),2960 rc = add32OrdImportFixup((USHORT)((paObjects[iObj].Misc.offTIBFix + paObjects[iObj].ulRVA + TIBFIX_OFF_CALLADDRESS) & (PAGESIZE-1UL)), 2956 2961 ul, 2957 2962 pNtHdrs->FileHeader.Characteristics & IMAGE_FILE_DLL ? … … 2975 2980 { 2976 2981 if (Thunk.u1.Ordinal & (ULONG)IMAGE_ORDINAL_FLAG) 2977 rc = add32OrdImportFixup(( WORD)(ulRVAFirstThunk & (PAGESIZE-1)),2982 rc = add32OrdImportFixup((USHORT)(ulRVAFirstThunk & (PAGESIZE-1)), 2978 2983 ulModuleOrdinal, Thunk.u1.Ordinal & 0xffff); 2979 2984 else if (Thunk.u1.Ordinal > 0UL && Thunk.u1.Ordinal < pNtHdrs->OptionalHeader.SizeOfImage) … … 2983 2988 if (rc != NO_ERROR) 2984 2989 break; 2985 rc = add32NameImportFixup(( WORD)(ulRVAFirstThunk & (PAGESIZE-1)),2990 rc = add32NameImportFixup((USHORT)(ulRVAFirstThunk & (PAGESIZE-1)), 2986 2991 ulModuleOrdinal, psz); 2987 2992 free(psz); … … 3045 3050 if (fBaseRelocs && BaseReloc.VirtualAddress == ulRVAPage) 3046 3051 { 3047 ULONG c = (BaseReloc.SizeOfBlock - sizeof(BaseReloc.SizeOfBlock) - sizeof(BaseReloc.VirtualAddress)) / sizeof( WORD); /* note that sizeof(BaseReloc) is 12 bytes! */3048 P WORDpawoffFixup = NULL;3052 ULONG c = (BaseReloc.SizeOfBlock - sizeof(BaseReloc.SizeOfBlock) - sizeof(BaseReloc.VirtualAddress)) / sizeof(USHORT); /* note that sizeof(BaseReloc) is 12 bytes! */ 3053 PUSHORT pawoffFixup = NULL; 3049 3054 3050 3055 if (c != 0) 3051 3056 { 3052 pawoffFixup = (P WORD)malloc((size_t)(c * sizeof(WORD)));3057 pawoffFixup = (PUSHORT)malloc((size_t)(c * sizeof(USHORT))); 3053 3058 if (pawoffFixup != NULL) 3054 3059 rc = pRelocReader->readAtRVA(ulRVABaseReloc + offsetof(IMAGE_BASE_RELOCATION, TypeOffset), 3055 pawoffFixup, c * sizeof( WORD));3060 pawoffFixup, c * sizeof(USHORT)); 3056 3061 else 3057 3062 rc = ERROR_NOT_ENOUGH_MEMORY; … … 3060 3065 for (ul = 0; ul < c && rc == NO_ERROR; ul++) 3061 3066 { 3062 WORDwoffFixup;3067 USHORT woffFixup; 3063 3068 ULONG ulTarget; 3064 3069 /* Get relocation type/offset. */ … … 3074 3079 { 3075 3080 case IMAGE_REL_BASED_HIGHLOW: 3076 rc = add32OffsetFixup(( WORD)(woffFixup & 0x0FFF), ulTarget);3081 rc = add32OffsetFixup((USHORT)(woffFixup & 0x0FFF), ulTarget); 3077 3082 printInfA(("Fixup: 0x%03x target 0x%08x (rc = %d) %s\n", 3078 3083 (woffFixup & 0x0FFF), ulTarget, rc, … … 3305 3310 ) 3306 3311 { 3307 WORDusOrdinal;3312 USHORT usOrdinal; 3308 3313 3309 3314 for (ul = 0; ul < ExpDir.NumberOfNames && rc == NO_ERROR; ul++) … … 3313 3318 if (rc != NO_ERROR) 3314 3319 break; 3315 rc = pFATFOTReader->readAtRVA((ULONG)ExpDir.AddressOfNameOrdinals + ul * sizeof( WORD),3320 rc = pFATFOTReader->readAtRVA((ULONG)ExpDir.AddressOfNameOrdinals + ul * sizeof(USHORT), 3316 3321 SSToDS(&usOrdinal), sizeof(usOrdinal)); 3317 3322 if (rc != NO_ERROR) … … 3676 3681 * This code got a bit dirty while trying to optimize memory usage. 3677 3682 */ 3678 ULONG Pe2Lx::add32OffsetFixup( WORDoffSource, ULONG ulTarget)3683 ULONG Pe2Lx::add32OffsetFixup(USHORT offSource, ULONG ulTarget) 3679 3684 { 3680 3685 struct r32_rlc *prlc; … … 3827 3832 * 3828 3833 */ 3829 ULONG Pe2Lx::add32OrdImportFixup( WORDoffSource, ULONG ulModuleOrdinal, ULONG ulFunctionOrdinal)3834 ULONG Pe2Lx::add32OrdImportFixup(USHORT offSource, ULONG ulModuleOrdinal, ULONG ulFunctionOrdinal) 3830 3835 { 3831 3836 struct r32_rlc *prlc; … … 3952 3957 * 3953 3958 */ 3954 ULONG Pe2Lx::add32NameImportFixup( WORDoffSource, ULONG ulModuleOrdinal, PCSZ pszFnName)3959 ULONG Pe2Lx::add32NameImportFixup(USHORT offSource, ULONG ulModuleOrdinal, PCSZ pszFnName) 3955 3960 { 3956 3961 APIRET rc; … … 5175 5180 { 5176 5181 int i; 5177 WORDw;5182 USHORT w; 5178 5183 5179 5184 printInf(("\nPE-headers - File header\n")); -
TabularUnified branches/splittup/src/win32k/src/xx2lxmain.cpp ¶
r8149 r8155 1 /* $Id: xx2lxmain.cpp,v 1.1.2. 1 2002-03-31 20:09:21 bird Exp $1 /* $Id: xx2lxmain.cpp,v 1.1.2.2 2002-04-01 09:06:11 bird Exp $ 2 2 * 3 3 * Xx2Lx main program. (Ring 3 only!) … … 8 8 * 9 9 */ 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: xx2lxmain.cpp,v 1.1.2.2 2002-04-01 09:06:11 bird Exp $"; 12 #endif 10 13 11 14 /******************************************************************************* … … 25 28 *******************************************************************************/ 26 29 #include <os2.h> 27 #include <peexe.h> 28 #include <neexe.h> 29 #include <newexe.h> 30 #include <exe386.h> 31 #include "elf.h" 30 #include "MZexe.h" /* MZ structs and definitions. */ 31 #include "LXexe.h" /* LX structs and definitions. */ 32 #include "PEexe.h" /* PE structs and definitions. */ 33 #include "ELFexe.h" /* ELF structs and definitions. */ 32 34 #include <malloc.h> 33 35 #include <string.h>
Note:
See TracChangeset
for help on using the changeset viewer.