Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code neatpick: ExAllocatePoolWithTag deprecated, page 44 #7

Open
profnandaa opened this issue Apr 25, 2023 · 5 comments
Open

code neatpick: ExAllocatePoolWithTag deprecated, page 44 #7

profnandaa opened this issue Apr 25, 2023 · 5 comments

Comments

@profnandaa
Copy link
Contributor

image

  1. UNREFERENCED_PARAMETER not needed since DriverObject is referenced?
  2. Did we need to cast RegistryPath since it was already PUNICODE_STRING from the DriverEntry function definition?
  3. Lastly I get warning that ExAllocatePoolWithTag is deprecated:

Warning C4996 'ExAllocatePoolWithTag': ExAllocatePoolWithTag is deprecated, use ExAllocatePool2.

This might require update of table 3-4 too on page 42:

image

==
Developing on Windows 11.

@zodiacon
Copy link
Owner

Yes, I need to fix the table of functions.
The cast is needed, since it's a pointer to a const UNICODE_STRING
The UNREFERENCED_PARAMETER is not needed, but it doesn't hurt, either.

@profnandaa
Copy link
Contributor Author

profnandaa commented Apr 25, 2023 via email

@profnandaa
Copy link
Contributor Author

While at it, remember to also update the ExAllocatePool2 argument from PagedPool to POOL_FLAG_PAGED since they are different enums. Took me some time before noticing since I kept getting insufficient resource error.

PS> sc.exe start SampleMem
[SC] StartService FAILED 1450:

Insufficient system resources exist to complete the requested service.

Wish they could have made it fully backward compatible with ExAllocatePoolWithTag interface wise.

@profnandaa profnandaa changed the title code neatpick: page 44 code neatpick: ExAllocatePoolWithTag deprecated, page 44 Jun 7, 2023
@profnandaa
Copy link
Contributor Author

While at it, you can also update the ExAllocatePoolWithTagPriority to ExAllocatePool3 in pg. 226.

image

@profnandaa
Copy link
Contributor Author

While at it, you can also update the ExAllocatePoolWithTagPriority to ExAllocatePool3 in pg. 226.

image

RE: previous comment
PS. Since you've explained in pgs 228-229, I think, just a side note will be enough. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants