Windows Credential Provider - How to retrieve the username from _CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION pcpcs

26 views Asked by At
public int SetSerialization(ref _CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION pcpcs)
{   
    // Convert IntPtr to byte[]
    if (pcpcs.rgbSerialization == IntPtr.Zero)
    {
        byte[] serializedData = new byte[pcpcs.cbSerialization];
        Marshal.Copy(pcpcs.rgbSerialization, serializedData, 0, (int)pcpcs.cbSerialization);
        pcpcs.rgbSerialization = Marshal.AllocCoTaskMem(serializedData.Length);
        Marshal.Copy(serializedData, 0, pcpcs.rgbSerialization, serializedData.Length);
    }
    return HRESULT.S_OK;
}

how to retrieve the username from the _CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION pcpcs.

not sure how to serialize the input credential to retrieve the username from pcpcs.

0

There are 0 answers