problem building dll for pocket pc 2003
From: wolfra (wolfra_at_gmail.com)
Date: 09/28/04
- Next message: Gerry Quinn: "Re: need help in formulating an algorithm on medical diagnosis"
- Previous message: sathya_me: "problem solving and programming links needed"
- Next in thread: wolfra: "Re: problem building dll for pocket pc 2003"
- Reply: wolfra: "Re: problem building dll for pocket pc 2003"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Sep 2004 02:15:23 -0700
Hallo, I've got a problem building a dll I want to use in order to get
the MAC address of the access point I'm connected to with a pocket pc
2003 mobile device.
I've checked all the headers and libraries needed in order to execute
query on the ndis layer and I should have all of them. I don't get any
error comiling the code (just 1 warning, variable non initialized).
the build error occours while performing link operation. the error is
the following:
dipDLLmac.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) void __cdecl NdisOpenAdapter(int *,int *,void *
*,unsigned int *,enum _NDIS_MEDIUM *,unsigned int,void *,void *,struct
_UNICODE_STRING *,unsigned int,struct _STRING *)"
(__imp_?NdisOpenAdapter@@YAXPAH0PAPAXPAIPAW4_NDIS_MEDIUM@@IPAX4PAU_UNICODE_STRING@@IPAU_STRING@@@Z)
referenced in function "char * __cdecl GetAccessPointMAC(unsigned
short *)" (?GetAccessPointMAC@@YAPADPAG@Z)
emulatorDbg/dipDLLmac.dll : fatal error LNK1120: 1 unresolved
externals
Error executing link.exe.
the code of the dll is the following:
// OID_802_11_BSSID
//
#include "stdafx.h"
#include "Ndis.h"
#include "Iptypes.h"
#include "Iphlpapi.h"
PIP_ADAPTER_INFO GetAdapters()
{
PIP_ADAPTER_INFO pAdapterInfo = NULL;
PULONG pOutBufLen = (PULONG)sizeof(PIP_ADAPTER_INFO);
GetAdaptersInfo(pAdapterInfo, pOutBufLen);
return pAdapterInfo;
}
char* GetAccessPointMAC(PWSTR AdapterName)
{
char* result = "MAC";
UNICODE_STRING uAdapterName;
uAdapterName.Length = sizeof(AdapterName);
uAdapterName.MaximumLength = sizeof(AdapterName);
uAdapterName.Buffer = AdapterName;
// servono NDIS_REQUEST ed NdisOpenAdapter
NDIS_STATUS status; //*
NDIS_HANDLE handle;
NDIS_REQUEST request; //*
//NdisOpenAdapter
NDIS_STATUS opStatus; //*
NDIS_STATUS opOpenErrorStatus; //*
NDIS_HANDLE NdisHandle; //*
UINT opSelectMediumIndex; //*
NDIS_MEDIUM opMediumArray = NdisMediumWirelessWan; //*
UINT opMediumArraySize = 1;
NDIS_HANDLE opNdisHandle = 0;
NDIS_HANDLE *opProtocolBindingContext; //*
NDIS_STRING opAdapterName = uAdapterName;
UINT OpenOptions = 0;
PSTRING AddressingInformation = NULL;
NdisOpenAdapter(&opStatus, &opOpenErrorStatus, &NdisHandle,
&opSelectMediumIndex, &opMediumArray, opMediumArraySize,
&opNdisHandle, &opProtocolBindingContext, &opAdapterName,
OpenOptions, AddressingInformation);
//query informations
PVOID buffer;
request.RequestType = NdisRequestQueryInformation;
request.DATA.QUERY_INFORMATION.Oid = OID_802_11_BSSID;
request.DATA.QUERY_INFORMATION.InformationBuffer = &buffer;
request.DATA.QUERY_INFORMATION.InformationBufferLength =
sizeof(PVOID);
request.DATA.QUERY_INFORMATION.BytesWritten = 6;
request.DATA.QUERY_INFORMATION.BytesNeeded = 6;
NdisRequest(&status, handle, &request);
return result;
}
any help is appreciated.
Thanks, Wolfra
p.s.: sorry for my English, I'm Italian
- Next message: Gerry Quinn: "Re: need help in formulating an algorithm on medical diagnosis"
- Previous message: sathya_me: "problem solving and programming links needed"
- Next in thread: wolfra: "Re: problem building dll for pocket pc 2003"
- Reply: wolfra: "Re: problem building dll for pocket pc 2003"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|