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

# ExpandEnvironmentStringsW(3w)

## NAME

**ExpandEnvironmentStringsW** (KERNEL32.@)

## SYNOPSIS

DWORD ExpandEnvironmentStringsW\
  (\
   LPCWSTR *src*,\
   LPWSTR  *dst*,\
   DWORD   *len*\
  )

## DESCRIPTION

Replaces references to environment variables of the form '%EnvVar%' by their value. If the environment variable does not exist, then the reference is left as is.

## PARAMS

*src* **\[In\]**  The string to be expanded.

*dst* **\[Out\]**  The buffer in which to put the expanded string.

*len* **\[In\]**  The buffer size, in characters.

## RETURNS

The number of characters copied into the buffer. If the buffer is too small, then the required buffer size, in characters including the trailing **' '**, is returned. If the function fails for some other reason, then it returns **0.**

## IMPLEMENTATION

Declared in **"winbase.h"**.

Implemented in **"dlls/kernel32/environ.c"**.

Debug channel **"environ"**.
