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

Home NTDEV

Before Posting...

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

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/


USE_LIBCNTPR=1

wtu08373wtu08373 Member Posts: 5

There used to be this directive USE_LIBCNTPR=1 with the old build system.
How can I accomplish this with a Visual Studio driver project?

Comments

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,348

    You just add libcntpr.lib to the list of libraries to load.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • wtu08373wtu08373 Member Posts: 5

    Thanks, however for some reason that didn't seem to work. I'm trying to use _wcstoui64 and it compiled for me when using the build environment but failed with Visual Studio.

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,348

    What "didn't work"? It didn't compile? Or it didn't link?

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • wtu08373wtu08373 Member Posts: 5

    It didn't link.
    There is some quirk which I couldn't figure out exactly.
    If I just use that API in the main driver project and add libcntpr.lib as an input to the linker, it builds fine.
    But when I use it in a driver library, it fails to link, either because of unresolved symbol, or because of LNK4217
    symbol '_wcstoui64' defined in 'libcntpr.lib(_wcstoq.obj)' is imported by 'Utilities.lib(miscxxx.obj)' in function 'Utilxxx'

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,348

    LNK4217 is just a warning that the symbol was prototyped as an import (__declspec(dllimport) ), but was actually defined as a local symbol. It can be ignored. Did you add your own declaration for this function?

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • wtu08373wtu08373 Member Posts: 5

    Sorry for late reply - somehow the error got resolved by itself. ;-)
    Yes, just putting libcntpr.lib in the linker input for the driver project is working.
    Thanks for your help.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

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!
Writing WDF Drivers 12 September 2022 Live, Online
Internals & Software Drivers 23 October 2022 Live, Online
Kernel Debugging 14 November 2022 Live, Online
Developing Minifilters 5 December 2022 Live, Online