News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

lib include help

Started by joerbanno, February 08, 2007, 12:40:49 PM

Previous topic - Next topic

joerbanno

I'm working on a project that involves network traffic.
I want to use API like GetIfTable and the structures that  come along with it like MIB_IFTABLE.
I can't find a include file that has these declarations so I make one up (following MSDN), but I also have to create a lib file right? To be able to access an API method like GetIfTable, else the linker will bail, but how do I build such a lib?

Maybe I'm not on the right track here, but I sure would appreciate some help.

cheers,
JB

Tedd

There is a tool named "inc2lib" (or inc2l, or whatever) which will generate a .lib file from a .inc file, exporting the functions given in the inc.

Alternatively (this is what the tool actually does), you can write the code for a dll which contains all of the functions (as empty stubs - only the proc headers are important) with the names (and correct number of parameters, and calling conventions if not stdcall) and then when you create this dll, you can have a lib file generated along with it. Then just delete everything except the lib file.
No snowflake in an avalanche feels responsible.

Vortex

joerbanno,

I guess you are looking for iphlpapi.lib and iphlpapi.inc. The include file has the prototype of GetIfTable The masm32 package contains both of the import library and the include file. For the equates and structure definitions, you should try to convert the C header files below to Masm.

iprtrmib.h
ipexport.h
iptypes.h


From iprtmid.h :

typedef struct _MIB_IFTABLE {
    DWORD dwNumEntries;
    MIB_IFROW table[ANY_SIZE];
} MIB_IFTABLE, *PMIB_IFTABLE;

joerbanno

Quote from: Vortex on February 08, 2007, 06:12:16 PM
joerbanno,

I guess you are looking for iphlpapi.lib and iphlpapi.inc. The include file has the prototype of GetIfTable The masm32 package contains both of the import library and the include file.

Thnx for your comment.
Hmmm can't find it there I searched the whole disk, so I'm beginning to wonder if I have an ouddated MASM package.
Where can I find the most recent release?

TNick


Vortex

joerbanno,

Here is the import library and the include file ( without the equates and structure definitions ) from the GeneSys package.

[attachment deleted by admin]

joerbanno

Quote from: Vortex on February 08, 2007, 07:32:01 PM
joerbanno,

Here is the import library and the include file ( without the equates and structure definitions ) from the GeneSys package.

Thnx for all the help