CredRead function Null safety advapi32

int CredRead (
  1. Pointer<Utf16> TargetName,
  2. int Type,
  3. int Flags,
  4. Pointer<Pointer<CREDENTIAL>> Credential
)

The CredRead function reads a credential from the user's credential set. The credential set used is the one associated with the logon session of the current token. The token must not have the user's SID disabled.

BOOL CredReadW(
  LPCWSTR      TargetName,
  DWORD        Type,
  DWORD        Flags,
  PCREDENTIALW *Credential
);

Implementation

int CredRead(Pointer<Utf16> TargetName, int Type, int Flags,
    Pointer<Pointer<CREDENTIAL>> Credential) {
  final _CredRead = _advapi32.lookupFunction<
      Int32 Function(Pointer<Utf16> TargetName, Uint32 Type, Uint32 Flags,
          Pointer<Pointer<CREDENTIAL>> Credential),
      int Function(Pointer<Utf16> TargetName, int Type, int Flags,
          Pointer<Pointer<CREDENTIAL>> Credential)>('CredReadW');
  return _CredRead(TargetName, Type, Flags, Credential);
}