113 {
115 int pcbResult;
116 global::Interop.NCrypt.ErrorCode errorCode = global::Interop.NCrypt.NCryptGetProperty(ncryptHandle, propertyName, &intPtr,
IntPtr.
Size, out pcbResult,
options);
117 return errorCode switch
118 {
119 global::Interop.NCrypt.ErrorCode.NTE_NOT_FOUND =>
IntPtr.
Zero,
120 global::Interop.NCrypt.ErrorCode.ERROR_SUCCESS => intPtr,
121 _ => throw errorCode.ToCryptographicException(),
122 };
123 }
static readonly IntPtr Zero