Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

Monthly Seminars at OSR Headquarters

East Coast USA
Windows Internals and SW Drivers, Dulles (Sterling) VA, 13 November 2017


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 11  
14 May 17 08:39
Sunil Dev
xxxxxx@gmx.com
Join Date: 14 May 2017
Posts To This List: 11
Unable to set DPOOL_NX_OPTIN=1 macro in VS2015 for nonPagedPoolNx optin

Hi All, I am trying to OPTIN NonPagedPoolNx pool type when bulding for Windows version >= 8. So, as mentioned at https://msdn.microsoft.com/en-us/library/windows/hardware/hh920402(v=vs.85).aspx, I have added C_DEFINES=$(C_DEFINES) -DPOOL_NX_OPTIN=1 in my driver .vcxproj file for Windows 10 Release configuration under C/C++ -> Preprocessor definitions and also called ExInitializeDriverRuntime(DrvRtPoolNxOptIn); in my driver entry. But it seems, that my driver source code is not getting the DPOOL_NX_OPTIN macro because when I manually define this macro inside the source code, the Win10 code integrity test passes. So please let me know if I am doing any mistake in assigning DPOOL_NX_OPTIN=1 macro in the property page. Thanks in advance.
  Message 2 of 11  
14 May 17 08:52
Doron Holan
xxxxxx@microsoft.com
Join Date: 08 Sep 2005
Posts To This List: 10075
Unable to set DPOOL_NX_OPTIN=1 macro in VS2015 for nonPagedPoolNx optin

Execute a build on the command line and see what is being passed to cl.exe. Or put in something like this that will not compile to make sure it is being set #if POOL_NX_OPTIN Blah blah #endif If it is being properly set, move on to the next step in debugging why you are failing the test Bent from my phone ________________________________ From: xxxxx@lists.osr.com <xxxxx@lists.osr.com> on behalf of xxxxx@gmx.com <xxxxx@gmx.com> Sent: Sunday, May 14, 2017 5:39:09 AM To: Windows System Software Devs Interest List Subject: [ntdev] Unable to set DPOOL_NX_OPTIN=1 macro in VS2015 for nonPagedPoolNx optin Hi All, I am trying to OPTIN NonPagedPoolNx pool type when bulding for Windows version >= 8. So, as mentioned at https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmsdn.microsoft.c om%2Fen-us%2Flibrary%2Fwindows%2Fhardware%2Fhh920402(v%3Dvs.85).aspx&data=02%7C01 %7CDoron.Holan%40microsoft.com%7C65c649239d3440dad5b108d49ac64169%7C72f988bf86f14 1af91ab2d7cd011db47%7C1%7C0%7C636303623669124147&sdata=2OiyKxlyT71p5lVmwAXHY3jHSm F80s2h3p3CfMI34WI%3D&reserved=0, I have added C_DEFINES=$(C_DEFINES) -DPOOL_NX_OPTIN=1 in my driver .vcxproj file for Windows 10 Release configuration under C/C++ -> Preprocessor definitions and also called ExInitializeDriverRuntime(DrvRtPoolNxOptIn); in my driver entry. But it seems, that my driver source code is not getting the DPOOL_NX_OPTIN macro because when I manually define this macro inside the source code, the Win10 code integrity test passes. So please let me know if I am doing any mistake in assigning DPOOL_NX_OPTIN=3D1 macro in the property page. Thanks in advance. --- NTDEV is sponsored by OSR Visit the list online at: <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fshowlists.cfm%3Flist%3Dntdev&data=02%7C01%7CDoron.Holan%40microsoft.com%7C65c 649239d3440dad5b108d49ac64169%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636303 623669124147&sdata=pVWw%2FVVgvb%2F2V4Tl2mG8zDEh%2FxSabosA9xBe5PZhZgs%3D&reserved= 0> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osr.com%2Fse minars&data=02%7C01%7CDoron.Holan%40microsoft.com%7C65c649239d3440dad5b108d49ac64 169%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636303623669124147&sdata=nVZhr8% 2Fg7EMooUYekj6ILUANab2d5UpB9eYSj9sRg9I%3D&reserved=0> To unsubscribe, visit the List Server section of OSR Online at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fpage.cfm%3Fname%3DListServer&data=02%7C01%7CDoron.Holan%40microsoft.com%7C65c 649239d3440dad5b108d49ac64169%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636303 623669124147&sdata=zwkd%2F%2Fyq1ZaXd1VEPqw40UiJP6Kq8If1ZG1aZ4eP9XA%3D&reserved=0> --
  Message 3 of 11  
14 May 17 09:40
Sunil Dev
xxxxxx@gmx.com
Join Date: 14 May 2017
Posts To This List: 11
Unable to set DPOOL_NX_OPTIN=1 macro in VS2015 for nonPagedPoolNx optin

(OSR Online does not support single-part messages with Content-Type: text/html)
  Message 4 of 11  
14 May 17 09:45
ntdev member 172838
xxxxxx@outlook.com
Join Date:
Posts To This List: 28
Unable to set DPOOL_NX_OPTIN=1 macro in VS2015 for nonPagedPoolNx optin

-D is just a compiler command line switch. In C/C++ -> Preprocessor -> Preprocessor definitions, you should only add the following definition: POOL_NX_OPTIN=1 Than, in C/C++ -> Command line, you should look for: /D "POOL_NX_OPTIN=1" J. S.
  Message 5 of 11  
14 May 17 10:51
ntdev member 172838
xxxxxx@outlook.com
Join Date:
Posts To This List: 28
Unable to set DPOOL_NX_OPTIN=1 macro in VS2015 for nonPagedPoolNx optin

« Please let me know how can we introduce a new MACRO in an existing VS2015 solution so that it is recognized by the msbuild.exe during compilation. » Modifications apply to the active configuration and platform unless you choose other ones in the project property window. So if you run MSBUILD with the right configuration and platform, you changes should apply. To add a macro, open the project property page, than in C/C++ > Preprocessor, select (click on) ‘Preprocessor definitions’. Click on the down arrow on the right and choose Edit or Modify. Just write your macro in the edit window and click the Ok button. J. S.
  Message 6 of 11  
17 May 17 01:43
Sunil Dev
xxxxxx@gmx.com
Join Date: 14 May 2017
Posts To This List: 11
Unable to set DPOOL_NX_OPTIN=1 macro in VS2015 for nonPagedPoolNx optin

It is working now. Seems like the problem was with the extra spaces between "DPOOL_NX_OPTIN" and "1". However, there is a new problem. one of my drivers has multiple source files, and only one file has the DriverEntry defined. So even if I call "ExInitializeDriverRuntime(DrvRtPoolNxOptIn)" in this driver entry, it does not replace "NonPagedPool" with "NonPagedPoolNx" that are present in other source codes. What should be the recommended way to address this scenario?
  Message 7 of 11  
17 May 17 05:12
David Boyce
xxxxxx@becrypt.com
Join Date: 19 Mar 2015
Posts To This List: 67
Unable to set DPOOL_NX_OPTIN=1 macro in VS2015 for nonPagedPoolNx optin

Where I have identical settings (of any kind) to apply to more than one VS project, I like to use Project Property Sheets (.props files). These establish properties that can be 'inherited' by any project they are associated with. (VS Menus: View/Property Manager, right click on one or more projects in Property Manager tab, Add New (or Existing) Property Sheet, adjust its Properties, save and build.) In this case, you would add POOL_NX_OPTIN=1 to the C/C++ Preprocessor property in the sheet. > > It is working now. Seems like the problem was with the extra spaces > between "DPOOL_NX_OPTIN" and "1". However, there is a new problem. one > of my drivers has multiple source files, and only one file has the > DriverEntry defined. So even if I call > "ExInitializeDriverRuntime(DrvRtPoolNxOptIn)" in this driver entry, it > does not replace "NonPagedPool" with "NonPagedPoolNx" that are present > in other source codes. > > What should be the recommended way to address this scenario? --
  Message 8 of 11  
