> 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/advapi32/logonuserexa.md).

# LogonUserExA

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL LogonUserExA(
    PCSTR lpszUsername,
    PCSTR lpszDomain,
    PCSTR lpszPassword,
    LOGON32_LOGON dwLogonType,
    LOGON32_PROVIDER dwLogonProvider,
    [Optional] HANDLE* phToken,
    [Optional] PSID* ppLogonSid,
    [Optional] void** ppProfileBuffer,
    [Optional] uint* pdwProfileLength,
    [Optional] QUOTA_LIMITS* pQuotaLimits);
```

[LOGON32\_LOGON](/security/logon32_logon.md)

[LOGON32\_PROVIDER](/security/logon32_provider.md)

[QUOTA\_LIMITS](/security/quota_limits.md)
