Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results
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/
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?
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! | ||
Kernel Debugging | 16-20 October 2023 | Live, Online |
Developing Minifilters | 13-17 November 2023 | Live, Online |
Internals & Software Drivers | 4-8 Dec 2023 | Live, Online |
Writing WDF Drivers | 10-14 July 2023 | Live, Online |
Comments
You just add libcntpr.lib to the list of libraries to load.
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.
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.
What "didn't work"? It didn't compile? Or it didn't link?
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.
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'
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.
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.