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

Missing PROCESS_CREATION_MITIGATION_POLICY_* macros #2031

Open
talagrand opened this issue Dec 2, 2024 · 1 comment
Open

Missing PROCESS_CREATION_MITIGATION_POLICY_* macros #2031

talagrand opened this issue Dec 2, 2024 · 1 comment

Comments

@talagrand
Copy link

Most of the macros documented on this page, defined in WinBase.h, are missing:
https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-updateprocthreadattribute

3 macros exist, which are defined as simple constants:
#define PROCESS_CREATION_MITIGATION_POLICY_DEP_ENABLE 0x01

But the ones that are more complex are missing:
#define PROCESS_CREATION_MITIGATION_POLICY_FORCE_RELOCATE_IMAGES_MASK (0x00000003 << 8)

IIRC from looking at the code a ~year ago whether to create constants out of macros is a regular expression heuristic, so I wanted to flag this case.

@riverar
Copy link
Collaborator

riverar commented Dec 2, 2024

Note to self:

winbase.h

#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
//
// Define legacy creation mitigation policy options, which are straight
// bitmasks.  Bits 0-5 are legacy bits.
//

#define PROCESS_CREATION_MITIGATION_POLICY_DEP_ENABLE            0x01
#define PROCESS_CREATION_MITIGATION_POLICY_DEP_ATL_THUNK_ENABLE  0x02
#define PROCESS_CREATION_MITIGATION_POLICY_SEHOP_ENABLE          0x04
#endif

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