The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: joerbanno on February 08, 2007, 12:40:49 PM

Title: lib include help
Post by: joerbanno on February 08, 2007, 12:40:49 PM
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
Title: Re: lib include help
Post by: Tedd on February 08, 2007, 05:39:19 PM
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.
Title: Re: lib include help
Post by: 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. 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;
Title: Re: lib include help
Post by: joerbanno on February 08, 2007, 07:12:35 PM
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?
Title: Re: lib include help
Post by: TNick on February 08, 2007, 07:25:04 PM
http://www.masm32.com/masmdl.htm
Title: Re: lib include help
Post by: 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.

[attachment deleted by admin]
Title: Re: lib include help
Post by: joerbanno on February 08, 2007, 08:58:44 PM
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