problem building dll for pocket pc 2003

From: wolfra (wolfra_at_gmail.com)
Date: 09/28/04


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



Relevant Pages

  • Re: using third party dll file on windows in Mex file
    ... > I am facign an issue using third party dll flle on the Windows XP ... > My problem seems that the mex compiler can not get through any places ... > SSGA.obj: error LNK2019: unresolved external symbol ...
    (comp.soft-sys.matlab)
  • using third party dll file on windows in Mex file
    ... I am facign an issue using third party dll flle on the Windows XP ... The system will pass input parameters from matlab into a C/C++ mex ... SSGA.obj: error LNK2019: unresolved external symbol ...
    (comp.soft-sys.matlab)
  • Re: LoadLibrary() in eVC
    ... System APIs in CE take wide char, ... wide-char, just fools the compiler. ... TCHAR - always use WCHAR, L"", L''. ... > I'm trying to load a dll in my eVC application using "LoadLibrary". ...
    (microsoft.public.windowsce.embedded.vc)
  • How to create exe which is dependent on a dll.
    ... Now I have to wrap this dll in a exe, so that some dos based applications can call my dll functions. ... char* pReturnedStr; ... return SfmConfigGetServer (pAppName, pReturnedStr, primary); ...
    (microsoft.public.vc.language)
  • Re: Program crashes before it starts!!!
    ... DLL could have been the source of the problem. ... string (char*) variables we pass to the DLL function being malloc'd ... int main ... char *mystr = NULL; ...
    (microsoft.public.win32.programmer.kernel)