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

# LookupAccountSidW

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL LookupAccountSidW(
    PCWSTR lpSystemName,
    PSID Sid,
    PWSTR Name,
    uint* cchName,
    PWSTR ReferencedDomainName,
    uint* cchReferencedDomainName,
    SID_NAME_USE* peUse);
```

{% content-ref url="/pages/W118Dn5hOYywNnAfun7u" %}
[SID\_NAME\_USE](/security/sid_name_use.md)
{% endcontent-ref %}
