Ignore:
Timestamp:
Apr 16, 2000, 12:42:13 PM (25 years ago)
Author:
sandervl
Message:

put back dll search method + loadlibraryex fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/wprocess.cpp

    r3402 r3404  
    1 /* $Id: wprocess.cpp,v 1.78 2000-04-16 07:07:01 bird Exp $ */
     1/* $Id: wprocess.cpp,v 1.79 2000-04-16 10:42:13 sandervl Exp $ */
    22
    33/*
     
    1212 *
    1313 */
    14 
    15 
    16 
    17 /*******************************************************************************
    18 *   Header Files                                                               *
    19 *******************************************************************************/
    2014#include <odin.h>
    2115#include <odinwrap.h>
     
    5549
    5650
    57 /******************************************************************************
    58 *   Global Variables                                                          *
    59 ******************************************************************************/
     51//******************************************************************************
     52//******************************************************************************
    6053BOOL      fFreeLibrary = FALSE;
    6154BOOL      fIsOS2Image = FALSE;  //TRUE  -> Odin32 OS/2 application (not converted!)
     
    6962static THDB     *threadList = 0;
    7063static VMutex    threadListMutex;
    71 
    72 
    73 
    7464//******************************************************************************
    7565//******************************************************************************
     
    365355VOID WIN32API ExitProcess(DWORD exitcode)
    366356{
    367     dprintf(("KERNEL32: ExitProcess %d\n", exitcode));
    368     dprintf(("KERNEL32: ExitProcess FS = %x\n", GetFS()));
     357    dprintf(("KERNEL32:  ExitProcess %d\n", exitcode));
     358    dprintf(("KERNEL32:  ExitProcess FS = %x\n", GetFS()));
    369359
    370360    SetOS2ExceptionChain(-1);
     
    425415}
    426416/******************************************************************************/
    427 //******************************************************************************
    428 HINSTANCE16 WIN32API LoadLibrary16(LPCTSTR lpszLibFile)
    429 {
    430     dprintf(("ERROR: LoadLibrary16 %s, not implemented", lpszLibFile));
    431     return 0;
    432 }
    433 //******************************************************************************
    434 //******************************************************************************
    435 VOID WIN32API FreeLibrary16(HINSTANCE16 hinstance)
    436 {
    437     dprintf(("ERROR: FreeLibrary16 %x, not implemented", hinstance));
    438 }
    439 //******************************************************************************
    440 //******************************************************************************
    441 FARPROC WIN32API GetProcAddress16(HMODULE hModule, LPCSTR lpszProc)
    442 {
    443     dprintf(("ERROR: GetProcAddress16 %x %x, not implemented", hModule, lpszProc));
    444     return 0;
    445 }
    446 //******************************************************************************
    447 
     417/******************************************************************************/
    448418/**
    449419 * LoadLibraryA can be used to map a DLL module into the calling process's
     
    676646                 lpszLibFile, hFile, dwFlags));
    677647        SetLastError(ERROR_INVALID_PARAMETER);
     648        return NULL;
    678649    }
    679650
     
    990961//******************************************************************************
    991962//******************************************************************************
     963HINSTANCE16 WIN32API LoadLibrary16(LPCTSTR lpszLibFile)
     964{
     965    dprintf(("ERROR: LoadLibrary16 %s, not implemented", lpszLibFile));
     966    return 0;
     967}
     968//******************************************************************************
     969//******************************************************************************
     970VOID WIN32API FreeLibrary16(HINSTANCE16 hinstance)
     971{
     972    dprintf(("ERROR: FreeLibrary16 %x, not implemented", hinstance));
     973}
     974//******************************************************************************
     975//******************************************************************************
     976FARPROC WIN32API GetProcAddress16(HMODULE hModule, LPCSTR lpszProc)
     977{
     978    dprintf(("ERROR: GetProcAddress16 %x %x, not implemented", hModule, lpszProc));
     979    return 0;
     980}
     981//******************************************************************************
     982//******************************************************************************
    992983LPCSTR WIN32API GetCommandLineA()
    993984{
     
    1000991    cmdline = O32_GetCommandLine();
    1001992
    1002   dprintf(("KERNEL32: GetCommandLine %s\n", cmdline));
    1003   dprintf(("KERNEL32: FS = %x\n", GetFS()));
     993  dprintf(("KERNEL32:  GetCommandLine %s\n", cmdline));
     994  dprintf(("KERNEL32:  FS = %x\n", GetFS()));
    1004995  return(cmdline);
    1005996}
     
    10111002         char *asciicmdline = NULL;
    10121003
    1013     dprintf(("KERNEL32: FS = %x\n", GetFS()));
     1004    dprintf(("KERNEL32:  FS = %x\n", GetFS()));
    10141005
    10151006    if(UnicodeCmdLine)
     
    10261017        UnicodeCmdLine = (WCHAR *)malloc(strlen(asciicmdline)*2 + 2);
    10271018        AsciiToUnicode(asciicmdline, UnicodeCmdLine);
    1028         dprintf(("KERNEL32: OS2GetCommandLineW: %s\n", asciicmdline));
     1019        dprintf(("KERNEL32:  OS2GetCommandLineW: %s\n", asciicmdline));
    10291020        return(UnicodeCmdLine);
    10301021    }
    1031     dprintf(("KERNEL32: OS2GetCommandLineW: asciicmdline == NULL\n"));
     1022    dprintf(("KERNEL32:  OS2GetCommandLineW: asciicmdline == NULL\n"));
    10321023    return NULL;
    10331024}
     
    10701061 DWORD rc;
    10711062
    1072     dprintf(("KERNEL32: OSLibGetModuleFileNameW\n"));
     1063    dprintf(("KERNEL32:  OSLibGetModuleFileNameW\n"));
    10731064    rc = GetModuleFileNameA(hModule, asciifilename, nSize);
    10741065    if(rc)      AsciiToUnicode(asciifilename, lpFileName);
     
    11211112  }
    11221113
    1123   dprintf(("KERNEL32: GetModuleHandle %s returned %X\n", lpszModule, hMod));
     1114  dprintf(("KERNEL32:  GetModuleHandle %s returned %X\n", lpszModule, hMod));
    11241115  return(hMod);
    11251116}
     
    11331124    astring = UnicodeToAsciiString((LPWSTR)arg1);
    11341125    rc = GetModuleHandleA(astring);
    1135     dprintf(("KERNEL32: OS2GetModuleHandleW %s returned %X\n", astring, rc));
     1126    dprintf(("KERNEL32:  OS2GetModuleHandleW %s returned %X\n", astring, rc));
    11361127    FreeAsciiString(astring);
    11371128    return(rc);
     
    12031194        sprintf(cmdline, "PE.EXE %s", lpCommandLine);
    12041195    }
    1205     dprintf(("KERNEL32: CreateProcess %s\n", cmdline));
     1196    dprintf(("KERNEL32:  CreateProcess %s\n", cmdline));
    12061197    rc = O32_CreateProcess("PE.EXE", (LPCSTR)cmdline,lpProcessAttributes,
    12071198                         lpThreadAttributes, bInheritHandles, dwCreationFlags,
     
    12291220
    12301221    if(lpProcessInfo)
    1231       dprintf(("KERNEL32: CreateProcess returned %d hPro:%x hThr:%x pid:%x tid:%x\n",
     1222      dprintf(("KERNEL32:  CreateProcess returned %d hPro:%x hThr:%x pid:%x tid:%x\n",
    12321223               rc, lpProcessInfo->hProcess, lpProcessInfo->hThread,
    12331224                   lpProcessInfo->dwProcessId,lpProcessInfo->dwThreadId));
    12341225    else
    1235       dprintf(("KERNEL32: CreateProcess returned %d\n", rc));
     1226      dprintf(("KERNEL32:  CreateProcess returned %d\n", rc));
    12361227    return(rc);
    12371228}
     
    12961287 ULONG     ulAPIOrdinal;
    12971288
    1298   winmod = Win32ImageBase::findModule(hModule);
     1289  if(hModule == 0 || hModule == -1 || (WinExe && hModule == WinExe->getInstanceHandle())) {
     1290    winmod = WinExe;
     1291  }
     1292  else  winmod = (Win32ImageBase *)Win32DllBase::findModule((HINSTANCE)hModule);
     1293
    12991294  if(winmod) {
    13001295        ulAPIOrdinal = (ULONG)lpszProc;
     
    13101305  proc = O32_GetProcAddress(hModule, lpszProc);
    13111306  if(HIWORD(lpszProc))
    1312     dprintf(("KERNEL32: GetProcAddress %s from %X returned %X\n", lpszProc, hModule, proc));
    1313   else  dprintf(("KERNEL32: GetProcAddress %x from %X returned %X\n", lpszProc, hModule, proc));
     1307    dprintf(("KERNEL32:  GetProcAddress %s from %X returned %X\n", lpszProc, hModule, proc));
     1308  else  dprintf(("KERNEL32:  GetProcAddress %x from %X returned %X\n", lpszProc, hModule, proc));
    13141309  return(proc);
    13151310}
Note: See TracChangeset for help on using the changeset viewer.