> For the complete documentation index, see [llms.txt](https://www.pinvoke.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pinvoke.dev/secur32/acquirecredentialshandlea.md).

# 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](/authentication/secpkg_cred.md)

[SEC\_GET\_KEY\_FN](/authentication/sec_get_key_fn.md)

[SecHandle](/security/sechandle.md)
