Hello @ふみや 竹崎 and thank you for your detailed questions.
As Microsoft Q&A is a community support forum, I may not be able to provide authoritative confirmation of undocumented API behavior. However, I can help clarify what is established by the available Windows API documentation.
1. Query API support
I cannot confirm whether GetProcessMitigationPolicy officially supports ProcessChildProcessPolicy, as it is not listed among the function's documented supported policies.
For version compatibility, the related PROCESS_MITIGATION_CHILD_PROCESS_POLICY structure is documented for Windows 10 version 1709 and Windows Server 2016. However, I cannot confirm whether these versions also support querying the policy through GetProcessMitigationPolicy.
2. Return structure and buffer length
The Windows Driver Kit documents PROCESS_MITIGATION_CHILD_PROCESS_POLICY in ntddk.h. This structure contains a 32-bit flags field with the following members:
- NoChildProcessCreation
- AuditNoChildProcessCreation
- AllowSecureProcessCreation
Its size is 4 bytes. However, the documentation does not establish this structure as the return buffer for GetProcessMitigationPolicy when using ProcessChildProcessPolicy.
Therefore, I cannot confirm an officially supported user-mode equivalent or the required dwLength for this particular query.
3. Querying a suspended process
A launcher can query documented process mitigation policies while the target process is suspended.
When a process is created with CREATE_SUSPENDED, its primary thread remains suspended until resumed. The launcher can use the process handle returned by CreateProcess with GetProcessMitigationPolicy, provided it has PROCESS_QUERY_INFORMATION access.
However, since ProcessChildProcessPolicy is not among the function's documented supported policies, I cannot confirm whether this particular query works before the process resumes.
4. Relationship to process creation attributes
PROC_THREAD_ATTRIBUTE_CHILD_PROCESS_POLICY is a documented process creation attribute that can be configured through UpdateProcThreadAttribute.
The documented values include:
- PROCESS_CREATION_CHILD_PROCESS_RESTRICTED: Restricts the process from creating child processes.
- PROCESS_CREATION_CHILD_PROCESS_OVERRIDE: Allows the process to override the restriction under the documented conditions.
The related PROCESS_MITIGATION_CHILD_PROCESS_POLICY structure also defines separate flags for enforced restrictions (NoChildProcessCreation) and audit-only behavior (AuditNoChildProcessCreation).
However, the documentation does not establish that GetProcessMitigationPolicy can reliably read back the policy configured through the creation attribute before the process resumes.
Although the structure distinguishes enforced restrictions from audit-only behavior, I cannot confirm a supported user-mode query that exposes this distinction.
5. Supported verification method
I could not identify a documented user-mode API that independently verifies the applied child-process creation restriction before the target process begins executing.
For an implementation using PROC_THREAD_ATTRIBUTE_CHILD_PROCESS_POLICY, you can check whether UpdateProcThreadAttribute and CreateProcess succeed and retain the configured attribute value on the launcher side.
This allows you to verify that the requested configuration was supplied through the documented process creation mechanism, although it does not independently confirm the resulting mitigation state.
I hope this helps clarify the documented behavior and the limitations of the available API information.
If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation. Thank you.