Changeset 8155


Ignore:
Timestamp:
Apr 1, 2002, 11:06:11 AM (23 years ago)
Author:
bird
Message:

At least it's compiling.

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:03 bird Exp $
     1/* $Id: ModuleBase.cpp,v 1.1.2.2 2002-04-01 09:06:02 bird Exp $
    22 *
    33 * ModuleBase - Implementetation.
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: ModuleBase.cpp,v 1.1.2.2 2002-04-01 09:06:02 bird Exp $";
     12#endif
    1013
    1114/*******************************************************************************
  • TabularUnified branches/splittup/src/win32k/src/Xx2Lx.mak

    r8149 r8155  
    1 # $Id: Xx2Lx.mak,v 1.1.2.1 2002-03-31 20:09:04 bird Exp $
     1# $Id: Xx2Lx.mak,v 1.1.2.2 2002-04-01 09:06:02 bird Exp $
    22
    33#
    4 # Odin32 API
     4# xx2lx makefile.
    55#
    6 #       xx2lx.exe makefile
    76#
    87
    98
    109#
    11 # Tell buildenvironment that we're making an vio exe and to invoke additional dep rule
     10# Load the build setup.
    1211#
    13 VIO=1
    14 EXETARGET=1
     12PATH_ROOT = ..\..\..
     13!include $(PATH_ROOT)\tools\make\setup.mak
    1514
    1615
    1716#
    18 # Compiler, tools, and interference rules thru the win32k makefile.inc file.
     17# Config.
    1918#
    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
     19TARGET_MODE  = EXE
     20TARGET_NAME  = Xx2Lx
     21MAKEFILE     = Xx2Lx.mak
     22TARGET_STACKSIZE = 4096
     23ALL_INCLUDES = -I../include -I../kKrnlLib/include
     24ALL_DEFINES  = -DRING3 -DXX2LX -D__WIN32OS2__ -D__WINE__
     25CC_FLAGS_EXE = $(CC_FLAGS_SYS) -URING0
    7526
    7627
     
    7829# Object files. Prefix with OBJDIR and one space before the '\'.
    7930#
    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.obj
     31TARGET_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
    9243
    9344
     
    9546# Libraries. One space before the '\'.
    9647#
    97 LIBS = \
    98 $(RTLLIB_NRE) \
    99 os2386.lib
     48TARGET_LIBS =\
     49$(LIB_C_OBJ)\
     50$(LIB_OS)\
    10051
    10152
    10253#
    103 # Target name - name of the exe without extention and path.
     54# Load the build process rules.
    10455#
    105 TARGET = xx2lx
     56!include $(MAKE_INCLUDE_PROCESS)
    10657
    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:04 bird Exp $
     1/* $Id: api.cpp,v 1.1.2.2 2002-04-01 09:06:02 bird Exp $
    22 *
    33 * API Overload Init and Helper Function.
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: api.cpp,v 1.1.2.2 2002-04-01 09:06:02 bird Exp $";
     12#endif
    1013
    1114/*******************************************************************************
     
    118121APIRET  apiReadIniFile(PSZ pszIniFile)
    119122{
     123    KLOGENTRY1("APIRET","PSZ pszIniFile", pszIniFile);
    120124    SFN     sfn;
    121125    APIRET  rc;
     
    172176        kprintf(("apiReadIniFile: Failed to open file %s, rc=%d\n", pszIniFile, rc));
    173177
     178    KLOGEXIT(rc);
    174179    return rc;
    175180}
     
    187192APIRET  apiParseIniFile(PSZ pszFile)
    188193{
     194    KLOGENTRY1("APIRET","PSZ pszFile", pszFile);
    189195    PAPIDATAENTRY   paNewApiData;
    190196    PSZ *           ppszFile = (PSZ*)SSToDS(&pszFile);
     
    199205    {
    200206        kprintf(("apiParseIniFile: failed to allocate temporary struct.\n"));
     207        KLOGEXIT(ERROR_NOT_ENOUGH_MEMORY);
    201208        return ERROR_NOT_ENOUGH_MEMORY;
    202209    }
     
    304311    rfree(paNewApiData);
    305312
     313    KLOGEXIT(rc);
    306314    return rc;
    307315}
     
    321329PSZ     apiStripIniLine(PSZ pszFile, PSZ * ppszFile)
    322330{
     331    KLOGENTRY2("PSZ","PSZ pszFile, PSZ * ppszFile", pszFile, ppszFile);
    323332    PSZ     pszComment;
    324333    PSZ     pszLine;
     
    329338     */
    330339    if (*pszFile)
     340    {
     341        KLOGEXIT(NULL);
    331342        return NULL;
     343    }
    332344
    333345    /*
     
    375387    pszComment[1] = '\0';
    376388
     389    KLOGEXIT(pszLine);
    377390    return pszLine;
    378391}
     
    394407int     apiInterpretApiNo(PSZ pszSection)
    395408{
     409    KLOGENTRY1("int","PSZ pszSection", pszSection);
    396410    int iApi = 0;
    397411
    398412    pszSection++;                          /* skip '[' */
    399413    if (*pszSection < '0' || *pszSection > '9')
     414    {
     415        KLOGEXIT(-1);
    400416        return -1;
     417    }
    401418
    402419    while (*pszSection == ' ' || *pszSection == '\t')
     
    409426    }
    410427
     428    KLOGEXIT(iApi);
    411429    return iApi;
    412430}
     
    423441void    apiSortApiData(PAPIDATAENTRY paApiData)
    424442{
     443    KLOGENTRY1("void","PAPIDATAENTRY paApiData", paApiData);
    425444    int i;
    426445
     
    432451        apiSortMaskArray(&paApiData[i].ModuleExc);
    433452    }
     453    KLOGEXITVOID();
    434454}
    435455
     
    447467void    apiSortMaskArray(PMASKARRAY pMasks)
    448468{
     469    KLOGENTRY1("void","PMASKARRAY pMasks", pMasks);
    449470    int i;
    450471    PSZ pszTmp;
     
    469490        }
    470491    } while (pszTmp != NULL);
     492    KLOGEXITVOID();
    471493}
    472494
     
    482504void    apiFreeApiData(PAPIDATAENTRY paApiData)
    483505{
     506    KLOGENTRY1("void","PAPIDATAENTRY paApiData", paApiData);
    484507    int i;
    485508
     
    495518            rfree(paApiData[i].ModuleExc.papszMasks);
    496519    }
     520    KLOGEXITVOID();
    497521}
    498522
     
    510534APIRET  apiWriteIniFile(PSZ pszIniFile)
    511535{
     536    KLOGENTRY1("APIRET","PSZ pszIniFile", pszIniFile);
    512537    SFN     sfn;
    513538    APIRET  rc;
     
    565590        kprintf(("apiWriteIniFile: Failed open %s for write. rc=%d\n", pszIniFile, rc));
    566591
     592    KLOGEXIT(rc);
    567593    return rc;
    568594}
     
    584610APIRET  apiWriteMasks(SFN sfn, PULONG poff, PMASKARRAY pMasks, PSZ pszType, BOOL fEnabled)
    585611{
     612    KLOGENTRY5("APIRET","SFN sfn, PULONG poff, PMASKARRAY pMasks, PSZ pszType, BOOL fEnabled", sfn, poff, pMasks, pszType, fEnabled);
    586613    char    sz[48];
    587614    PSZ     psz = (PSZ)SSToDS(&sz[0]);
     
    595622    rc = apiWriteLine(sfn, poff, psz);
    596623    if (rc != NO_ERROR)
     624    {
     625        KLOGEXIT(rc);
    597626        return rc;
     627    }
    598628
    599629    for (i = 0, rc = NO_ERROR; rc == NO_ERROR && i < pMasks->cMasks; i++)
    600630        rc = apiWriteLine(sfn, poff, pMasks->papszMasks[i]);
    601631
     632    KLOGEXIT(rc);
    602633    return rc;
    603634}
     
    617648APIRET  apiWriteLine(SFN sfn, PULONG poff, PSZ pszString)
    618649{
     650    KLOGENTRY3("APIRET","SFN sfn, PULONG poff, PSZ pszString", sfn, poff, pszString);
    619651    ULONG   cb = strlen(pszString);
    620652    APIRET  rc;
     
    630662    }
    631663
     664    KLOGEXIT(rc);
    632665    return rc;
    633666}
     
    651684    )
    652685{
     686    KLOGENTRY5("APIRET","PSZ pszFilename, ULONG flOpenFlags, ULONG flOpenMode, PSFN phFile, PULONG pulsomething", pszFilename, flOpenFlags, flOpenMode, phFile, pulsomething);
    653687    APIRET  rc;
    654688    ULONG   ulAction = 0;
     
    657691
    658692    pulsomething = pulsomething;
     693    KLOGEXIT(rc);
    659694    return rc;
    660695}
     
    677712    ULONG ulOffset)
    678713{
     714    KLOGENTRY5("APIRET","SFN hFile, PULONG pcbActual, PVOID pvBuffer, ULONG flFlags, ULONG ulOffset", hFile, pcbActual, pvBuffer, flFlags, ulOffset);
    679715    APIRET  rc;
    680716    ULONG   ul;
     
    683719        rc = DosRead(hFile, pvBuffer, *pcbActual, pcbActual);
    684720    flFlags = flFlags;
     721    KLOGEXIT(rc);
    685722    return rc;
    686723}
     
    704741    ULONG ulOffset)
    705742{
     743    KLOGENTRY5("APIRET","SFN hFile, PULONG pcbActual, PVOID pvBuffer, ULONG flFlags, ULONG ulOffset", hFile, pcbActual, pvBuffer, flFlags, ulOffset);
    706744    APIRET  rc;
    707745    ULONG   ul;
     
    710748        rc = DosWrite(hFile, pvBuffer, *pcbActual, pcbActual);
    711749    flFlags = flFlags;
     750    KLOGEXIT(rc);
    712751    return rc;
    713752}
     
    723762    PULONG pcbFile)
    724763{
     764    KLOGENTRY2("APIRET","SFN hFile, PULONG pcbFile", hFile, pcbFile);
    725765    FILESTATUS3 fsts3;
    726766    APIRET      rc;
     
    729769    if (rc == NO_ERROR)
    730770        *pcbFile = fsts3.cbFile;
     771    KLOGEXIT(rc);
    731772    return rc;
    732773}
     
    747788BOOL    apiFindNameInMaskArray(PSZ pszName, PMASKARRAY pMasks)
    748789{
     790    KLOGENTRY2("BOOL","PSZ pszName, PMASKARRAY pMasks", pszName, pMasks);
     791    KLOGEXIT(FALSE);
    749792    return FALSE;
    750793}
     
    767810APIRET  apiGetProccessName(PSZ pszName)
    768811{
     812    KLOGENTRY1("APIRET","PSZ pszName", pszName);
    769813    PPTDA pPTDA = ptdaGetCur();
    770814    if (pPTDA)
     
    789833                if (!psz) psz = psmte->smte_path;
    790834                strcpy(pszName, psz);
     835                KLOGEXIT(NO_ERROR);
    791836                return NO_ERROR;
    792837            }
     
    800845        kprintf(("apiGetProcessName: No current PTDA!\n"));
    801846
     847    KLOGEXIT(ERROR_INVALID_PARAMETER);
    802848    return ERROR_INVALID_PARAMETER;
    803849}
     
    819865APIRET  apiGetModuleName(PSZ pszName, USHORT usCS, ULONG ulEIP)
    820866{
     867    KLOGENTRY3("APIRET","PSZ pszName, USHORT usCS, ULONG ulEIP", pszName, usCS, ulEIP);
    821868    HMTE hmte = VMGetOwner(usCS, ulEIP);
    822869    if (hmte)
     
    838885            if (!psz) psz = psmte->smte_path;
    839886            strcpy(pszName, psz);
     887            KLOGEXIT(NO_ERROR);
    840888            return NO_ERROR;
    841889        }
     
    849897     * We failed.
    850898     */
     899    KLOGEXIT(ERROR_INVALID_PARAMETER);
    851900    return ERROR_INVALID_PARAMETER;
    852901}
     
    870919BOOL _Optlink   APIQueryEnabled(int iApi, USHORT usCS, LONG ulEIP)
    871920{
     921    KLOGENTRY3("BOOL","int iApi, USHORT usCS, LONG ulEIP", iApi, usCS, ulEIP);
    872922    PAPIDATAENTRY   pEntry;
    873923
     
    876926     */
    877927    if (isApiEnhDisabled())
     928    {
     929        KLOGEXIT(FALSE);
    878930        return FALSE;
     931    }
    879932
    880933    /*
     
    925978    RWLockReleaseRead(&ApiInfoRWLock);
    926979
     980    KLOGEXIT(fRet);
    927981    return fRet;
    928982}
     
    939993APIRET _Optlink APIInit(void)
    940994{
     995    KLOGENTRY0("APIRET");
    941996    APIRET  rc;
    942997
    943998    rc = apiReadIniFile(&szWin32kIni[0]);
    944999
     1000    KLOGEXIT(rc);
    9451001    return rc;
    9461002}
  • TabularUnified branches/splittup/src/win32k/src/d32Win32kIOCtl.c

    r8149 r8155  
    1 /* $Id: d32Win32kIOCtl.c,v 1.1.2.1 2002-03-31 20:09:06 bird Exp $
     1/* $Id: d32Win32kIOCtl.c,v 1.1.2.2 2002-04-01 09:06:03 bird Exp $
    22 *
    33 * Win32k driver IOCtl handler function.
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: d32Win32kIOCtl.c,v 1.1.2.2 2002-04-01 09:06:03 bird Exp $";
     12#endif
     13
    1014/*******************************************************************************
    1115*   Defined Constants And Macros                                               *
     
    1620#define INCL_NOPMAPI
    1721#define INCL_OS2KRNL_TK
     22#define INCL_KKL_LOG
    1823
    1924#define NO_WIN32K_LIB_FUNCTIONS
     
    4853USHORT _loadds _Far32 _Pascal Win32kIOCtl(PRP32GENIOCTL pRpIOCtl)
    4954{
     55    KLOGENTRY1("USHORT","PRP32GENIOCTL pRpIOCtl", pRpIOCtl);
    5056    /* validate parameter pointer */
    5157    if (pRpIOCtl == NULL || pRpIOCtl->ParmPacket == NULL
    5258        || pRpIOCtl->Function == 0 || pRpIOCtl->Function > K32_LASTIOCTLFUNCTION)
     59    {
     60        KLOGEXIT(STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER);
    5361        return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
     62    }
    5463
    5564    switch (pRpIOCtl->Category)
     
    6069            if (    rc != 0xdeadbeefUL
    6170                &&  TKSuULongNF(&((PK32HDR)pRpIOCtl->ParmPacket)->rc, SSToDS(&rc)) == NO_ERROR)
     71            {
     72                KLOGEXIT(STATUS_DONE);
    6273                return STATUS_DONE;     /* Successfull return */
     74            }
    6375            break;
    6476            }
    6577    }
    6678
     79    KLOGEXIT(STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER);
    6780    return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
    6881}
  • TabularUnified branches/splittup/src/win32k/src/d32Win32kOpenClose.c

    r8149 r8155  
    1 /* $Id: d32Win32kOpenClose.c,v 1.1.2.1 2002-03-31 20:09:06 bird Exp $
     1/* $Id: d32Win32kOpenClose.c,v 1.1.2.2 2002-04-01 09:06:03 bird Exp $
    22 *
    33 * Open and Close handlers for the Win32k driver.
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: d32Win32kOpenClose.c,v 1.1.2.2 2002-04-01 09:06:03 bird Exp $";
     12#endif
    1013
    1114
     
    5457USHORT _loadds _Far32 _Pascal Win32kOpen(PRP32OPENCLOSE pRpOpen)
    5558{
     59    KLOGENTRY1("USHORT","PRP32OPENCLOSE pRpOpen", pRpOpen);
    5660    APIRET  rc;
    5761    PPTD    pptd;
     
    7377    pRpOpen = pRpOpen;
    7478    LDRClearSem();
     79    KLOGEXIT(STATUS_DONE);
    7580    return STATUS_DONE;
    7681}
     
    8691USHORT _loadds _Far32 _Pascal Win32kClose(PRP32OPENCLOSE pRpClose)
    8792{
     93    KLOGENTRY1("USHORT","PRP32OPENCLOSE pRpClose", pRpClose);
    8894    APIRET  rc;
    8995    PPTD    pptd;
     
    110116
    111117    LDRClearSem();
     118    KLOGEXIT(STATUS_DONE);
    112119    return STATUS_DONE;
    113120}
  • TabularUnified branches/splittup/src/win32k/src/d32globals.c

    r8149 r8155  
    1 /* $Id: d32globals.c,v 1.1.2.1 2002-03-31 20:09:07 bird Exp $
     1/* $Id: d32globals.c,v 1.1.2.2 2002-04-01 09:06:03 bird Exp $
    22 *
    33 * d32globals - global data (32-bit)
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: d32globals.c,v 1.1.2.2 2002-04-01 09:06:03 bird Exp $";
     12#endif
    1013
    1114/*******************************************************************************
  • TabularUnified branches/splittup/src/win32k/src/d32init.c

    r8149 r8155  
    1 /* $Id: d32init.c,v 1.1.2.1 2002-03-31 20:09:07 bird Exp $
     1/* $Id: d32init.c,v 1.1.2.2 2002-04-01 09:06:04 bird Exp $
    22 *
    33 * d32init.c - 32-bits init routines.
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: d32init.c,v 1.1.2.2 2002-04-01 09:06:04 bird Exp $";
     12#endif
    1013
    1114/*******************************************************************************
     
    4952*   Internal Functions                                                         *
    5053*******************************************************************************/
    51  ULONG          readnum(const char *pszNum);
     54ULONG          readnum(const char *pszNum);
    5255
    5356
     
    6871ULONG _System R0Init(RP32INIT *pRpInit)
    6972{
     73    KLOGENTRY1("ULONG _System","RP32INIT * pRpInit", pRpInit);
    7074    char *      pszTmp2;
    7175    char *      pszTmp;
     
    266270    /* loader */
    267271    if ((rc = ldrInit()) != NO_ERROR)
     272    {
     273        KLOGEXIT(rc);
    268274        return rc;
     275    }
    269276
    270277    /* apis */
    271278    #if 0
    272279    if ((rc = APIInit()) != NO_ERROR)
     280    {
     281        KLOGEXIT(rc);
    273282        return rc;
     283    }
    274284    #endif
    275285
     
    279289    {
    280290        kprintf(("R0Init32: InitCallGate failed with rc=%d\n", rc));
     291        KLOGEXIT(rc);
    281292        return rc;
    282293    }
     
    305316        kprintf(("data segment lock failed with with rc=%d\n", rc));
    306317
     318    KLOGEXIT(NO_ERROR);
    307319    return NO_ERROR;
    308320}
     
    318330ULONG    readnum(const char *pszNum)
    319331{
     332    KLOGENTRY1("ULONG","const char * pszNum", pszNum);
    320333    ULONG ulRet = 0;
    321334    ULONG ulBase = 10;
     
    349362    }
    350363
     364    KLOGEXIT(i > 0 ? ulRet : ~0UL);
    351365    return i > 0 ? ulRet : ~0UL;
    352366}
  • TabularUnified branches/splittup/src/win32k/src/elf2lx.cpp

    r8149 r8155  
    1 /* $Id: elf2lx.cpp,v 1.1.2.1 2002-03-31 20:09:08 bird Exp $
     1/* $Id: elf2lx.cpp,v 1.1.2.2 2002-04-01 09:06:04 bird Exp $
    22 *
    33 * Elf2Lx - implementation.
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: elf2lx.cpp,v 1.1.2.2 2002-04-01 09:06:04 bird Exp $";
     12#endif
    1013
    1114
     
    1619#define INCL_DOSERRORS                  /* DOS Error codes. */
    1720#define INCL_OS2KRNL_LDR                /* LdrRead */
     21#define INCL_KKL_LOG
     22#define INCL_KKL_AVL
     23#define INCL_KKL_HEAP
    1824#ifdef RING0
    1925    #define INCL_NOAPI                  /* RING0: No apis. */
     
    2733*******************************************************************************/
    2834#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>
    3941
    4042#include <string.h>                     /* C library string.h. */
     
    4345#include <stdarg.h>                     /* C library stdarg.h. */
    4446
    45 #include "vprintf.h"                    /* win32k printf and vprintf. Not C library! */
     47#include "devSegDf.h"                   /* Win32k segment definitions. */
    4648#include "dev32.h"                      /* 32-Bit part of the device driver. (SSToDS) */
    47 #include "OS2Krnl.h"                    /* kernel structs.  (SFN) */
    48 
    4949#include "modulebase.h"                 /* ModuleBase class definitions, ++. */
    5050#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:08 bird Exp $
     1/* $Id: k32AllocMemEx.cpp,v 1.1.2.2 2002-04-01 09:06:04 bird Exp $
    22 *
    33 * k32AllocMemEx - Equivalent to DosAllocMem, but this one
     
    99 *
    1010 */
     11#ifndef NOFILEID
     12static const char szFileId[] = "$Id: k32AllocMemEx.cpp,v 1.1.2.2 2002-04-01 09:06:04 bird Exp $";
     13#endif
    1114
    1215
     
    106109APIRET k32AllocMemEx(PPVOID ppv, ULONG cb, ULONG flFlags, ULONG ulCS, ULONG ulEIP)
    107110{
     111    KLOGENTRY5("APIRET","PPVOID ppv, ULONG cb, ULONG flFlags, ULONG ulCS, ULONG ulEIP", ppv, cb, flFlags, ulCS, ulEIP);
    108112    APIRET  rc;
    109113    ULONG   flVMFlags;
     
    137141    {
    138142        kprintf(("k32AllocMemEx: Bad param (1)\n"));
     143        KLOGEXIT(ERROR_INVALID_PARAMETER);
    139144        return ERROR_INVALID_PARAMETER;
    140145    }
     
    144149    {
    145150        kprintf(("k32AllocMemEx: Bad size cb=%d\n", cb));
     151        KLOGEXIT(ERROR_NOT_ENOUGH_MEMORY);
    146152        return ERROR_NOT_ENOUGH_MEMORY;
    147153    }
     
    153159        {
    154160            kprintf(("k32AllocMemEx: Failed to fetch *ppv. rc=%d\n", rc));
     161            KLOGEXIT(rc);
    155162            return rc;
    156163        }
     
    162169        {
    163170            kprintf(("k32AllocMemEx: *ppv has an invalid address. *ppv=0x%08x\n", vmac.ac_va));
     171            KLOGEXIT(ERROR_INVALID_ADDRESS);
    164172            return ERROR_INVALID_ADDRESS;
    165173        }
     
    243251
    244252    kprintf(("k32AllocMemEx: returns rc=%d (*ppv=0x%08x)\n", rc, vmac.ac_va));
     253    KLOGEXIT(rc);
    245254    return rc;
    246255}
  • TabularUnified branches/splittup/src/win32k/src/k32HandleSystemEvent.cpp

    r8149 r8155  
    1 /* $Id: k32HandleSystemEvent.cpp,v 1.1.2.1 2002-03-31 20:09:09 bird Exp $
     1/* $Id: k32HandleSystemEvent.cpp,v 1.1.2.2 2002-04-01 09:06:04 bird Exp $
    22 *
    33 * k32HandleSystemEvent - Override system events like Ctrl-Alt-Delete
     
    99 *
    1010 */
     11#ifndef NOFILEID
     12static const char szFileId[] = "$Id: k32HandleSystemEvent.cpp,v 1.1.2.2 2002-04-01 09:06:04 bird Exp $";
     13#endif
    1114
    1215
     
    8891APIRET k32HandleSystemEvent(ULONG ulEvent, HEV hev, BOOL fHandle)
    8992{
     93    KLOGENTRY3("APIRET","ULONG ulEvent, HEV hev, BOOL fHandle", ulEvent, hev, fHandle);
    9094    /*
    9195     * Validate parameters.
     
    96100        ||  ((ULONG)hev & 0xFFFF0000UL) != 0x80010000UL /* 0x80010000 seems to be the shared event semaphore handle bits. */
    97101        )
     102    {
     103        KLOGEXIT(ERROR_INVALID_PARAMETER);
    98104        return ERROR_INVALID_PARAMETER;
     105    }
    99106
    100107
     
    105112        ||  (!fHandle && aSysEventsOverrides[ulEvent].hev != hev && !aSysEventsOverrides[ulEvent].fBad)
    106113        )
     114    {
     115        KLOGEXIT(ERROR_ACCESS_DENIED);
    107116        return ERROR_ACCESS_DENIED;
     117    }
    108118
    109119
     
    121131    }
    122132
     133    KLOGEXIT(NO_ERROR);
    123134    return NO_ERROR;
    124135}
  • TabularUnified branches/splittup/src/win32k/src/k32KillProcessEx.cpp

    r8149 r8155  
    1 /* $Id: k32KillProcessEx.cpp,v 1.1.2.1 2002-03-31 20:09:09 bird Exp $
     1/* $Id: k32KillProcessEx.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $
    22 *
    33 * k32KillProcessEx - DosKillProcessEx extention.
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: k32KillProcessEx.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $";
     12#endif
    1013
    1114
     
    5457APIRET k32KillProcessEx(ULONG flAction, PID pid)
    5558{
     59    KLOGENTRY2("APIRET","ULONG flAction, PID pid", flAction, pid);
    5660    APIRET  rc;
    5761
     
    6367    {
    6468        kprintf(("k32KillProcessEx(flAction=0x%08x, pid=0x%04x): flags are invalid\n", flAction, pid));
     69        KLOGEXIT(ERROR_INVALID_PARAMETER);
    6570        return ERROR_INVALID_PARAMETER;
    6671    }
     
    7075    {
    7176        kprintf(("k32KillProcessEx(flAction=0x%08x, pid=0x%04x): pid is out of range\n", flAction, pid));
     77        KLOGEXIT(ERROR_INVALID_PROCID);
    7278        return ERROR_INVALID_PROCID;
    7379    }
     
    94100    }
    95101
     102    KLOGEXIT(rc);
    96103    return rc;
    97104}
  • TabularUnified branches/splittup/src/win32k/src/k32ProcessReadWrite.cpp

    r8149 r8155  
    1 /* $Id: k32ProcessReadWrite.cpp,v 1.1.2.1 2002-03-31 20:09:09 bird Exp $
     1/* $Id: k32ProcessReadWrite.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $
    22 *
    33 * k32ProcessReadWrite  -  Read or write to another process.
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: k32ProcessReadWrite.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $";
     12#endif
    1013
    1114
     
    5356APIRET k32ProcessReadWrite(PID pid, ULONG cb, PVOID pvSource, PVOID pvTarget, BOOL fRead)
    5457{
     58    KLOGENTRY5("APIRET","PID pid, ULONG cb, PVOID pvSource, PVOID pvTarget, BOOL fRead", pid, cb, pvSource, pvTarget, fRead);
    5559    ULONG   ulAddrAlias;
    5660    ULONG   cbAlias;
     
    6670    cbAlias = (cb + 0xfffUL) & ~0xfffUL;
    6771    if (cbAlias - 1 + ulAddrAlias < ulAddrAlias)
     72    {
     73        KLOGEXIT(ERROR_INVALID_ACCESS);
    6874        return ERROR_INVALID_ACCESS;
     75    }
    6976
    7077    /*
     
    7885    {
    7986        kprintf(("k32ProcessReadWrite: Failed with invalid PID.\n"));
     87        KLOGEXIT(rc != NO_ERROR ? rc : ERROR_INVALID_PARAMETER);
    8088        return rc != NO_ERROR ? rc : ERROR_INVALID_PARAMETER;
    8189    }
     
    8896    {
    8997        kprintf(("k32ProcessReadWrite: LDRRequestSem failed with rc=%d\n", rc));
     98        KLOGEXIT(rc);
    9099        return rc;
    91100    }
     
    103112    {
    104113        kprintf(("k32ProcessReadWrite: VMMapDebugAlias failed with rc=%d\n"));
     114        KLOGEXIT(rc);
    105115        return rc;
    106116    }
     
    129139        kprintf(("k32ProcessReadWrite: VMFreeMem failed!\n"));
    130140
     141    KLOGEXIT(rc);
    131142    return rc;
    132143}
  • TabularUnified branches/splittup/src/win32k/src/k32QueryCallGate.cpp

    r8149 r8155  
    1 /* $Id: k32QueryCallGate.cpp,v 1.1.2.1 2002-03-31 20:09:10 bird Exp $
     1/* $Id: k32QueryCallGate.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $
    22 *
    33 * k32QueryCallGate - Query the callgate selector for the callgate to the k32 APIs.
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: k32QueryCallGate.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $";
     12#endif
    1013
    1114
     
    1619#define INCL_DOSERRORS
    1720#define INCL_OS2KRNL_TK
     21#define INCL_KKL_LOG
    1822
    1923#define NO_WIN32K_LIB_FUNCTIONS
     
    5155APIRET k32QueryCallGate(PUSHORT pusCGSelector)
    5256{
     57    KLOGENTRY1("APIRET","PUSHORT pusCGSelector", pusCGSelector);
    5358    APIRET  rc;
    5459
     
    5863        rc = ERROR_INVALID_CALLGATE;
    5964
     65    KLOGEXIT(rc);
    6066    return rc;
    6167}
  • TabularUnified branches/splittup/src/win32k/src/k32QueryOTEs.cpp

    r8149 r8155  
    1 /* $Id: k32QueryOTEs.cpp,v 1.1.2.1 2002-03-31 20:09:10 bird Exp $
     1/* $Id: k32QueryOTEs.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $
    22 *
    33 * k32QueryOTEs  -  Get's the object table entries (OTEs) for a given
     
    99 *
    1010 */
     11#ifndef NOFILEID
     12static const char szFileId[] = "$Id: k32QueryOTEs.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $";
     13#endif
    1114
    1215
     
    4952APIRET k32QueryOTEs(HMTE hMTE, PQOTEBUFFER pQOte, ULONG cbQOte)
    5053{
     54    KLOGENTRY3("APIRET","HMTE hMTE, PQOTEBUFFER pQOte, ULONG cbQOte", hMTE, pQOte, cbQOte);
    5155    APIRET  rc;
    5256    PMTE    pMTE;
     
    5862     */
    5963    if ((ULONG)pQOte < 0x10000 || cbQOte < sizeof(QOTEBUFFER))
     64    {
     65        KLOGEXIT(ERROR_INVALID_PARAMETER);
    6066        return ERROR_INVALID_PARAMETER;
     67    }
    6168
    6269    /*
     
    6774    {
    6875        kprintf(("k32QueryOTEs: LDRRequestSem failed with rc = %d\n", rc));
     76        KLOGEXIT(rc);
    6977        return rc;
    7078    }
     
    115123    LDRClearSem();
    116124
     125    KLOGEXIT(rc);
    117126    return rc;
    118127}
  • TabularUnified branches/splittup/src/win32k/src/k32QueryOptionsStatus.cpp

    r8149 r8155  
    1 /* $Id: k32QueryOptionsStatus.cpp,v 1.1.2.1 2002-03-31 20:09:11 bird Exp $
     1/* $Id: k32QueryOptionsStatus.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $
    22 *
    33 * k32QueryOptionsStatus  - Queries the options and/or the status of
     
    99 *
    1010 */
     11#ifndef NOFILEID
     12static const char szFileId[] = "$Id: k32QueryOptionsStatus.cpp,v 1.1.2.2 2002-04-01 09:06:05 bird Exp $";
     13#endif
    1114
    1215
     
    3033*******************************************************************************/
    3134#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. */
    3638#include <OS2Krnl.h>
    3739#include <kKrnlLib.h>
     
    6870APIRET k32QueryOptionsStatus(PK32OPTIONS pOptions, PK32STATUS pStatus)
    6971{
     72    KLOGENTRY2("APIRET","PK32OPTIONS pOptions, PK32STATUS pStatus", pOptions, pStatus);
    7073    APIRET  rc;
    7174    ULONG   cb;
     
    8891        rc = TKFuULongNF(SSToDS(&cb), &pOptions->cb);
    8992        if (rc)
     93        {
     94            KLOGEXIT(rc);
    9095            return rc;
     96        }
    9197        if (cb != sizeof(K32OPTIONS))
     98        {
     99            KLOGEXIT(ERROR_INVALID_PARAMETER);
    92100            return ERROR_INVALID_PARAMETER;
     101        }
    93102    }
    94103
     
    97106        rc = TKFuULongNF(SSToDS(&cb), &pStatus->cb);
    98107        if (rc)
     108        {
     109            KLOGEXIT(rc);
    99110            return rc;
     111        }
    100112        if (cb != sizeof(K32STATUS))
     113        {
     114            KLOGEXIT(ERROR_INVALID_PARAMETER);
    101115            return ERROR_INVALID_PARAMETER;
     116        }
    102117    }
    103118
     
    110125    {
    111126        kprintf(("k32QueryOptionsStatus: LDRRequestSem failed with rc = %d\n", rc));
     127        KLOGEXIT(rc);
    112128        return rc;
    113129    }
     
    216232    LDRClearSem();
    217233
     234    KLOGEXIT(rc);
    218235    return rc;
    219236}
  • TabularUnified branches/splittup/src/win32k/src/k32QuerySystemMemInfo.cpp

    r8149 r8155  
    1 /* $Id: k32QuerySystemMemInfo.cpp,v 1.1.2.1 2002-03-31 20:09:11 bird Exp $
     1/* $Id: k32QuerySystemMemInfo.cpp,v 1.1.2.2 2002-04-01 09:06:06 bird Exp $
    22 *
    33 * k32QuerySystemMemInfo - Collects more or less useful information on the
     
    99 *
    1010 */
     11#ifndef NOFILEID
     12static const char szFileId[] = "$Id: k32QuerySystemMemInfo.cpp,v 1.1.2.2 2002-04-01 09:06:06 bird Exp $";
     13#endif
    1114
    1215
     
    3134*******************************************************************************/
    3235#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. */
    3738#include <OS2Krnl.h>
    3839#include <kKrnlLib.h>
     
    6263APIRET k32QuerySystemMemInfo(PK32SYSTEMMEMINFO pMemInfo)
    6364{
     65    KLOGENTRY1("APIRET","PK32SYSTEMMEMINFO pMemInfo", pMemInfo);
    6466    APIRET              rc;
    6567    K32SYSTEMMEMINFO    MemInfo;
     
    7577    rc = TKFuBuff(SSToDS(&MemInfo.cb), &pMemInfo->cb, sizeof(ULONG)*2, TK_FUSU_NONFATAL);
    7678    if (rc)
     79    {
     80        KLOGEXIT(rc);
    7781        return rc;
     82    }
    7883    if (MemInfo.cb != sizeof(K32SYSTEMMEMINFO))
     84    {
     85        KLOGEXIT(ERROR_INVALID_PARAMETER);
    7986        return ERROR_INVALID_PARAMETER;
     87    }
    8088    if (MemInfo.flFlags > 7)
     89    {
     90        KLOGEXIT(ERROR_INVALID_PARAMETER);
    8191        return ERROR_INVALID_PARAMETER;
     92    }
    8293
    8394
     
    161172        kprintf(("k32QuerySystemMemInfo: Failed to copy meminfo to user memory. rc=%d\n", rc));
    162173
     174    KLOGEXIT(rc);
    163175    return rc;
    164176}
  • TabularUnified branches/splittup/src/win32k/src/k32SendSystemEvent.cpp

    r8149 r8155  
    1 /* $Id: k32SendSystemEvent.cpp,v 1.1.2.1 2002-03-31 20:09:12 bird Exp $
     1/* $Id: k32SendSystemEvent.cpp,v 1.1.2.2 2002-04-01 09:06:06 bird Exp $
    22 *
    33 * k32SendSystemEvent - Send a system event like Ctrl-Alt-Delete
     
    99 *
    1010 */
     11#ifndef NOFILEID
     12static const char szFileId[] = "$Id: k32SendSystemEvent.cpp,v 1.1.2.2 2002-04-01 09:06:06 bird Exp $";
     13#endif
    1114
    1215
     
    1619#define INCL_DOSMEMMGR
    1720#define INCL_DOSERRORS
    18 
    1921#define INCL_OS2KRNL_TK
    2022#define INCL_OS2KRNL_SEM
    21 
     23#define INCL_KKL_LOG
    2224#define NO_WIN32K_LIB_FUNCTIONS
    2325
     
    5860APIRET k32SendSystemEvent(ULONG ulEvent, BOOL fHandle)
    5961{
     62    KLOGENTRY2("APIRET","ULONG ulEvent, BOOL fHandle", ulEvent, fHandle);
    6063    /*
    6164     * Validate parameters.
     
    6669        ||  ((ULONG)hev & 0xFFFF0000UL) != 0x80010000UL /* 0x80010000 seems to be the shared event semaphore handle bits. */
    6770        )
     71    {
     72        KLOGEXIT(ERROR_INVALID_PARAMETER);
    6873        return ERROR_INVALID_PARAMETER;
     74    }
    6975
    7076
     
    7581        ||  (!fHandle && aSysEventsOverrides[ulEvent].hev != hev && !aSysEventsOverrides[ulEvent].fBad)
    7682        )
     83    {
     84        KLOGEXIT(ERROR_ACCESS_DENIED);
    7785        return ERROR_ACCESS_DENIED;
     86    }
    7887
    7988
     
    91100    }
    92101
     102    KLOGEXIT(NO_ERROR);
    93103    return NO_ERROR;
    94104}
  • TabularUnified branches/splittup/src/win32k/src/k32SetEnvironment.cpp

    r8149 r8155  
    1 /* $Id: k32SetEnvironment.cpp,v 1.1.2.1 2002-03-31 20:09:13 bird Exp $
     1/* $Id: k32SetEnvironment.cpp,v 1.1.2.2 2002-04-01 09:06:06 bird Exp $
    22 *
    33 * k32SetEnvironment - Sets the Odin32 environment for a process.
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: k32SetEnvironment.cpp,v 1.1.2.2 2002-04-01 09:06:06 bird Exp $";
     12#endif
    1013
    1114
     
    5659APIRET k32SetEnvironment(PSZ pszzEnvironment, ULONG cchEnvironment, PID pid)
    5760{
     61    KLOGENTRY3("APIRET","PSZ pszzEnvironment, ULONG cchEnvironment, PID pid", pszzEnvironment, cchEnvironment, pid);
    5862    APIRET  rc;
    5963    PPTD    pptd;
     
    6569    {
    6670        kprintf(("k32SetEnvironment: invalid pid=%x\n", pid));
     71        KLOGEXIT(ERROR_INVALID_PARAMETER);
    6772        return ERROR_INVALID_PARAMETER;
    6873    }
     
    7176    {
    7277        kprintf(("k32SetEnvironment: currently only supported for current pid. pid=%x\n", pid));
     78        KLOGEXIT(ERROR_INVALID_PARAMETER);
    7379        return ERROR_INVALID_PARAMETER;
    7480    }
     
    8288    {
    8389        kprintf(("k32SetEnvironment: LDRRequestSem failed with rc = %d\n", rc));
     90        KLOGEXIT(rc);
    8491        return rc;
    8592    }
     
    120127
    121128    LDRClearSem();
     129    KLOGEXIT(rc);
    122130    return rc;
    123131}
  • TabularUnified branches/splittup/src/win32k/src/k32SetOptions.cpp

    r8149 r8155  
    1 /* $Id: k32SetOptions.cpp,v 1.1.2.1 2002-03-31 20:09:13 bird Exp $
     1/* $Id: k32SetOptions.cpp,v 1.1.2.2 2002-04-01 09:06:06 bird Exp $
    22 *
    33 * k32SetOptions - Sets the changable options of win32k.sys the options.
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: k32SetOptions.cpp,v 1.1.2.2 2002-04-01 09:06:06 bird Exp $";
     12#endif
    1013
    1114
     
    2831*******************************************************************************/
    2932#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. */
    3435#include <OS2Krnl.h>
    3536#include <kKrnlLib.h>
     
    6566APIRET k32SetOptions(PK32OPTIONS pOptions)
    6667{
     68    KLOGENTRY1("APIRET","PK32OPTIONS pOptions", pOptions);
    6769    APIRET  rc;
    6870    ULONG   cb;
     
    8082        rc = TKFuULongNF(SSToDS(&cb), &pOptions->cb);
    8183        if (rc)
     84        {
     85            KLOGEXIT(rc);
    8286            return rc;
     87        }
    8388        if (cb != sizeof(K32OPTIONS))
     89            KLOGEXIT(ERROR_INVALID_PARAMETER);
    8490            return ERROR_INVALID_PARAMETER;
    8591    }
     
    102108            &&  TmpOptions.usCom != OUTPUT_COM3
    103109            &&  TmpOptions.usCom != OUTPUT_COM4)
    104             return ERROR_INVALID_PARAMETER;
     110        {
     111            KLOGEXIT(ERROR_INVALID_PARAMETER);
     112            return ERROR_INVALID_PARAMETER;
     113        }
    105114        #endif
    106115        if (TmpOptions.fLogging > 1)
    107             return ERROR_INVALID_PARAMETER;
     116        {
     117            KLOGEXIT(ERROR_INVALID_PARAMETER);
     118            return ERROR_INVALID_PARAMETER;
     119        }
    108120        if (TmpOptions.fPE > 4)
    109             return ERROR_INVALID_PARAMETER;
     121        {
     122            KLOGEXIT(ERROR_INVALID_PARAMETER);
     123            return ERROR_INVALID_PARAMETER;
     124        }
    110125        if (TmpOptions.fPEOneObject > 2)
    111             return ERROR_INVALID_PARAMETER;
     126        {
     127            KLOGEXIT(ERROR_INVALID_PARAMETER);
     128            return ERROR_INVALID_PARAMETER;
     129        }
    112130        if (TmpOptions.ulInfoLevel > 4)
    113             return ERROR_INVALID_PARAMETER;
     131        {
     132            KLOGEXIT(ERROR_INVALID_PARAMETER);
     133            return ERROR_INVALID_PARAMETER;
     134        }
    114135        if (TmpOptions.fElf > 1)
    115             return ERROR_INVALID_PARAMETER;
     136        {
     137            KLOGEXIT(ERROR_INVALID_PARAMETER);
     138            return ERROR_INVALID_PARAMETER;
     139        }
    116140        if (TmpOptions.fUNIXScript > 1)
    117             return ERROR_INVALID_PARAMETER;
     141        {
     142            KLOGEXIT(ERROR_INVALID_PARAMETER);
     143            return ERROR_INVALID_PARAMETER;
     144        }
    118145        if (TmpOptions.fREXXScript > 1)
    119             return ERROR_INVALID_PARAMETER;
     146        {
     147            KLOGEXIT(ERROR_INVALID_PARAMETER);
     148            return ERROR_INVALID_PARAMETER;
     149        }
    120150        if (TmpOptions.fJava > 1)
    121             return ERROR_INVALID_PARAMETER;
     151        {
     152            KLOGEXIT(ERROR_INVALID_PARAMETER);
     153            return ERROR_INVALID_PARAMETER;
     154        }
    122155        if (TmpOptions.fNoLoader > 1)
    123             return ERROR_INVALID_PARAMETER;
     156        {
     157            KLOGEXIT(ERROR_INVALID_PARAMETER);
     158            return ERROR_INVALID_PARAMETER;
     159        }
    124160        if (TmpOptions.fREXXScript > 1)
    125             return ERROR_INVALID_PARAMETER;
     161        {
     162            KLOGEXIT(ERROR_INVALID_PARAMETER);
     163            return ERROR_INVALID_PARAMETER;
     164        }
    126165        if (TmpOptions.fDllFixes > 1)
    127             return ERROR_INVALID_PARAMETER;
     166        {
     167            KLOGEXIT(ERROR_INVALID_PARAMETER);
     168            return ERROR_INVALID_PARAMETER;
     169        }
    128170        if (TmpOptions.fExeFixes > 1)
    129             return ERROR_INVALID_PARAMETER;
     171        {
     172            KLOGEXIT(ERROR_INVALID_PARAMETER);
     173            return ERROR_INVALID_PARAMETER;
     174        }
    130175        if (TmpOptions.fForcePreload > 1)
    131             return ERROR_INVALID_PARAMETER;
     176        {
     177            KLOGEXIT(ERROR_INVALID_PARAMETER);
     178            return ERROR_INVALID_PARAMETER;
     179        }
    132180        if (TmpOptions.fApiEnh > 1)
    133             return ERROR_INVALID_PARAMETER;
     181        {
     182            KLOGEXIT(ERROR_INVALID_PARAMETER);
     183            return ERROR_INVALID_PARAMETER;
     184        }
    134185        #if 0
    135186        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        }
    137191        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        }
    139196        #endif
    140197
     
    146203        {
    147204            kprintf(("k32QueryOptionsStatus: LDRRequestSem failed with rc = %d\n", rc));
     205            KLOGEXIT(rc);
    148206            return rc;
    149207        }
     
    183241    }
    184242
     243    KLOGEXIT(rc);
    185244    return rc;
    186245}
  • TabularUnified branches/splittup/src/win32k/src/ldr.cpp

    r8149 r8155  
    1 /* $Id: ldr.cpp,v 1.1.2.1 2002-03-31 20:09:14 bird Exp $
     1/* $Id: ldr.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $
    22 *
    33 * ldr.cpp - Loader helpers.
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: ldr.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $";
     12#endif
    1013
    1114/*******************************************************************************
     
    2528*******************************************************************************/
    2629#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. */
    2932#include <OS2Krnl.h>
    3033#include <kKrnlLib.h>
     
    8790PMODULE     getModuleBySFN(SFN hFile)
    8891{
    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;
    9096}
    9197
     
    113119PMODULE     getModuleByMTE(PMTE pMTE)
    114120{
     121    KLOGENTRY1("PMODULE","PMTE pMTE", pMTE);
    115122    #if 0
    116123        /* Not 100% sure that this will work correctly! */
     
    122129                {
    123130                    kprintf(("getModuleByMTE: invalid pMTE pointer - %#8x\n", pMTE));
     131                    KLOGEXIT(NULL);
    124132                    return NULL;
    125133                }
     
    135143        else
    136144            pMod = (PMODULE)((unsigned)pMod - offsetof(MODULE, coreMTE));
     145    {
     146        KLOGEXIT(pMod);
    137147        return pMod;
     148    }
    138149    #else
    139150        /* Use this for the time being. */
     
    142153            {
    143154                kprintf(("getModuleByMTE: invalid pMTE pointer - %#8x\n", pMTE));
     155                KLOGEXIT(NULL);
    144156                return NULL;
    145157            }
    146158        #endif
    147159        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);
    150167        return NULL;
    151168    #endif
     
    164181PMODULE     getModuleByhMTE(HMTE hMTE)
    165182{
     183    KLOGENTRY1("PMODULE","HMTE hMTE", hMTE);
    166184    PMTE pMTE;
    167185
    168186    pMTE = ldrValidateMteHandle(hMTE);
    169187    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);
    172195    return NULL;
    173196}
     
    184207PMODULE     getModuleByFilename(PCSZ pszFilename)
    185208{
     209    KLOGENTRY1("PMODULE","PCSZ pszFilename", pszFilename);
    186210    pszFilename = pszFilename;
     211    KLOGEXIT(NULL);
    187212    return NULL;
    188213}
     
    207232ULONG       addModule(SFN hFile, PMTE pMTE, ULONG fFlags, ModuleBase *pModObj)
    208233{
     234    KLOGENTRY4("ULONG","SFN hFile, PMTE pMTE, ULONG fFlags, ModuleBase * pModObj", hFile, pMTE, fFlags, pModObj);
    209235    PMODULE pMod;
    210236    #ifdef DEBUG
     
    214240        {
    215241            kprintf(("addModule: invalid parameter: hFile = 0\n"));
     242            KLOGEXIT(ERROR_INVALID_PARAMETER);
    216243            return ERROR_INVALID_PARAMETER;
    217244        }
     
    219246        {
    220247            kprintf(("addModule: invalid parameter: fFlags = 0x%#8x\n", fFlags));
     248            KLOGEXIT(ERROR_INVALID_PARAMETER);
    221249            return ERROR_INVALID_PARAMETER;
    222250        }
     
    228256    {
    229257        kprintf(("addModule: out of memory!\n"));
     258        KLOGEXIT(ERROR_NOT_ENOUGH_MEMORY);
    230259        return ERROR_NOT_ENOUGH_MEMORY;
    231260    }
     
    247276    }
    248277
     278    KLOGEXIT(NO_ERROR);
    249279    return NO_ERROR;
    250280}
     
    265295ULONG      removeModule(SFN hFile)
    266296{
     297    KLOGENTRY1("ULONG","SFN hFile", hFile);
    267298    PMODULE pMod = (PMODULE)AVLULRemove(&pSFNRoot, (AVLULKEY)hFile);
    268299    if (pMod == NULL)
    269300    {
    270301        kprintf(("removeModule: Module not found! hFile=%#4x\n", hFile));
     302        KLOGEXIT(ERROR_INVALID_PARAMETER);
    271303        return ERROR_INVALID_PARAMETER;
    272304    }
     
    300332    free(pMod);
    301333
     334    KLOGEXIT(NO_ERROR);
    302335    return NO_ERROR;
    303336}
     
    317350PSZ ldrGetExePath(PSZ pszPath, BOOL fExecChild)
    318351{
     352    KLOGENTRY2("PSZ","PSZ pszPath, BOOL fExecChild", pszPath, fExecChild);
    319353    PCSZ    pszFilename;
    320354    PCSZ    psz;
     
    355389        {   /* Not called at task time? No current task! */
    356390            kprintf(("ldrGetExePath: Failed to get current PTDA.\n"));
     391            KLOGEXIT(NULL);
    357392            return NULL;
    358393        }
     
    362397        {
    363398            kprintf(("ldrGetExePath: Failed to get hMTE from the PTDAs.\n"));
     399            KLOGEXIT(NULL);
    364400            return NULL;
    365401        }
     
    370406        {
    371407            kprintf(("ldrGetExePath: ldrASMpMTEFromHandle failed for hMTE=0x%04.\n", hMTE));
     408            KLOGEXIT(NULL);
    372409            return NULL;
    373410        }
     
    375412        {
    376413            kprintf(("ldrGetExePath: mte_swapmte is NULL.\n"));
     414            KLOGEXIT(NULL);
    377415            return NULL;
    378416        }
     
    383421        {
    384422            kprintf(("ldrGetExePath: smte_path is NULL.\n"));
     423            KLOGEXIT(NULL);
    385424            return NULL;
    386425        }
     
    391430    {
    392431        kprintf(("ldrGetExePath: pszFilename is empty!\n"));
     432        KLOGEXIT(NULL);
    393433        return NULL;
    394434    }
     
    407447    {
    408448        kprintf(("ldrGetExePath: Exepath is empty.\n"));
     449        KLOGEXIT(NULL);
    409450        return NULL;
    410451    }
     
    415456    memcpy(pszPath, pszFilename, psz - pszFilename);
    416457    pszPath[psz - pszFilename] = '\0';
     458    KLOGEXIT(pszPath);
    417459    return pszPath;
    418460}
     
    425467ULONG ldrInit(void)
    426468{
     469    KLOGENTRY0("ULONG");
    427470    int rc = NO_ERROR;
    428471
     
    437480    ModuleBase::ulInfoLevel = options.ulInfoLevel;
    438481
     482    KLOGEXIT(rc);
    439483    return rc;
    440484}
  • TabularUnified branches/splittup/src/win32k/src/mmf.cpp

    r8149 r8155  
    1 /* $Id: mmf.cpp,v 1.1.2.1 2002-03-31 20:09:14 bird Exp $
     1/* $Id: mmf.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $
    22 *
    33 * Memory Mapped Files.
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: mmf.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $";
     12#endif
    1013
    1114/** @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:14 bird Exp $
     1/* $Id: myLDRGetProcAddr.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $
    22 *
    33 * LDRGetProcAddr - Get an entry point to a module.
     
    99 *
    1010 */
     11#ifndef NOFILEID
     12static const char szFileId[] = "$Id: myLDRGetProcAddr.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $";
     13#endif
    1114
    1215/*******************************************************************************
     
    2427*******************************************************************************/
    2528#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. */
    2831#include <OS2Krnl.h>
    2932#include <kKrnlLib.h>
     
    6871                               PULONG   pulProcType)
    6972{
     73    KLOGENTRY6("ULONG","HMTE hmte, ULONG ulOrdinal, PCSZ pszName, PULONG pulAddress, BOOL fFlat, PULONG pulProcType", hmte, ulOrdinal, pszName, pulAddress, fFlat, pulProcType);
     74    ULONG   rc;
    7075    /*
    7176     * Check if the fix is enabled, and needed, and possible to apply.
     
    8287     * Let the real function do rest of the work.
    8388     */
    84     return LDRGetProcAddr(hmte, ulOrdinal, pszName, pulAddress, fFlat, pulProcType);
     89    rc = LDRGetProcAddr(hmte, ulOrdinal, pszName, pulAddress, fFlat, pulProcType);
     90    KLOGEXIT(rc);
     91    return rc;
    8592}
    8693
  • TabularUnified branches/splittup/src/win32k/src/myLDRQAppType.cpp

    r8149 r8155  
    1 /* $Id: myLDRQAppType.cpp,v 1.1.2.1 2002-03-31 20:09:15 bird Exp $
     1/* $Id: myLDRQAppType.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $
    22 *
    33 * _myLDRQAppType - _LDRQAppType overload.
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: myLDRQAppType.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $";
     12#endif
    1013
    1114/*******************************************************************************
     
    4649ULONG LDRCALL myLDRQAppType(ULONG p1, ULONG p2)
    4750{
     51    KLOGENTRY2("ULONG","ULONG p1, ULONG p2", p1, p2);
    4852    APIRET rc;
    4953
    50     kprintf(("myLDRQAppType: entry\n"));
    5154    rc = KSEMRequestMutex(ptda_ptda_ptdasem(ptdaGetCur()), KSEM_INDEFINITE_WAIT);
    5255    if (rc != NO_ERROR)
    5356    {
    5457        kprintf(("myLDRQAppType: failed to get intra-process semaphore.\n"));
     58        KLOGEXIT(rc);
    5559        return rc;
    5660    }
     
    5963    {
    6064        kprintf(("myLDRQAppType: failed to get loader semaphore.\n"));
     65        KLOGEXIT(rc);
    6166        return rc;
    6267    }
     
    7277    LDRClearSem();
    7378    KSEMReleaseMutex(ptda_ptda_ptdasem(ptdaGetCur()));
    74     kprintf(("myLDRQAppType: exit\n"));
    7579
     80    KLOGEXIT(rc);
    7681    return rc;
    7782}
  • TabularUnified branches/splittup/src/win32k/src/myVMAllocMem.cpp

    r8149 r8155  
    1 /* $Id: myVMAllocMem.cpp,v 1.1.2.1 2002-03-31 20:09:15 bird Exp $
     1/* $Id: myVMAllocMem.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $
    22 *
    33 * Debug module - overloads VMAllocMem to analyse input parameters....
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: myVMAllocMem.cpp,v 1.1.2.2 2002-04-01 09:06:07 bird Exp $";
     12#endif
    1013
    1114/*******************************************************************************
     
    5154APIRET KRNLCALL myVMAllocMem(ULONG p1, ULONG p2, ULONG p3, USHORT p4, USHORT p5, USHORT p6, ULONG p7, ULONG p8, ULONG p9)
    5255{
     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);
    5357    APIRET rc;
    5458
    5559    rc = VMAllocMem(p1,p2,p3,p4,p5,p6,p7,p8,(PVMAC)p9);
    5660
     61    KLOGEXIT(rc);
    5762    return rc;
    5863}
  • TabularUnified branches/splittup/src/win32k/src/myldrCheckInternalName.cpp

    r8149 r8155  
    1 /* $Id: myldrCheckInternalName.cpp,v 1.1.2.1 2002-03-31 20:09:15 bird Exp $
     1/* $Id: myldrCheckInternalName.cpp,v 1.1.2.2 2002-04-01 09:06:08 bird Exp $
    22 *
    33 * ldrCheckInternalName - ldrCheckInternalName replacement with support for
     
    99 *
    1010 */
    11 
     11#ifndef NOFILEID
     12static const char szFileId[] = "$Id: myldrCheckInternalName.cpp,v 1.1.2.2 2002-04-01 09:06:08 bird Exp $";
     13#endif
    1214
    1315/*******************************************************************************
     
    2527*******************************************************************************/
    2628#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. */
    2931#include <OS2Krnl.h>
    3032#include <kKrnlLib.h>
     
    6264ULONG LDRCALL myldrCheckInternalName(PMTE pMTE)
    6365{
     66    KLOGENTRY1("ULONG","PMTE pMTE", pMTE);
    6467    /* Check if this feature is enabled */
    6568    if (isDllFixesDisabled())
     
    6972        kprintf(("myldrCheckInternalName: pMTE=0x%08x intname=%.*s path=%s rc=%d\n", /* (original)\",*/
    7073                 pMTE, *(PCHAR)pMTE->mte_swapmte->smte_restab, (PCHAR)pMTE->mte_swapmte->smte_restab + 1, ldrpFileNameBuf, rc));
     74        KLOGEXIT(rc);
    7175        return rc;
    7276        #else
    73         return ldrCheckInternalName(pMTE);
     77        ULONG rc = ldrCheckInternalName(pMTE);
     78        KLOGEXIT(rc);
     79        return rc;
    7480        #endif
    7581    }
     
    9096     */
    9197    if (!(pMTE->mte_flags1 & LIBRARYMOD))
     98    {
     99        KLOGEXIT(NO_ERROR);
    92100        return NO_ERROR;
     101    }
    93102
    94103
     
    185194             pMTE, *(PCHAR)pMTE->mte_swapmte->smte_restab, (PCHAR)pMTE->mte_swapmte->smte_restab + 1, ldrpFileNameBuf, rc));
    186195
     196    KLOGEXIT(rc);
    187197    return rc;
    188198}
  • TabularUnified branches/splittup/src/win32k/src/myldrClose.cpp

    r8149 r8155  
    1 /* $Id: myldrClose.cpp,v 1.1.2.1 2002-03-31 20:09:16 bird Exp $
     1/* $Id: myldrClose.cpp,v 1.1.2.2 2002-04-01 09:06:08 bird Exp $
    22 *
    33 * myldrClose - ldrClose
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: myldrClose.cpp,v 1.1.2.2 2002-04-01 09:06:08 bird Exp $";
     12#endif
    1013
    1114/*******************************************************************************
     
    2225*******************************************************************************/
    2326#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. */
    2629#include <OS2Krnl.h>
    2730#include <kKrnlLib.h>
     
    4447ULONG LDRCALL myldrClose(SFN hFile)
    4548{
     49    KLOGENTRY1("ULONG","SFN hFile", hFile);
     50    ULONG   rc;
    4651    /* closes handle */
    4752    kprintf(("myldrClose: hFile = %.4x\n", hFile));
     
    7782     * Finally call the real close function.
    7883     */
    79     return ldrClose(hFile);
     84    rc = ldrClose(hFile);
     85    KLOGEXIT(rc);
     86    return rc;
    8087}
  • TabularUnified branches/splittup/src/win32k/src/myldrEnum32bitRelRecs.cpp

    r8149 r8155  
    1 /* $Id: myldrEnum32bitRelRecs.cpp,v 1.1.2.1 2002-03-31 20:09:16 bird Exp $
     1/* $Id: myldrEnum32bitRelRecs.cpp,v 1.1.2.2 2002-04-01 09:06:08 bird Exp $
    22 *
    33 * myldrEnum32bitRelRecs - ldrEnum32bitRelRecs
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: myldrEnum32bitRelRecs.cpp,v 1.1.2.2 2002-04-01 09:06:08 bird Exp $";
     12#endif
    1013
    1114/*******************************************************************************
     
    2326*******************************************************************************/
    2427#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. */
    2730#include <OS2Krnl.h>
    2831#include <kKrnlLib.h>
     
    5861    )
    5962{
     63    KLOGENTRY6("ULONG","PMTE pMTE, ULONG iObject, ULONG iPageTable, PVOID pvPage, ULONG ulPageAddress, PVOID pvPTDA", pMTE, iObject, iPageTable, pvPage, ulPageAddress, pvPTDA);
    6064    PMODULE pMod;
     65    ULONG   rc;
    6166
    6267    pMod = getModuleByMTE(pMTE);
     
    7277        rc = pMod->Data.pModule->applyFixups(pMTE, iObject, iPageTable, pvPage, ulPageAddress, pvPTDA);
    7378        if (rc != NO_ERROR)
     79            KLOGEXIT(rc);
    7480            return rc;
    7581    }
    7682
    77     return ldrEnum32bitRelRecs(pMTE, iObject, iPageTable, pvPage, ulPageAddress, pvPTDA);
     83    rc = ldrEnum32bitRelRecs(pMTE, iObject, iPageTable, pvPage, ulPageAddress, pvPTDA);
     84    KLOGEXIT(rc);
     85    return rc;
    7886}
  • TabularUnified branches/splittup/src/win32k/src/myldrFindModule.cpp

    r8149 r8155  
    1 /* $Id: myldrFindModule.cpp,v 1.1.2.1 2002-03-31 20:09:16 bird Exp $
     1/* $Id: myldrFindModule.cpp,v 1.1.2.2 2002-04-01 09:06:08 bird Exp $
    22 *
    33 * ldrFindModule - ldrFindModule replacement with support for long DLL names
     
    99 *
    1010 */
     11#ifndef NOFILEID
     12static const char szFileId[] = "$Id: myldrFindModule.cpp,v 1.1.2.2 2002-04-01 09:06:08 bird Exp $";
     13#endif
    1114
    1215/*******************************************************************************
     
    2326*******************************************************************************/
    2427#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. */
    2730#include <OS2Krnl.h>
    2831#include <kKrnlLib.h>
     
    6972ULONG LDRCALL myldrFindModule(PCHAR pachFilename, USHORT cchFilename, USHORT usClass, PPMTE ppMTE)
    7073{
     74    KLOGENTRY4("ULONG","PCHAR pachFilename, USHORT cchFilename, USHORT usClass, PPMTE ppMTE", pachFilename, cchFilename, usClass, ppMTE);
    7175    /*
    7276     * Log.
     
    8791                     *ppMTE, (*ppMTE)->mte_handle, (*ppMTE)->mte_modname,
    8892                     (*ppMTE)->mte_swapmte->smte_path, (*ppMTE)->mte_flags1 & CLASS_MASK));
     93        KLOGEXIT(rc);
    8994        return rc;
    9095        #else
     96        KLOGEXIT(ldrFindModule(pachFilename, cchFilename, usClass, ppMTE));
    9197        return ldrFindModule(pachFilename, cchFilename, usClass, ppMTE);
    9298        #endif
     
    122128    {
    123129        kprintf(("myldrFindModule: Unknown class flag! usClass=%d\n", usClass));
     130        KLOGEXIT(ldrFindModule(pachFilename, cchFilename, usClass, ppMTE));
    124131        return ldrFindModule(pachFilename, cchFilename, usClass, ppMTE);
    125132    }
     
    129136    {
    130137        kprintf(("myldrFindModule: Invalid pointer(s); pachFilename=0x%08x  ppMTE=0x%08x", pachFilename, ppMTE));
     138        KLOGEXIT(ERROR_INVALID_ACCESS);
    131139        return ERROR_INVALID_ACCESS;
    132140    }
     
    140148        *ppMTE = NULL;
    141149        kprintf(("myldrFindModule: Not found; cchFilename = 0\n"));
     150        KLOGEXIT(ERROR_FILE_NOT_FOUND);
    142151        return ERROR_FILE_NOT_FOUND;
    143152    }
     
    162171            rc = ldrTransPath(pachFilename);
    163172            if (rc)
     173            {
     174                KLOGEXIT(rc);
    164175                return rc;
     176            }
    165177            pachFilename = ldrpFileNameBuf;
    166178            cchFilename = (USHORT)(strlen(pachFilename) + 1);
     
    224236        {
    225237            kprintf(("myldrFindModule: Invalid name in class global; name=%.*s\n", cchFilename, pachFilename));
     238            KLOGEXIT(ERROR_INVALID_NAME);
    226239            return ERROR_INVALID_NAME;
    227240        }
     
    240253        {
    241254            kprintf(("myldrFindModule: Invalid name! ldrGetFileName2 failed; name=%.*s\n", cchFilename, pachFilename));
     255            KLOGEXIT(ERROR_INVALID_NAME);
    242256            return ERROR_INVALID_NAME;
    243257        }
     
    366380                kprintf(("myldrFindModule: Found pmte=0x%08x  hmte=0x%04x  modname=%.8s  path=%s (GLOBAL)\n",
    367381                         pmte, pmte->mte_handle, pmte->mte_modname, pmte->mte_swapmte->smte_path));
     382                KLOGEXIT(NO_ERROR);
    368383                return NO_ERROR;
    369384            }
     
    386401                kprintf(("myldrFindModule: Found pmte=0x%08x  hmte=0x%04x  modname=%.8s  path=%s (%x)\n",
    387402                         pmte, pmte->mte_handle, pmte->mte_modname, pSMTE->smte_path, pmte->mte_flags1 & CLASS_MASK));
     403                KLOGEXIT(NO_ERROR);
    388404                return NO_ERROR;
    389405            }
     
    397413    *ppMTE = NULL;
    398414    kprintf(("myldrFindModule: Not Found\n"));
     415    KLOGEXIT(NO_ERROR);
    399416    return NO_ERROR;
    400417}
  • TabularUnified branches/splittup/src/win32k/src/myldrOpen.cpp

    r8149 r8155  
    1 /* $Id: myldrOpen.cpp,v 1.1.2.1 2002-03-31 20:09:17 bird Exp $
     1/* $Id: myldrOpen.cpp,v 1.1.2.2 2002-04-01 09:06:09 bird Exp $
    22 *
    33 * myldrOpen - ldrOpen.
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: myldrOpen.cpp,v 1.1.2.2 2002-04-01 09:06:09 bird Exp $";
     12#endif
    1013
    1114
     
    2932*******************************************************************************/
    3033#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. */
    3338#include <OS2Krnl.h>
    3439#include <kKrnlLib.h>
     
    4146
    4247#include "options.h"
    43 #include "elf.h"
    44 #include "OS2Krnl.h"
    4548#include "dev32.h"
    4649#include "ldr.h"
     
    6972ULONG LDRCALL myldrOpen(PSFN phFile, PSZ pszFilename, PULONG pfl)
    7073{
     74    KLOGENTRY3("ULONG","PSFN phFile, PSZ pszFilename, PULONG pfl", phFile, pszFilename, pfl);
    7175    static  int cNesting = 0;           /* This is an variable which hold the nesting */
    7276                                        /* level of this function. This is useful     */
     
    779783        *pfl &= ~0x1000UL; /* 0x1000 is the fixed media flag. */
    780784
     785    KLOGEXIT(rc);
    781786    return rc;
    782787}
     
    810815APIRET AddArgsToFront(int cArgs,  ...)
    811816{
     817    KLOGENTRY2("APIRET","int cArgs, ...", cArgs, &cArgs);
    812818    va_list     vaarg;                  /* Variable length argument list. */
    813819    int         cchOldArgs;             /* Length of the old arguments (including the first argument). */
     
    832838    {
    833839        kprintf(("AddArgsToFront: not in tkExecPgm state.\n"));
     840        KLOGEXIT(ERROR_INVALID_PARAMETER);
    834841        return ERROR_INVALID_PARAMETER;
    835842    }
     
    838845    {
    839846        kprintf(("AddArgsToFront: called when not in tkExecPgm data is invalid!\n"));
     847        KLOGEXIT(ERROR_INVALID_PARAMETER);
    840848        return ERROR_INVALID_PARAMETER;
    841849    }
     
    855863    {
    856864        kprintf(("AddArgsToFront: the size of the arguments to add is zero!\n"));
     865        KLOGEXIT(ERROR_INVALID_PARAMETER);
    857866        return ERROR_INVALID_PARAMETER;
    858867    }
     
    870879        kprintf(("AddArgsToFront: argument buffer is too small to hold the arguments to add, cchOldArgs=%d, cchNewArgs=%d\n",
    871880                 cchOldArgs, cchNewArgs));
     881        KLOGEXIT(ERROR_BAD_ARGUMENTS);
    872882        return ERROR_BAD_ARGUMENTS;
    873883    }
     
    914924    #endif
    915925
     926    KLOGEXIT(NO_ERROR);
    916927    return NO_ERROR;
    917928}
     
    932943APIRET SetExecName(const char *pszExecName)
    933944{
     945    KLOGENTRY1("APIRET","const char * pszExecName", pszExecName);
    934946    #ifdef DEBUG
    935947    int cch;
     
    938950    {
    939951        kprintf(("ChangeExecName: filename is too long! cch=%d. name=%s\n", cch, pszExecName));
     952        KLOGEXIT(ERROR_FILENAME_EXCED_RANGE);
    940953        return ERROR_FILENAME_EXCED_RANGE;
    941954    }
     
    943956    {
    944957        kprintf(("ChangeExecName: called when not in tkExecPgm state!!! FATAL ERROR!\n"));
     958        KLOGEXIT(ERROR_INVALID_PARAMETER);
    945959        return ERROR_INVALID_PARAMETER;
    946960    }
     
    949963    {
    950964        kprintf(("ChangeExecName: called when not in tkExecPgm data is invalid!!! FATAL ERROR!\n"));
     965        KLOGEXIT(ERROR_INVALID_PARAMETER);
    951966        return ERROR_INVALID_PARAMETER;
    952967    }
     
    954969    strcpy(achTkExecPgmFilename, pszExecName);
    955970
     971    KLOGEXIT(0);
    956972    return 0;
    957973}
     
    974990APIRET OpenPATH(PSFN phFile, char *pszFilename, PULONG pfl)
    975991{
     992    KLOGENTRY3("APIRET","PSFN phFile, char * pszFilename, PULONG pfl", phFile, pszFilename, pfl);
    976993    APIRET      rc;
    977994    USHORT      TCBFailErr_save;
     
    9841001     */
    9851002    if (pszPath == NULL)
     1003    {
     1004        KLOGEXIT(ERROR_FILE_NOT_FOUND);
    9861005        return ERROR_FILE_NOT_FOUND;
     1006    }
    9871007
    9881008    /**@sketch
     
    10761096                default:
    10771097                    tcbSetTCBFailErr(tcbGetCur(), TCBFailErr_save);
     1098                    KLOGEXIT(rc);
    10781099                    return rc;
    10791100            }
     
    10971118    *phFile = 0;
    10981119    tcbSetTCBFailErr(tcbGetCur(), TCBFailErr_save);
     1120    KLOGEXIT(ERROR_FILE_NOT_FOUND);
    10991121    return ERROR_FILE_NOT_FOUND;
    11001122}
  • TabularUnified branches/splittup/src/win32k/src/myldrOpenPath.cpp

    r8149 r8155  
    1 /* $Id: myldrOpenPath.cpp,v 1.1.2.1 2002-03-31 20:09:18 bird Exp $
     1/* $Id: myldrOpenPath.cpp,v 1.1.2.2 2002-04-01 09:06:09 bird Exp $
    22 *
    33 * myldrOpenPath - ldrOpenPath used to open executables we'll override
     
    99 *
    1010 */
     11#ifndef NOFILEID
     12static const char szFileId[] = "$Id: myldrOpenPath.cpp,v 1.1.2.2 2002-04-01 09:06:09 bird Exp $";
     13#endif
    1114
    1215/*******************************************************************************
     
    2528*******************************************************************************/
    2629#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. */
    2932#include <OS2Krnl.h>
    3033#include <kKrnlLib.h>
     
    9194    )
    9295{
    93 
     96    KLOGENTRY5("ULONG","PCHAR pachFilename, USHORT cchFilename, ldrlv_t * plv, PULONG pful, ULONG lLibPath", pachFilename, cchFilename, plv, pful, lLibPath);
    9497    APIRET  rc;
    9598
     
    108111                 pachFilename, cchFilename, plv, pful
    109112                 ));
     113        KLOGEXIT(ldrOpenPath(pachFilename, cchFilename, plv, pful, lLibPath));
    110114        return ldrOpenPath(pachFilename, cchFilename, plv, pful, lLibPath);
    111115    }
     
    209213    fldrOpenExtentionFix = FALSE;
    210214
     215    KLOGEXIT(rc);
    211216    return rc;
    212217}
     
    225230    )
    226231{
    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;
    228236}
    229237
  • TabularUnified branches/splittup/src/win32k/src/myldrRead.cpp

    r8149 r8155  
    1 /* $Id: myldrRead.cpp,v 1.1.2.1 2002-03-31 20:09:18 bird Exp $
     1/* $Id: myldrRead.cpp,v 1.1.2.2 2002-04-01 09:06:09 bird Exp $
    22 *
    33 * myldrRead - ldrRead.
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: myldrRead.cpp,v 1.1.2.2 2002-04-01 09:06:09 bird Exp $";
     12#endif
    1013
    1114/*******************************************************************************
     
    2225*******************************************************************************/
    2326#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. */
    2629#include <OS2Krnl.h>
    2730#include <kKrnlLib.h>
     
    6669    )
    6770{
     71    KLOGENTRY6("ULONG","SFN hFile, ULONG ulOffset, PVOID pvBuffer, ULONG fpBuffer, ULONG cbToRead, PMTE pMTE", hFile, ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE);
    6872    ULONG   rc;
    6973
     
    105109    #endif
    106110
     111    KLOGEXIT(rc);
    107112    return rc;
    108113}
  • TabularUnified branches/splittup/src/win32k/src/myldrSetVMflags.cpp

    r8149 r8155  
    1 /* $Id: myldrSetVMflags.cpp,v 1.1.2.1 2002-03-31 20:09:19 bird Exp $
     1/* $Id: myldrSetVMflags.cpp,v 1.1.2.2 2002-04-01 09:06:10 bird Exp $
    22 *
    33 * myldrSetVMflags - ldrSetVMflags
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: myldrSetVMflags.cpp,v 1.1.2.2 2002-04-01 09:06:10 bird Exp $";
     12#endif
    1013
    1114/*******************************************************************************
     
    2528*******************************************************************************/
    2629#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. */
    2932#include <OS2Krnl.h>
    3033#include <kKrnlLib.h>
     
    5255VOID LDRCALL myldrSetVMflags(PMTE pMTE, ULONG flObj, PULONG pflFlags1, PULONG pflFlags2)
    5356{
     57    KLOGENTRY4("VOID","PMTE pMTE, ULONG flObj, PULONG pflFlags1, PULONG pflFlags2", pMTE, flObj, pflFlags1, pflFlags2);
    5458    /*
    5559     * call the orignal and let it do it's work.
     
    7175                 ));
    7276    }
     77    KLOGEXITVOID();
    7378}
  • TabularUnified branches/splittup/src/win32k/src/myldrWasLoadModuled.cpp

    r8149 r8155  
    1 /* $Id: myldrWasLoadModuled.cpp,v 1.1.2.1 2002-03-31 20:09:19 bird Exp $
     1/* $Id: myldrWasLoadModuled.cpp,v 1.1.2.2 2002-04-01 09:06:10 bird Exp $
    22 *
    33 * ldrWasLoadModuled - Tells OS/2 that the executable module was LoadModuled
     
    1010 *
    1111 */
     12#ifndef NOFILEID
     13static const char szFileId[] = "$Id: myldrWasLoadModuled.cpp,v 1.1.2.2 2002-04-01 09:06:10 bird Exp $";
     14#endif
    1215
    1316/*******************************************************************************
     
    2528*******************************************************************************/
    2629#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. */
    2933#include <OS2Krnl.h>
    3034#include <kKrnlLib.h>
     
    6266ULONG LDRCALL myldrWasLoadModuled(HMTE hmte, PPTDA pptda, PULONG pcUsage)
    6367{
     68    KLOGENTRY3("ULONG","HMTE hmte, PPTDA pptda, PULONG pcUsage", hmte, pptda, pcUsage);
     69    ULONG   rc;
     70
    6471    /*
    6572     * Check if the fix is enabled.
     
    8289     * Let the real function do the work.
    8390     */
    84     return ldrWasLoadModuled(hmte, pptda, pcUsage);
     91    rc = ldrWasLoadModuled(hmte, pptda, pcUsage);
     92    KLOGEXIT(rc);
     93    return rc;
    8594}
    8695
  • 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 $
    22 *
    33 * Pe2Lx class implementation. Ring 0 and Ring 3
     
    1010 *
    1111 */
     12#ifndef NOFILEID
     13static const char szFileId[] = "$Id: pe2lx.cpp,v 1.1.2.2 2002-04-01 09:06:10 bird Exp $";
     14#endif
    1215
    1316
     
    3033    #define Yield() DosSleep(0)
    3134#endif
    32 
     35#define DWORD                       ULONG
     36#define PDWORD                      PULONG
    3337
    3438/*
     
    8488*******************************************************************************/
    8589#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 NE structs and definitions. */
    89 #include <exe386.h>                     /* OS/2 LX structs 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. */
    9094#include <OS2Krnl.h>                    /* kernel structs.  (SFN) */
    9195#include <kKrnlLib.h>
     
    107111#include "modulebase.h"                 /* ModuleBase class definitions, ++. */
    108112#include "pe2lx.h"                      /* Pe2Lx class definitions, ++. */
     113#define WIN32API
    109114#include <versionos2.h>                 /* Pe2Lx version. */
    110115#include "options.h"                    /* Win32k options. */
     
    11371142            if (pbr->VirtualAddress + PAGESIZE >= ulRVAPage)
    11381143            {
    1139                 PWORD pwoffFixup   = &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! */
    11411146
    11421147                /* Some bound checking just to be sure it works... */
     
    11441149                {
    11451150                    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);
    11471152                }
    11481153
     
    14081413        if (pbr->VirtualAddress + PAGESIZE >= ulRVAPage)
    14091414        {
    1410             PWORD pwoffFixup   = &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! */
    14121417
    14131418            /* Some bound checking just to be sure it works... */
     
    14151420            {
    14161421                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);
    14181423            }
    14191424
     
    29532958            {
    29542959                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)),
    29562961                                         ul,
    29572962                                         pNtHdrs->FileHeader.Characteristics & IMAGE_FILE_DLL ?
     
    29752980                {
    29762981                    if (Thunk.u1.Ordinal & (ULONG)IMAGE_ORDINAL_FLAG)
    2977                         rc = add32OrdImportFixup((WORD)(ulRVAFirstThunk & (PAGESIZE-1)),
     2982                        rc = add32OrdImportFixup((USHORT)(ulRVAFirstThunk & (PAGESIZE-1)),
    29782983                                                 ulModuleOrdinal, Thunk.u1.Ordinal & 0xffff);
    29792984                    else if (Thunk.u1.Ordinal > 0UL && Thunk.u1.Ordinal < pNtHdrs->OptionalHeader.SizeOfImage)
     
    29832988                        if (rc != NO_ERROR)
    29842989                            break;
    2985                         rc = add32NameImportFixup((WORD)(ulRVAFirstThunk & (PAGESIZE-1)),
     2990                        rc = add32NameImportFixup((USHORT)(ulRVAFirstThunk & (PAGESIZE-1)),
    29862991                                                  ulModuleOrdinal, psz);
    29872992                        free(psz);
     
    30453050        if (fBaseRelocs && BaseReloc.VirtualAddress == ulRVAPage)
    30463051        {
    3047             ULONG c = (BaseReloc.SizeOfBlock - sizeof(BaseReloc.SizeOfBlock) - sizeof(BaseReloc.VirtualAddress)) / sizeof(WORD); /* note that sizeof(BaseReloc) is 12 bytes! */
    3048             PWORD pawoffFixup = 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;
    30493054
    30503055            if (c != 0)
    30513056            {
    3052                 pawoffFixup = (PWORD)malloc((size_t)(c * sizeof(WORD)));
     3057                pawoffFixup = (PUSHORT)malloc((size_t)(c * sizeof(USHORT)));
    30533058                if (pawoffFixup != NULL)
    30543059                    rc = pRelocReader->readAtRVA(ulRVABaseReloc + offsetof(IMAGE_BASE_RELOCATION, TypeOffset),
    3055                                                  pawoffFixup, c * sizeof(WORD));
     3060                                                 pawoffFixup, c * sizeof(USHORT));
    30563061                else
    30573062                    rc = ERROR_NOT_ENOUGH_MEMORY;
     
    30603065                for (ul = 0; ul < c && rc == NO_ERROR; ul++)
    30613066                {
    3062                     WORD  woffFixup;
     3067                    USHORT  woffFixup;
    30633068                    ULONG ulTarget;
    30643069                    /* Get relocation type/offset. */
     
    30743079                        {
    30753080                            case IMAGE_REL_BASED_HIGHLOW:
    3076                                 rc = add32OffsetFixup((WORD)(woffFixup & 0x0FFF), ulTarget);
     3081                                rc = add32OffsetFixup((USHORT)(woffFixup & 0x0FFF), ulTarget);
    30773082                                printInfA(("Fixup: 0x%03x target 0x%08x (rc = %d) %s\n",
    30783083                                           (woffFixup & 0x0FFF), ulTarget, rc,
     
    33053310                    )
    33063311                {
    3307                     WORD usOrdinal;
     3312                    USHORT usOrdinal;
    33083313
    33093314                    for (ul = 0; ul < ExpDir.NumberOfNames && rc == NO_ERROR; ul++)
     
    33133318                        if (rc != NO_ERROR)
    33143319                            break;
    3315                         rc = pFATFOTReader->readAtRVA((ULONG)ExpDir.AddressOfNameOrdinals + ul * sizeof(WORD),
     3320                        rc = pFATFOTReader->readAtRVA((ULONG)ExpDir.AddressOfNameOrdinals + ul * sizeof(USHORT),
    33163321                                                      SSToDS(&usOrdinal), sizeof(usOrdinal));
    33173322                        if (rc != NO_ERROR)
     
    36763681 * This code got a bit dirty while trying to optimize memory usage.
    36773682 */
    3678 ULONG Pe2Lx::add32OffsetFixup(WORD offSource, ULONG ulTarget)
     3683ULONG Pe2Lx::add32OffsetFixup(USHORT offSource, ULONG ulTarget)
    36793684{
    36803685    struct r32_rlc *prlc;
     
    38273832 *
    38283833 */
    3829 ULONG  Pe2Lx::add32OrdImportFixup(WORD offSource, ULONG ulModuleOrdinal, ULONG ulFunctionOrdinal)
     3834ULONG  Pe2Lx::add32OrdImportFixup(USHORT offSource, ULONG ulModuleOrdinal, ULONG ulFunctionOrdinal)
    38303835{
    38313836    struct r32_rlc *prlc;
     
    39523957 *
    39533958 */
    3954 ULONG  Pe2Lx::add32NameImportFixup(WORD offSource, ULONG ulModuleOrdinal, PCSZ pszFnName)
     3959ULONG  Pe2Lx::add32NameImportFixup(USHORT offSource, ULONG ulModuleOrdinal, PCSZ pszFnName)
    39553960{
    39563961    APIRET          rc;
     
    51755180    {
    51765181        int   i;
    5177         WORD  w;
     5182        USHORT  w;
    51785183
    51795184        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 $
    22 *
    33 * Xx2Lx main program. (Ring 3 only!)
     
    88 *
    99 */
     10#ifndef NOFILEID
     11static const char szFileId[] = "$Id: xx2lxmain.cpp,v 1.1.2.2 2002-04-01 09:06:11 bird Exp $";
     12#endif
    1013
    1114/*******************************************************************************
     
    2528*******************************************************************************/
    2629#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. */
    3234#include <malloc.h>
    3335#include <string.h>
Note: See TracChangeset for help on using the changeset viewer.