Windows 11 PSEC API returns 0x80070002 under session-0 batch logon — request for Windows engineering guidance.

DJones 0 Reputation points
2026-11-20T15:36:53.13+00:00

Hello,

I'm requesting technical guidance regarding the native Windows CreateProcessSecurityEnvironment API, exported by processmodel.dll.

We previously submitted a detailed investigation to the Microsoft MXC repository:

https://github.com/microsoft/mxc/issues/1631

The issue has been triaged and categorized but remains unresolved. Because the PSEC implementation resides within Windows itself, we're hoping someone familiar with the Windows API or ProcessContainer implementation can help identify the appropriate supported diagnostic procedure.

Verified failure

Environment: Windows 11 Home 25H2, build 26200.9711, x64.

Native operation: CreateProcessSecurityEnvironment

Observed result: HRESULT 0x80070002 (ERROR_FILE_NOT_FOUND), null PSEC handle.

The diagnostic successfully resolves the Windows API-set, loads the required System32 DLLs and resolves the native exports. The failure occurs during environment creation, before startup attributes are initialized or a child process is started.

The input is a verified, 88-byte PSEC 1.0 FlatBuffer specification, with creation flags zero and no explicit filesystem paths or grants.

The failing caller uses:

Medium integrity, non-elevated token

Restricted-token indicator enabled

Non-AppContainer context

Session 0

Batch logon type 4

No loaded user-profile hive

A previous interactive-account diagnostic accepted the same serialized specification hash on the same reported Windows build. However, several environmental differences remain, so the cause has not been isolated.

Questions for Windows engineering

Is native PSEC creation supported under this exact batch-logon/session-0 context? Does the API require a loaded profile hive or other caller-specific prerequisites?

What documented Windows operation or prerequisite can produce 0x80070002 during PSEC environment creation when no filesystem grants are specified?

Is there a supported, narrowly scoped diagnostic interface for identifying the failing internal operation without changing the caller's token, modifying the security policy or enabling permissive learning mode?

If this behavior falls outside the public Windows SDK documentation, which Windows engineering team or technical-support channel owns the implementation?

We have already performed extensive offline verification and non-invasive system inspection. We deliberately have not weakened the sandbox, modified Windows services or drivers, or changed the original security context.

We are looking for an authoritative prerequisite contract or safe diagnostic method, rather than speculative workarounds.

Thank you for any guidance or referral to the appropriate Windows engineering team.

Windows 11 PSEC API returns 0x80070002 under session-0 batch logon — request for Windows engineering guidance

Hello,

I'm requesting technical guidance regarding the native Windows CreateProcessSecurityEnvironment API, exported by processmodel.dll.

We previously submitted a detailed investigation to the Microsoft MXC repository:

https://github.com/microsoft/mxc/issues/1631

The issue has been triaged and categorized but remains unresolved. Because the PSEC implementation resides within Windows itself, we're hoping someone familiar with the Windows API or ProcessContainer implementation can help identify the appropriate supported diagnostic procedure.

Verified failure

Environment: Windows 11 Home 25H2, build 26200.9711, x64.

Native operation: CreateProcessSecurityEnvironment

Observed result: HRESULT 0x80070002 (ERROR_FILE_NOT_FOUND), null PSEC handle.

The diagnostic successfully resolves the Windows API-set, loads the required System32 DLLs and resolves the native exports. The failure occurs during environment creation, before startup attributes are initialized or a child process is started.

The input is a verified, 88-byte PSEC 1.0 FlatBuffer specification, with creation flags zero and no explicit filesystem paths or grants.

The failing caller uses:

Medium integrity, non-elevated token

Restricted-token indicator enabled

Non-AppContainer context

Session 0

Batch logon type 4

No loaded user-profile hive

A previous interactive-account diagnostic accepted the same serialized specification hash on the same reported Windows build. However, several environmental differences remain, so the cause has not been isolated.

Questions for Windows engineering

Is native PSEC creation supported under this exact batch-logon/session-0 context? Does the API require a loaded profile hive or other caller-specific prerequisites?

What documented Windows operation or prerequisite can produce 0x80070002 during PSEC environment creation when no filesystem grants are specified?

Is there a supported, narrowly scoped diagnostic interface for identifying the failing internal operation without changing the caller's token, modifying the security policy or enabling permissive learning mode?

If this behavior falls outside the public Windows SDK documentation, which Windows engineering team or technical-support channel owns the implementation?

We have already performed extensive offline verification and non-invasive system inspection. We deliberately have not weakened the sandbox, modified Windows services or drivers, or changed the original security context.

We are looking for an authoritative prerequisite contract or safe diagnostic method, rather than speculative workarounds.

Thank you for any guidance or referral to the appropriate Windows engineering team.

Windows development | Windows API - Win32
0 comments No comments

1 answer

Sort by: Newest
  1. Gatlin Le (WICLOUD CORPORATION) 1,495 Reputation points Microsoft External Staff Moderator
    2026-11-23T03:05:27.0333333+00:00

    Hi @DJones ,

    Thank you for the detailed write-up and for keeping the scope so precise. Based on the public Microsoft documentation I reviewed, the caller context, prerequisite, error-code, and diagnostic questions you raised do not appear to be covered at this point, so an authoritative answer would most likely need to come from Microsoft engineering.

    The CreateProcessSecurityEnvironment function reference currently contains the syntax, the parameter names, and the processmodel.h header requirement, without remarks, return value, or caller requirement sections. The query functions in the same API set, IsProcessSecurityEnvironmentVersionSupported and QueryProcessSecurityEnvironmentSupport, are documented in the same syntax-only form. None of these pages appears to go into logon type, session, profile hive, or token requirements, or to map a specific HRESULT such as 0x80070002 to a creation-time prerequisite.

    For the diagnostic part, the Process security environments overview describes the API set as functions for creating and managing process security environments and learning-mode traces. Apart from the learning-mode trace functions, which you have already ruled out, the reference does not appear to list a separate diagnostic interface. In the pages I reviewed, I have not come across public documentation for the OS TraceLogging provider referenced in the MXC source either.

    Since my input on the forum is mostly limited to what the public documentation states, Windows Developer Support may be the more suitable place if you need a deeper, authoritative answer on the native API contract and its prerequisites. There you can choose the support option that best fits your scenario, and the details you have already collected in this post and in issue #1631 would likely be useful when opening a case.

    I hope the documentation above helps clarify at least part of the picture. If the information has helped you move forward, you are welcome to follow the guidance when convenient, as it can help others with a similar question find it more easily.

    Thank you.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.