Export (0) Print
Expand All
Expand Minimize

FreeEnvironmentStrings function

Frees a block of environment strings.

Syntax


BOOL WINAPI FreeEnvironmentStrings(
  _In_  LPTCH lpszEnvironmentBlock
);

Parameters

lpszEnvironmentBlock [in]

A pointer to a block of environment strings. The pointer to the block must be obtained by calling the GetEnvironmentStrings function.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero To get extended error information, call GetLastError.

Remarks

If you used the ANSI version of GetEnvironmentStrings, be sure to use the ANSI version of FreeEnvironmentStrings. Similarly, if you used the Unicode version of GetEnvironmentStrings, be sure to use the Unicode version of FreeEnvironmentStrings.

Examples

For an example, see Changing Environment Variables.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

WinBase.h on Windows XP, Windows Server 2003, Windows Vista, Windows 7, Windows Server 2008, and Windows Server 2008 R2 (include Windows.h);
Processenv.h on Windows 8 and Windows Server 2012

Library

Kernel32.lib

DLL

Kernel32.dll

Unicode and ANSI names

FreeEnvironmentStringsW (Unicode) and FreeEnvironmentStringsA (ANSI)

See also

Environment Variables
GetEnvironmentStrings

 

 

Community Additions

ADD
Show:
© 2014 Microsoft