none
VirtualCopy in giisr.c,error lnk2019: unresolved external symbol RRS feed

  • Question

  • i used function VirtualCopy() in giisr.c with windows.h and winbase.h etc included in ,but SYSGEN showed "error lnk2019: unresolved external symbol Virtualcopy...." ,i wonder if a relative .lib should be annouced in SOURCE file, but i couldn't find the proper one ,how to solve this problem?

    Monday, August 2, 2010 8:32 AM

Answers

  • Installable ISR (GIISR) is a special case; due to it runs in part of ISR call flow, so it can't use many system API. Therefore, it is only linked to static C runtime library (fulllibc.lib) and never coredll.lib.
    For what you intend to do, you can call VirtualCopy in a kernel mode driver then use KernelLibIoControl to pass the pointer to ISR. But a more sophisticated method is to use BusTransBusAddrToStatic + KernelLibIoControl. The EHCI driver in COMMON\oak\drivers\usb\hcd\usb20\ehcipdd\system.c just procide a sample.

    • Marked as answer by wenbbo Friday, August 6, 2010 12:52 PM
    Thursday, August 5, 2010 7:26 PM

All replies

  • If you open the VirtualCopy page on MSDN and scroll down, you will see you need to link against Coredll.lib. Search the sources files in your platfrom to see how they include it and copy it to your driver.

    Shai

    Monday, August 2, 2010 8:45 AM
  • I have searched the source files but found Coredll.lib be used as TARGETLIBS, rather than SOURCELIB I need, are you sure what you said, or show me a brief sentence in sourc file, many thanks for you. PS:PUBLIC\COMMON\OAK\DRIVERS\GIISR\giisr.c, which is not an application program.

    Monday, August 2, 2010 3:21 PM
  • Installable ISR (GIISR) is a special case; due to it runs in part of ISR call flow, so it can't use many system API. Therefore, it is only linked to static C runtime library (fulllibc.lib) and never coredll.lib.
    For what you intend to do, you can call VirtualCopy in a kernel mode driver then use KernelLibIoControl to pass the pointer to ISR. But a more sophisticated method is to use BusTransBusAddrToStatic + KernelLibIoControl. The EHCI driver in COMMON\oak\drivers\usb\hcd\usb20\ehcipdd\system.c just procide a sample.

    • Marked as answer by wenbbo Friday, August 6, 2010 12:52 PM
    Thursday, August 5, 2010 7:26 PM
  • many Tks for u. Helpful!
    Friday, August 6, 2010 12:52 PM
  •  

    GIISR is an installable ISR it runs in interrupt context and not in process context, you should not call any sleeping function like VirtualCopy() further more it links to functions which are not sleeping in compilation.

    Tuesday, August 10, 2010 4:30 PM