17 May 17 10:27
Scott Noone
xxxxxx@osr.com
Join Date:
Posts To This List: 1319
List Moderator
Unable to set DPOOL_NX_OPTIN=1 macro in VS2015 for nonPagedPoolNx optin

You have something wrong, this works properly even if you have multiple source files (see wdm.h for how POOL_NX_OPTIN works). -scott OSR @OSRDrivers wrote in message news:223874@ntdev... It is working now. Seems like the problem was with the extra spaces between "DPOOL_NX_OPTIN" and "1". However, there is a new problem. one of my drivers has multiple source files, and only one file has the DriverEntry defined. So even if I call "ExInitializeDriverRuntime(DrvRtPoolNxOptIn)" in this driver entry, it does not replace "NonPagedPool" with "NonPagedPoolNx" that are present in other source codes. What should be the recommended way to address this scenario?
  Message 9 of 11  
17 May 17 11:53
Utkal Sinha
xxxxxx@gmail.com
Join Date: 09 Mar 2017
Posts To This List: 8
Unable to set DPOOL_NX_OPTIN=1 macro in VS2015 for nonPagedPoolNx optin

I have defined the macro in project property sheet only. Also I haved verified that the child source files also have this macro inherited. My problem is with the ExInitializeRuntime() function call. I have checked its definition in wdm.h. It's an inline function. I have called it in the driverentry routine. However, I still don't get how it is obvious that this inline function being in one source file will also be able to replace nonpagedpool with nonpagedpoolnx in other source file of the same project ? On 17-May-2017 7:57 PM, "Scott Noone" <xxxxx@osr.com> wrote: > You have something wrong, this works properly even if you have multiple > source files (see wdm.h for how POOL_NX_OPTIN works). > > -scott > OSR > @OSRDrivers > > wrote in message news:223874@ntdev... > > It is working now. Seems like the problem was with the extra spaces <...excess quoted lines suppressed...> --
  Message 10 of 11  
17 May 17 12:48
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 11587
Unable to set DPOOL_NX_OPTIN=1 macro in VS2015 for nonPagedPoolNx optin

Utkal Sinha wrote: > > My problem is with the ExInitializeRuntime() function call. I have > checked its definition in wdm.h. It's an inline function. I have > called it in the driverentry routine. However, I still don't get how > it is obvious that this inline function being in one source file will > also be able to replace nonpagedpool with nonpagedpoolnx in other > source file of the same project ? For ExInitializeDriverRuntime to work, you still have to define POOL_NX_OPTIN in every source file. When you use POOL_NX_OPTIN, it redefines the constant "NonPagedPool" to be ExDefaultNonPagedPoolType, which is a driver global. All that ExInitializeRuntime does is set the global variable ExDefaultNonPagedPoolType to either NonPagedPool or NonPagedPoolNx, depending on the operating system support. The net effect is that POOL_NX_OPTIN turns this: ExAllocatePool( NonPagedPool, 1234 ); into this: ExAllocatePool( ExDefaultNonPagedPoolType, 1234 ); and the value of that variable is what gets redefined at runtime. -- Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
  Message 11 of 11  
17 May 17 14:45
ntdev member 172858
xxxxxx@outlook.com
Join Date:
Posts To This List: 27
Unable to set DPOOL_NX_OPTIN=1 macro in VS2015 for nonPagedPoolNx optin

First, in wdm.h : #define NonPagedPool ExDefaultNonPagedPoolType And then in the inline function called in DriverEntry : ExDefaultNonPagedPoolType = NonPagedPoolNx ; W. N.
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 07:47.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license