juner / WinCred

WinCred.h を C#に移植

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Attribute を Unmanaged.CredentialAttribute から CredentialAttribute にコピーできない

juner opened this issue · comments

commented

//Attributes = (Attributes ?? Enumerable.Empty<CredentialAttribute>())
// .Select(uca => uca.ToManaged())
// .ToArray(),

のコメントアウトを解除すると
Unmanaged.Credential の Attributes プロパティ にて 構造体 Unmanaged.CredentialAttribute の取得……
具体的には
return (CredentialAttribute)Marshal.PtrToStructure(Ptr, typeof(CredentialAttribute));

の箇所で
マネージ デバッグ アシスタント 'FatalExecutionEngineError' : 'ランタイムの重大なエラーが発生しました。エラーのアドレスは 0x736ac430、スレッド 0x1e48 です。エラー コードは 0xc0000005 です。これは CLR のバグであるか、またはユーザー コードのアンセーフまたは確認不可能な部分にバグがある可能性があります。このバグの一般的な原因には、スタックが壊れる可能性のある COM-interop または PInvoke のユーザー マーシャリング エラーが含まれています。
となる。
Unmanaged.Credential#Attributes を取得するには他の方法を模索しなくてはならない。