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

    r1767 r1844  
    1 /* $Id: winimagepe2lx.cpp,v 1.5 1999-11-18 08:55:06 bird Exp $ */
     1/* $Id: winimagepe2lx.cpp,v 1.6 1999-11-26 00:05:19 sandervl Exp $ */
    22
    33/*
     
    1616#define INCL_DOSERRORS          /* DOS Error values */
    1717#define INCL_DOSPROFILE         /* DosQuerySysState (Toolkit 4.5) */
     18#define INCL_DOSMODULEMGR   /* DOS Module management */
    1819
    1920#define ALIGN(a, alignment) (((a) + (alignment - 1UL)) & ~(alignment - 1UL))
     
    524525}
    525526
     527/**
     528 * Gets pointer to an exported procedure by procedure name.
     529 * @returns   Address of exported procedure. 0UL if not found.
     530 * @param     name  Exported procedure name.
     531 * @status    completely implemented.
     532 * @author    Sander van Leeuwen
     533 * @remark
     534 */
     535ULONG Win32Pe2LxImage::getApi(char *name)
     536{
     537    APIRET      rc;
     538    ULONG       ulApiAddr;
     539
     540    rc = DosQueryProcAddr(hinstance, 0, name, (PFN *)&ulApiAddr);
     541    return rc == NO_ERROR ? ulApiAddr : 0;
     542}
     543
     544
     545/**
     546 * Gets pointer to an exported procedure by ordinal.
     547 * @returns   Pointer to an exported procedure. 0UL if not found.
     548 * @param     ordinal  Export ordinal number.
     549 * @status    completely implemented.
     550 * @author    Sander van Leeuwen
     551 * @remark    FIXME:
     552 *            This function should be implemented for both Exe and Dll images!
     553 *            It could be done similar in both peldr image and pe2lx images by
     554 *            accessing PE structures.
     555 */
     556ULONG Win32Pe2LxImage::getApi(int ordinal)
     557{
     558    APIRET      rc;
     559    ULONG       ulApiAddr;
     560
     561    rc = DosQueryProcAddr(hinstance, ordinal, NULL, (PFN *)&ulApiAddr);
     562
     563    return rc == NO_ERROR ? ulApiAddr : 0;
     564}
Note: See TracChangeset for help on using the changeset viewer.