Ignore:
Timestamp:
Nov 26, 1999, 1:05:20 AM (26 years ago)
Author:
sandervl
Message:

Allow executable api exports

File:
1 edited

Legend:

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

    r1423 r1844  
    1 /* $Id: windlllx.cpp,v 1.4 1999-10-23 23:02:17 sandervl Exp $ */
     1/* $Id: windlllx.cpp,v 1.5 1999-11-26 00:05:19 sandervl Exp $ */
    22
    33/*
     
    114114//******************************************************************************
    115115//******************************************************************************
    116 ULONG Win32LxDll::getApi(char *name)
    117 {
    118   APIRET      rc;
    119   ULONG       apiaddr;
    120 
    121   rc = DosQueryProcAddr(hinstance, 0, name, (PFN *)&apiaddr);
    122   if(rc) 
    123   {
    124         if(rc == ERROR_INVALID_HANDLE)
    125         {//handle invalid for some silly reason, so load module again (initterm entrypoint not called twice)
    126                 char szErrName[CCHMAXPATH];
    127 
    128                 rc = DosLoadModule(szErrName, sizeof(szErrName), szFileName, &hinstance);
    129                 if(!rc)
    130                         rc = DosQueryProcAddr(hinstance, 0, name, (PFN *)&apiaddr);
    131         }
    132         if(rc)  return(0);
    133   }
    134   return(apiaddr);
    135 }
    136 //******************************************************************************
    137 //******************************************************************************
    138 ULONG Win32LxDll::getApi(int ordinal)
    139 {
    140  APIRET      rc;
    141  ULONG       apiaddr;
    142 
    143   rc = DosQueryProcAddr(hinstance, ordinal, NULL, (PFN *)&apiaddr);
    144   if(rc) {
    145         if(rc == ERROR_INVALID_HANDLE)
    146         {//handle invalid for some silly reason, so load module again (initterm entrypoint not called twice)
    147                 char szErrName[CCHMAXPATH];
    148 
    149                 rc = DosLoadModule(szErrName, sizeof(szErrName), szFileName, &hinstance);
    150                 if(!rc)
    151                         rc = DosQueryProcAddr(hinstance, ordinal, NULL, (PFN *)&apiaddr);
    152         }
    153         if(rc)  return(0);
    154   }
    155   return(apiaddr);
    156 }
    157 //******************************************************************************
    158 //******************************************************************************
    159116BOOL Win32LxDll::isLxDll()
    160117{
Note: See TracChangeset for help on using the changeset viewer.