On Windows 11,If credential guard is on and Kerberos credential cache is stored in MSLSA then behavior of API krb5_get_credentials vary
Scenario1: credential guard value as below
result of powershell command

PS C:\Users\DipenPatel> (Get-CimInstance -ClassName Win32_DeviceGuard -Namespace root\Microsoft\Windows\DeviceGuard).SecurityServicesRunning
1
2
PS C:\Users\DipenPatel>

For this scenario API krb5_get_credentials with kerberos credential cache returns '0' as expected.
Scenario2: credential guard value as below
result of powershell command

PS C:\Users\DipenPatel> (Get-CimInstance -ClassName Win32_DeviceGuard -Namespace root\Microsoft\Windows\DeviceGuard).SecurityServicesRunning
1
PS C:\Users\DipenPatel>

For this scenario API krb5_get_credentials with kerberos credential cache returns '1'. with error 'KRB5_CC_NOTFOUND'


NOTE:- Windows document link to Verify if Credential Guard is enabled as below.
"https://learn.microsoft.com/en-us/windows/security/identity-protection/credential-guard/configure?tabs=reg"