CredWrite function Null safety advapi32

int CredWrite(
  1. Pointer<CREDENTIAL> Credential,
  2. int Flags
)

The CredWrite function creates a new credential or modifies an existing credential in the user's credential set. The new credential is associated with the logon session of the current token. The token must not have the user's security identifier (SID) disabled.

BOOL CredWriteW(
  PCREDENTIALW Credential,
  DWORD        Flags
);

Implementation

int CredWrite(Pointer<CREDENTIAL> Credential, int Flags) {
  final _CredWrite = _advapi32.lookupFunction<
      Int32 Function(Pointer<CREDENTIAL> Credential, Uint32 Flags),
      int Function(Pointer<CREDENTIAL> Credential, int Flags)>('CredWriteW');
  return _CredWrite(Credential, Flags);
}