Click to Rate and Give Feedback
MSDN
MSDN Library
System Services
 FreeEnvironmentStrings Function
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

Client Requires Windows Vista, Windows XP, or Windows 2000 Professional.
Server Requires Windows Server 2008, Windows Server 2003, or Windows 2000 Server.
Header

Declared in Winbase.h; include Windows.h.

Library

Use Kernel32.lib.

DLL

Requires Kernel32.dll.

Unicode/ANSI

Implemented as FreeEnvironmentStringsW (Unicode) and FreeEnvironmentStringsA (ANSI).

See Also

Environment Variables
GetEnvironmentStrings


Send comments about this topic to Microsoft

Build date: 8/7/2008

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker