Link to home
Start Free TrialLog in
Avatar of karol_konkoly
karol_konkoly

asked on

Compiling WRAPI dlls and WrapiTest.cpp

Hi,

I am developing a small application using MS Visual Studio 6. to my Wireless USB NIC.
(Dell TrueMobile 802.11g Wireless USB Client card)

I have downloaded the source from the WRAPI page and tried to compile it.
First it reported an error, that ic can't find the <ntddndis.h>
header file. Since i din't find it on my system I visited the MSDN site and found a package on this site:

http://www.microsoft.com/whdc/device/network/802x/80211_netadapt.mspx

After putting the header files into the
c:\Program Files\Microsoft Visual Studio\VC98\Include\

directory, I have tried to compile again, and got the following error messages:

typedef struct _NDIS_VAR_DATA_DESC
{
    USHORT      Length;         // # of octects of data
    USHORT      MaximumLength;  // # of octects available
    ULONG_PTR   Offset;         // Offset of data relative to the descriptor
} NDIS_VAR_DATA_DESC, *PNDIS_VAR_DATA_DESC;

c:\program files\microsoft visual studio\vc98\include\ntddndis.h(101) :
error C2146: syntax error : missing ';' before identifier 'Offset'
error C2501: 'ULONG_PTR' : missing storage-class or type specifiers
error C2501: 'Offset' : missing storage-class or type specifiers

c:\projects\suli\dp\install\wrapi\wrapi src\wrapi\wrapi.h(61) :
fatal error C1083: Cannot open include file: 'nuiouser.h': No such file or directory

I could't find 'nuiouser.h' neither in the path nor anywhere else.
How can I fix this problem?


Thank you.



Avatar of Mikal613
Mikal613
Flag of United States of America image

Avatar of karol_konkoly
karol_konkoly

ASKER

Hi,

thank you for the early answers :-) , but they didn't help me, unfortunately.
I did use the latest source from the WRAPI site. After trying to build the dll-s on my own and failed i have tried to use their pre-compiled dll files and run the testing application.
- opened a project for the WrapiTest.cpp
- copied the dll, and the lib files in the src dir,
- added WRAPI.lib in the Poject->Settings>Link->Object/Library Modules
- and pressed F7
Well, first it was missing the "WrapiExports.h".
I've copied it from the WRAPI site, from the build source.
After trying again I got the following error messages:

c:\program files\microsoft visual studio\vc98\include\ntddndis.h(79) : error C2146: syntax error : missing ';' before identifier 'NDIS_OID'

pointing to line 79:
typedef ULONG NDIS_OID, *PNDIS_OID;

and

c:\program files\microsoft visual studio\vc98\include\ntddndis.h(79) : fatal error C1004: unexpected end of file found

Again, the ntddndis.h file was installed from the http://www.microsoft.com/whdc/device/network/802x/80211_netadapt.mspx
site.

Thank you
ASKER CERTIFIED SOLUTION
Avatar of jhance
jhance

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,

Well, in my application I would like to measure some QoS parameters in wireless networks. Also, since  these two things, in wireless networks are related, signal strength is an important issiue. So, I need to get information about the signal strength and the QoS parameters to the clients.

I was wondering, is it possible to get the physical location of the client by some way without GPS or other special hardware?

Thank you.
Link statistics are obtained using the OID_802_11_STATISTICS query while signal strength is obtained via the OID_802_11_RSSI query.

I think your life will be simpler to skip WRAPI and just use the NDISUIO (on XP) or the NDISPROT (on Win2K3 Server) drivers which are included with Windows.  There are some who say it's not good to use either of these but since MS has not provided another way other than writing your own NDIS driver, I'm seeing more and more applications using these interfaces.

If you don't already have it, get the DDK from Microsoft.  If you are an MSDN subscriber you should have it on CD already or can download it.  If you're not a subscriber, you must request it on CD from MS for a small fee.  It's like US$15.00 to order it.

In the "src" tree there is a sample called "ndisuio" (in the WXP DDK) or "ndisprot" (in the W2K3 DDK).  These are functionally similar.  In there is a source file called uiotest.c which shows you how to open the NDISUIO or NDISPROT device, open a wireless adapter, and then query OIDs.  The two above you are interested in are not included in what uiotest.c does but the idea is the same.

If you need more help, please let me know and I can post some source code for this but you'll need to have the DDK before you can compile anything since some of the required .h files are only in the DDK.
Hi,

unfortunately I don't have an MSDN subscription nor a DDK CD. I was looking all over the Google to find a way to get it for free, but without any success. :-(

It is free, or almost free.  You can order the CD from Microsoft for the cost of shipping and handling.  

It would be illegal to get it from any other source since the license agreement says that it cannot be redistributed.

https://oms.one.microsoft.com/anonymous/winddk390/en-us/OM/CI/CustomerInfo.asp

if you are in the USA.  Otherwise, go to:

http://www.microsoft.com/whdc/devtools/ddk/orderddkcd.mspx
I can send DDk to you if you give me the Email
>>I can send DDk to you if you give me the Email

Please note that doing so is illegal and offering to do so is against the policies of this site.  

Hopefully the moderators will deal harshly with you.
Hi,

Thanx for the offer, but i would like to keep the development of this software as clean as possible. Our team is actually thinking about switching to linux, since there is a qos library and also a wireless extension API. (the api Kismet was written with, for example).
Dou you have any experiences with that?

Thank you.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
We are working with WRAPi and having the same problems so we are really interested in the final solution of this question too.

Our path has been pretty much the same as karol. Up to now we could compile the Wrapitest.cpp but it does nothing. None output. We suspect the problem has to do with WRAPI failing to communicate properly with NDIS. But not sure. The best result we have had is "Abnormal termination" from Enumerate Devices (the first method the main program calls).

We have also seen the last comment from alexcohn, but we don't have DDK either. If I understand well, do we have to recompile wrapi.dll because the one that is pre-compiled won't work?

Should I open another question or follow here?

Thanks in advance...
Hi rcamaren!

Fortunately, you don't have to download and install the Microsoft DDK (just in case, it's free for MSDN subscribers) to apply the fix I mentioned. All you need is recompile with a changed .H file. Good luck!
Hi jhance

I have XP.SP1.DDK please send source code that work to get Signal Strength of Wi-FI to me at email : kppattar@kmitl.ac.th.

Thank you very much.
Please ask your own question...
Hi karol_konkoly.

About the original question, I had the same problem. I solved it installing the Platform SDK. It includes basic data types like ULONG_PTR.

Also double check the order of the directories after installing the Platform SDK (Tools > Options > Directories).
Include files: Platform SDK includes (C:\Program Files\Microsoft SDK\Include) have to be before Visual Studio includes (C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE).
Library files: Platform SDK libraries (C:\PROGRAM FILES\MICROSOFT SDK\LIB) have to be before Visual Studio libraries (C:\Program Files\Microsoft Visual Studio\VC98\LIB).

What I do is set the Platform SDK directories at the top of the list.

This should let you compile and link WRAPI dlls and WrapiTest.cpp
Hi Venabili,

I'm not sure but I think that your comment means this points are going to be split between jhance and alexcohn.

I've solved this problem every time I had it as I explained in my post on this question (opanza Date: 04/21/2005 10:36AM BST).

If you consider so, I would like to be included in the split.

Thank you
OK. Seems like I need to reread this.

Mods, do not close - I will return for new recommendation

Venabili
opanza ,

Here is why you are not in the split - see the dates. Your answer is more than 2 months after ANY discussion on the question. Which is way too late. And although I agree that this is a good answer -- it is too late and cannot get points. Unless the asker appears again - usually 2 months later noone really still needs the answer