---
name: "SHGetFolderLocation"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/SHGetFolderLocation"
---

# SHGetFolderLocation(3w)

## NAME

**SHGetFolderLocation** (SHELL32.@)

## SYNOPSIS

HRESULT SHGetFolderLocation\
  (\
   HWND          *hwndOwner*,\
   int           *nFolder*,\
   HANDLE        *hToken*,\
   DWORD         *dwReserved*,\
   LPITEMIDLIST\* *ppidl*\
  )

## DESCRIPTION

Gets the folder locations from the registry and creates a pidl.

## PARAMS

*hwndOwner* **\[In\]**  **.**

*nFolder* **\[In\]**  CSIDL\_xxxxx.

*hToken* **\[In\]**  token representing user, or **NULL** for current user, or **-1** for default user.

*dwReserved* **\[In\]**  must be zero.

*ppidl* **\[Out\]**  **PIDL** of a special folder.

## RETURNS

**Success:** **S\_OK**

**Failure:** Standard OLE-defined error result, **S\_FALSE** or **E\_INVALIDARG**.

## NOTES

Creates missing reg keys and directories. Mostly forwards to SHGetFolderPathW, but a few values of *nFolder* return virtual folders that are handled here.

## IMPLEMENTATION

Declared in **"shlobj.h"**.

Implemented in **"dlls/shell32/shellpath.c"**.

Debug channel **"shell"**.
