Changeset 17 for trunk/src/helpers/dosh.c
- Timestamp:
- Dec 16, 2000, 10:09:53 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/dosh.c
r15 r17 1530 1530 1531 1531 return (arcReturn); 1532 } 1533 1534 /* 1535 *@@category: Helpers\Control program helpers\Module handling 1536 */ 1537 1538 /* ****************************************************************** 1539 * 1540 * Module handling helpers 1541 * 1542 ********************************************************************/ 1543 1544 /* 1545 *@@ doshResolveImports: 1546 * this function loads the module called pszModuleName 1547 * and resolves imports dynamically using DosQueryProcAddress. 1548 * 1549 * To specify the functions to be imported, a RESOLVEFUNCTION 1550 * array is used. In each of the array items, specify the 1551 * name of the function and a pointer to a function pointer 1552 * where to store the resolved address. 1553 * 1554 *@@added V0.9.3 (2000-04-29) [umoeller] 1555 */ 1556 1557 APIRET doshResolveImports(PSZ pszModuleName, // in: DLL to load 1558 HMODULE *phmod, // out: module handle 1559 PRESOLVEFUNCTION paResolves, // in/out: function resolves 1560 ULONG cResolves) // in: array item count (not array size!) 1561 { 1562 CHAR szName[CCHMAXPATH]; 1563 APIRET arc = DosLoadModule(szName, 1564 sizeof(szName), 1565 pszModuleName, 1566 phmod); 1567 if (arc == NO_ERROR) 1568 { 1569 ULONG ul; 1570 for (ul = 0; 1571 ul < cResolves; 1572 ul++) 1573 { 1574 arc = DosQueryProcAddr(*phmod, 1575 0, // ordinal, ignored 1576 (PSZ)paResolves[ul].pcszFunctionName, 1577 paResolves[ul].ppFuncAddress); 1578 1579 /* _Pmpf(("Resolved %s to 0x%lX, rc: %d", 1580 paResolves[ul].pcszFunctionName, 1581 *paResolves[ul].ppFuncAddress, 1582 arc)); */ 1583 if (arc != NO_ERROR) 1584 break; 1585 } 1586 } 1587 1588 return (arc); 1532 1589 } 1533 1590
Note:
See TracChangeset
for help on using the changeset viewer.