Changeset 1833 for trunk/src


Ignore:
Timestamp:
Nov 24, 1999, 8:33:34 PM (26 years ago)
Author:
sandervl
Message:

exe loader fixes + updates

Location:
trunk/src/kernel32
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/KERNEL32.CPP

    r1815 r1833  
    1 /* $Id: KERNEL32.CPP,v 1.33 1999-11-23 19:31:34 sandervl Exp $ */
     1/* $Id: KERNEL32.CPP,v 1.34 1999-11-24 19:31:22 sandervl Exp $ */
    22
    33/*
     
    521521BOOL WIN32API IsDBCSLeadByte(BYTE arg1)
    522522{
    523     dprintf(("KERNEL32:  OS2IsDBCSLeadByte\n"));
     523    dprintf2(("KERNEL32:  OS2IsDBCSLeadByte\n"));
    524524    return O32_IsDBCSLeadByte(arg1);
    525525}
  • trunk/src/kernel32/directory.cpp

    r1708 r1833  
    1 /* $Id: directory.cpp,v 1.11 1999-11-11 19:10:08 sandervl Exp $ */
     1/* $Id: directory.cpp,v 1.12 1999-11-24 19:31:22 sandervl Exp $ */
    22
    33/*
     
    3232#include <string.h>
    3333#include "oslibdos.h"
     34#include "profile.h"
    3435
    3536ODINDEBUGCHANNEL(KERNEL32-DIRECTORY)
     
    219220    int len;
    220221
    221     len = PROFILE_GetOdinIniString(ODINDIRECTORIES,"SYSTEM","",lpBuffer,uSize);
     222    len = ODIN_PROFILE_GetOdinIniString(ODINDIRECTORIES,"SYSTEM","",lpBuffer,uSize);
    222223    if (len > 2) {
    223224        if(lpBuffer[len-1] == '\\') {
     
    293294    int len;
    294295
    295     len = PROFILE_GetOdinIniString(ODINDIRECTORIES,"WINDOWS","",lpBuffer,uSize);
     296    len = ODIN_PROFILE_GetOdinIniString(ODINDIRECTORIES,"WINDOWS","",lpBuffer,uSize);
    296297    if (len > 2) {
    297298        if(lpBuffer[len-1] == '\\') {
     
    301302        return len;
    302303    }
    303     else
    304         /* if no override by environment is available */
    305         return O32_GetWindowsDirectory(lpBuffer,uSize);
     304    else {//SvL: Use path of kernel32.dll instead of calling Open32 api (which returns \OS2\SYSTEM)
     305     CHAR buf[255];
     306
     307        lstrcpynA(buf, kernel32Path, sizeof(buf)-1);
     308        strcat(buf, "WIN");
     309        O32_CreateDirectory(buf, NULL);
     310
     311        lstrcpynA(lpBuffer, buf, uSize);
     312        len = lstrlenA(lpBuffer);;
     313        if(lpBuffer[len-1] == '\\') {
     314                lpBuffer[len-1] = 0;
     315                len--;
     316        }
     317        return len;
     318    }
    306319  }
    307320}
  • trunk/src/kernel32/makefile

    r1815 r1833  
    1 # $Id: makefile,v 1.60 1999-11-23 19:31:35 sandervl Exp $
     1# $Id: makefile,v 1.61 1999-11-24 19:31:23 sandervl Exp $
    22
    33#
     
    107107directory.obj: directory.cpp \
    108108    $(PDWIN32_INCLUDE)\unicode.h \
    109     initterm.h directory.h oslibdos.h
     109    initterm.h directory.h oslibdos.h profile.h
    110110
    111111disk.obj: disk.cpp \
  • trunk/src/kernel32/windllpeldr.cpp

    r1496 r1833  
    1 /* $Id: windllpeldr.cpp,v 1.2 1999-10-28 18:23:34 sandervl Exp $ */
     1/* $Id: windllpeldr.cpp,v 1.3 1999-11-24 19:31:23 sandervl Exp $ */
    22
    33/*
     
    3737                : Win32ImageBase(-1),
    3838                  Win32DllBase(-1, 0),
    39                   Win32PeLdrImage(szDllName)
     39                  Win32PeLdrImage(szDllName, FALSE)
    4040{
    4141  dprintf(("Win32PeLdrDll::Win32PeLdrDll %s %s loaded by %s", szFileName, szModule,
  • trunk/src/kernel32/winexebase.cpp

    r1670 r1833  
    1 /* $Id: winexebase.cpp,v 1.2 1999-11-09 19:22:32 sandervl Exp $ */
     1/* $Id: winexebase.cpp,v 1.3 1999-11-24 19:31:23 sandervl Exp $ */
    22
    33/*
     
    8282  tlsAttachThread();    //setup TLS (main thread)
    8383
    84   rc = ((WIN32EXEENTRY)entryPoint)();
     84  rc = ((WIN32EXEENTRY)entryPoint)(NULL);
    8585  RestoreOS2TIB();
    8686
  • trunk/src/kernel32/winexepeldr.cpp

    r1720 r1833  
    1 /* $Id: winexepeldr.cpp,v 1.4 1999-11-13 15:41:10 sandervl Exp $ */
     1/* $Id: winexepeldr.cpp,v 1.5 1999-11-24 19:31:23 sandervl Exp $ */
    22
    33/*
     
    101101                   Win32ImageBase(-1),
    102102                   Win32ExeBase(-1),
    103                    Win32PeLdrImage(szFileName)
     103                   Win32PeLdrImage(szFileName, TRUE)
    104104{
    105105  dprintf(("Win32PeLdrExe ctor: %s", szFileName));
  • trunk/src/kernel32/winfakepeldr.cpp

    r1410 r1833  
    1 /* $Id: winfakepeldr.cpp,v 1.1 1999-10-23 12:34:48 sandervl Exp $ */
     1/* $Id: winfakepeldr.cpp,v 1.2 1999-11-24 19:31:23 sandervl Exp $ */
    22
    33/*
     
    3333Win32PeLdrRsrcImg::Win32PeLdrRsrcImg(char *szFileName)
    3434                        : Win32ImageBase(-1),
    35                           Win32PeLdrImage(szFileName, RSRC_LOAD)
     35                          Win32PeLdrImage(szFileName, FALSE, RSRC_LOAD)
    3636{
    3737}
  • trunk/src/kernel32/winimagepeldr.cpp

    r1811 r1833  
    1 /* $Id: winimagepeldr.cpp,v 1.14 1999-11-22 20:35:52 sandervl Exp $ */
     1/* $Id: winimagepeldr.cpp,v 1.15 1999-11-24 19:31:23 sandervl Exp $ */
    22
    33/*
     
    7070//******************************************************************************
    7171//******************************************************************************
    72 Win32PeLdrImage::Win32PeLdrImage(char *pszFileName, int loadtype) :
     72Win32PeLdrImage::Win32PeLdrImage(char *pszFileName, BOOL isExe, int loadtype) :
    7373    Win32ImageBase(-1),
    7474    nrsections(0), imageSize(0),
     
    8383  strcpy(szFileName, pszFileName);
    8484  strupr(szFileName);
    85   if(!strchr(szFileName, (int)'.')) {
    86         strcat(szFileName,".DLL");
    87   }
    88   dllfile = OSLibDosOpen(szFileName, OSLIB_ACCESS_READONLY|OSLIB_ACCESS_SHAREDENYNONE);
    89   if(dllfile == NULL) {//search in libpath for dll
    90         strcpy(szModule, kernel32Path);
    91         strcat(szModule, szFileName);
    92         strcpy(szFileName, szModule);
    93   }
    94   else  OSLibDosClose(dllfile);
    95 
     85  if(isExe) {
     86        dllfile = OSLibDosOpen(szFileName, OSLIB_ACCESS_READONLY|OSLIB_ACCESS_SHAREDENYNONE);
     87        if(dllfile == NULL) {
     88                if(!strstr(szFileName, ".EXE")) {
     89                        strcat(szFileName,".EXE");
     90                }
     91        }
     92        else    OSLibDosClose(dllfile);
     93  }
     94  else {
     95        dllfile = OSLibDosOpen(szFileName, OSLIB_ACCESS_READONLY|OSLIB_ACCESS_SHAREDENYNONE);
     96        if(dllfile == NULL) {//search in libpath for dll
     97                strcpy(szModule, kernel32Path);
     98                strcat(szModule, szFileName);
     99                strcpy(szFileName, szModule);
     100
     101                dllfile = OSLibDosOpen(szFileName, OSLIB_ACCESS_READONLY|OSLIB_ACCESS_SHAREDENYNONE);
     102                if(dllfile == NULL) {
     103                        if(!strstr(szFileName, ".DLL")) {
     104                                strcat(szFileName,".DLL");
     105                                dllfile = OSLibDosOpen(szFileName, OSLIB_ACCESS_READONLY|OSLIB_ACCESS_SHAREDENYNONE);
     106                                if(dllfile == NULL) {
     107                                        strcpy(szModule, kernel32Path);
     108                                        strcat(szModule, szFileName);
     109                                        strcpy(szFileName, szModule);
     110                                }
     111                                else    OSLibDosClose(dllfile);
     112                        }
     113                }
     114                else    OSLibDosClose(dllfile);
     115        }
     116        else    OSLibDosClose(dllfile);
     117  }
    96118  strcpy(szModule, OSLibStripPath(szFileName));
    97119  strupr(szModule);
Note: See TracChangeset for help on using the changeset viewer.