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/winimagelx.cpp

    r1131 r1844  
    1 /* $Id: winimagelx.cpp,v 1.3 1999-10-04 20:52:33 sandervl Exp $ */
     1/* $Id: winimagelx.cpp,v 1.4 1999-11-26 00:05:19 sandervl Exp $ */
    22
    33/*
     
    6868//******************************************************************************
    6969//******************************************************************************
     70ULONG Win32LxImage::getApi(char *name)
     71{
     72  APIRET      rc;
     73  ULONG       apiaddr;
    7074
     75  rc = DosQueryProcAddr(hinstance, 0, name, (PFN *)&apiaddr);
     76  if(rc) 
     77  {
     78        if(rc == ERROR_INVALID_HANDLE)
     79        {//handle invalid for some silly reason, so load module again (initterm entrypoint not called twice)
     80                char szErrName[CCHMAXPATH];
     81
     82                rc = DosLoadModule(szErrName, sizeof(szErrName), szFileName, &hinstance);
     83                if(!rc)
     84                        rc = DosQueryProcAddr(hinstance, 0, name, (PFN *)&apiaddr);
     85        }
     86        if(rc)  return(0);
     87  }
     88  return(apiaddr);
     89}
     90//******************************************************************************
     91//******************************************************************************
     92ULONG Win32LxImage::getApi(int ordinal)
     93{
     94 APIRET      rc;
     95 ULONG       apiaddr;
     96
     97  rc = DosQueryProcAddr(hinstance, ordinal, NULL, (PFN *)&apiaddr);
     98  if(rc) {
     99        if(rc == ERROR_INVALID_HANDLE)
     100        {//handle invalid for some silly reason, so load module again (initterm entrypoint not called twice)
     101                char szErrName[CCHMAXPATH];
     102
     103                rc = DosLoadModule(szErrName, sizeof(szErrName), szFileName, &hinstance);
     104                if(!rc)
     105                        rc = DosQueryProcAddr(hinstance, ordinal, NULL, (PFN *)&apiaddr);
     106        }
     107        if(rc)  return(0);
     108  }
     109  return(apiaddr);
     110}
     111//******************************************************************************
     112//******************************************************************************
     113
Note: See TracChangeset for help on using the changeset viewer.