Thread: MmMapIoSpace

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    10

    Question MmMapIoSpace

    I am trying to use MmMapIoSpace and I get the following error:

    error LNK2001: unresolved external symbol "__declspec(dllimport) void * __cdecl MmMapIoSpace(union _LARGE_INTEGER,unsigned long,enum _MEMORY_CACHING_TYPE)" (__imp_?MmMapIoSpace@@YAPAXT_LARGE_INTEGER@@KW4_ME MORY_CACHING_TYPE@@@Z)

    I think I need to link in a library, can anyone tell the name of the library that I need? I am using Win2000, Visual C++ 6.0

    Also, is there anyway to find out what libraries function calls belong to?

    Thanks,

    -geoff.

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    I think its part of the windows Driver Developement Kit (DDK)...

    Go to MSDN and download the DDK.....in there you should have all the libraries, headers & documentation you need

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    10
    I already have the DDK, the documentation does not refer to this call specifically or give the library name in which it is contained. I am sure I have the library, I am just not linking it in.

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Hmm..ok...

    I just installed my copy again and did a hex search on the 4 libraries that come with the ddk....

    Only wdm.lib had the string "MmMapIoSpace" amongst its contents (as the libs are C linkage, you can usually see the function names quite easilly), so I suggest you try with that

  5. #5
    Registered User
    Join Date
    Nov 2002
    Posts
    10
    Thanks! do I have to do something different to the project settings because of the C linkage?

  6. #6
    Registered User
    Join Date
    Nov 2002
    Posts
    10
    I went to Project->Settings->Link

    and set the "Additional Library Path" to the directory where wdm.lib lives and added wdm.lib to "Object/library modules" but I get the same error.

    Any ideas?

  7. #7
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Originally posted by geeoff99
    I went to Project->Settings->Link

    and set the "Additional Library Path" to the directory where wdm.lib lives and added wdm.lib to "Object/library modules" but I get the same error.

    Any ideas?
    As you are in VC++, try adding the following line below your includes

    Code:
    //assuming libs are in C:\NTDDK\lib\i386\free
    #pragma comment(lib,"C:\\NTDDK\\lib\\i386\\free\\wdm.lib")
    Originally posted by geeoff99
    [B]do I have to do something different to the project settings because of the C linkage?
    No

  8. #8
    Registered User
    Join Date
    Nov 2002
    Posts
    10

    Unhappy

    I still get the same error while linking ... any more ideas?

  9. #9
    Registered User
    Join Date
    Nov 2002
    Posts
    10
    Here is the code, probably will not help but it is worth a try ...

    Code:
    #include <wdm.h>
    
    #pragma comment(lib,"D:\\NTDDK\\libfre\\i386\\wdm.lib")
    
    int main()
    {
    	PVOID biosVA;
    	static PHYSICAL_ADDRESS biosPA;
    	biosVA = MmMapIoSpace( biosPA, 0x10000, MmNonCached );
    	return 0;
    }

  10. #10
    Registered User
    Join Date
    Nov 2002
    Posts
    10

    any more ideas on this one?

    any more ideas on this one? (see thread)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MmMapIoSpace
    By geeoff99 in forum Windows Programming
    Replies: 1
    Last Post: 11-30-2002, 03:05 PM