Hi ! Iczellion is grat ,... but access to this forum is sloooowwww ( momentary problem ? ) Well my question is : how do I code , using MASM / TASM, a call to Some_DLL's entry ordinal NUMBER ? I will not / may not use an entry name . I understand the process, it's just I don't know how to tell the assembler/linker to use ordinals instead of names ; do I have to create a .def file and add it to the linker's call ? Or may I just specify it by way of some assembler directive ? Thanks for kind answers ... fell free to post a copy / notification to my e-mail box , since - again - accessing this Forum seems difficult at best ( for me :( /\/.
Posted on 2000-12-19 11:10:00 by NimbUs
That's a good question! Here is a section from an article by Matt Pietrek in his "Under the Hood" Column in the MSJ Journal. ********************************************* How do you import and export by ordinal? The importing part is actually done automatically for you by the Microsoft linker. However, in exchange you must export the APIs by ordinal. When the linker generates the import library corresponding to a DLL, it generates import records that will tell the linker how the APIs should be imported. The best way to export by ordinal is to explicitly tell the linker through a .DEF file. For instance, in a .DEF file, you’d have: EXPORTS MyExportedAPI @1 If you don’t use the @1 modifier, the Microsoft linker exports the API by name. ****************************************************** You don't say whether you're calling a function in a dll you wrote or in a system dll, but I think what Pietrek says will work in either case. Hope this helps.
Posted on 2000-12-24 00:17:00 by A Mason