Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

error LNK2001: unresolved external symbol _WdfFunctions error LNK2001: unresolved ex

OSR_Community_UserOSR_Community_User Member Posts: 110,217
Helllo,

I am trying to create a KMDF mouse filter driver. I have picked up the keyboard filter driver from the WinDDK examples and changed it. I have removed the ioctls and I'm just trying to build it but it gives the following exception:

error LNK2001: unresolved external symbol _WdfFunctions
error LNK2001: unresolved external symbol _WdfDriverGlobals error LNK2001: unresolved external symbol _WdfDriverGlobals

If its required I can post the code as well.
Could you please help.

Indumathi.

Comments

  • Pavel_APavel_A Member Posts: 2,769
    [email protected] wrote:
    > Helllo,
    >
    > I am trying to create a KMDF mouse filter driver. I have picked up the keyboard filter driver from the WinDDK examples and changed it. I have removed the ioctls and I'm just trying to build it but it gives the following exception:
    >
    > error LNK2001: unresolved external symbol _WdfFunctions
    > error LNK2001: unresolved external symbol _WdfDriverGlobals error LNK2001: unresolved external symbol _WdfDriverGlobals
    >
    > If its required I can post the code as well.
    > Could you please help.
    >
    > Indumathi.
    >

    Try to start over from the original sample.
    Make small changes one by one, so when it breaks, you'll know exactly
    what caused it.

    Good luck,
    --PA
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Thank You. I could resolve the error by making small changes.
    Could you also let me know about the device id that is used in the .h file.
  • Ok so this is a linker error. This is generally called when it cannot find a lib. Can you post the contents of your sources file please?
  • Pavel_APavel_A Member Posts: 2,769
    [email protected] wrote:
    > Could you also let me know about the device id that is used in the .h file.

    ??
    Please see the WDK documentation,
    Device Installation -> Design Guide -> Device identification strings

    Does this answer your question?

    --PA
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    It seems pretty clear to me that you have done one of the following [or something close enough I don't intend to parse words]:

    * removed the macros from the sources file that identify this as a KMDF driver (but somehow have managed to make the code find the headers, whose paths are established by the same macro)
    * you are not using WDK build in the belief you have makfile.* figured out, and missed some of the new WDF glue we added.
    * since you have not specified your environment- perhaps you are using DDK (pre-Vista) and not WDK (Vista or later), and you can't build WDF drivers there (except WDF 1.0 and 1.1, which were add-ons that are no longer supported or available for download). In this event, something still must have been done to locate the proper header files...

    Those symbols are defined in a KMDF support library, which you are not linking. Since those are the only messages emitted, you also are not specifying the correct entry point [or there would be even more messages emitted]- so my telling you the name of the library won't help. You need a proper build environment, and if you have one, then you need to use the correct macros to identify the driver being built as a KMDF driver.

    -----Original Message-----
    <header removed>

    Helllo,

    I am trying to create a KMDF mouse filter driver. I have picked up the keyboard filter driver from the WinDDK examples and changed it. I have removed the ioctls and I'm just trying to build it but it gives the following exception:

    error LNK2001: unresolved external symbol _WdfFunctions
    error LNK2001: unresolved external symbol _WdfDriverGlobals error LNK2001: unresolved external symbol _WdfDriverGlobals

    If its required I can post the code as well.
    Could you please help.

    Indumathi.

    ---
  • Tanjilul_AlamTanjilul_Alam Member Posts: 1

    Link both the libraries : WdfDriverEntry.lib and WdfLdr.lib

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 8,448

    Given that this post was from 13 years ago, I suspect the problem has been solved.

    (Thread locked)

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

This discussion has been closed.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Developing Minifilters 24 May 2021 Live, Online
Writing WDF Drivers 14 June 2021 Live, Online
Internals & Software Drivers 27 September 2021 Live, Online
Kernel Debugging TBD 2021 Live, Online