ExAllocatePool2 always returns NULL [Verifier disabled & VM Environment]

I would like to ask for help with the development of drivers for the windows kernel.

Explanation: I'm getting nullptr after calling: ExAllocatePool2, for an input of 108 Bytes
I've read several topics and by default I've already disabled all verifiers (1. cmd | 2. verifier | 3. Delete all) Note: I am a beginner in the area, for this reason after buying the reference book, I am trying to complete this specific tutorial.

Setting Key Setting Result
Enviroment VMWare Workstation
Free RAM 4GB Free

The code:
https://pastebin.com/eP7dibvQ


The command:
sc create sample type= kernel binPath= c:\MyDriver\MyDriver.sys


Attempts already made:

  • Disable the checker.
  • bcdedit /set testsigning on

The error:



Can someone please help me?

Thanks,
Lucas P.

I did a test on my host (main) computer, and the same virtualized machine error is happening

Read the docs for ExAllocatePool2. That first parameter is a set of flags, of which PagedPool is not one. You want set of flags ORed together, like POOL_FLAG_PAGED.

@Jeremy_Hurren said:
Read the docs for ExAllocatePool2. That first parameter is a set of flags, of which PagedPool is not one. You want set of flags ORed together, like POOL_FLAG_PAGED.

Thanks, the problem was exactly that