# AcquireCredentialsHandleA

```csharp
[DllImport("SECUR32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe HRESULT AcquireCredentialsHandleA(
    PSTR pszPrincipal,
    PSTR pszPackage,
    SECPKG_CRED fCredentialUse,
    [Optional] void* pvLogonId,
    [Optional] void* pAuthData,
    SEC_GET_KEY_FN pGetKeyFn,
    [Optional] void* pvGetKeyArgument,
    SecHandle* phCredential,
    [Optional] long* ptsExpiry);
```

[secpkg\_cred](https://www.pinvoke.dev/authentication/secpkg_cred "mention")

[sec\_get\_key\_fn](https://www.pinvoke.dev/authentication/sec_get_key_fn "mention")

[sechandle](https://www.pinvoke.dev/security/sechandle "mention")
