FreeRDP
environment.c File Reference
#include <winpr/config.h>
#include <winpr/crt.h>
#include <winpr/platform.h>
#include <winpr/error.h>
#include <winpr/string.h>
#include <winpr/environment.h>

Functions

DWORD GetCurrentDirectoryA (DWORD nBufferLength, LPSTR lpBuffer)
 
DWORD GetCurrentDirectoryW (DWORD nBufferLength, LPWSTR lpBuffer)
 
BOOL SetCurrentDirectoryA (LPCSTR lpPathName)
 
BOOL SetCurrentDirectoryW (LPCWSTR lpPathName)
 
DWORD SearchPathA (LPCSTR lpPath, LPCSTR lpFileName, LPCSTR lpExtension, DWORD nBufferLength, LPSTR lpBuffer, LPSTR *lpFilePart)
 
DWORD SearchPathW (LPCWSTR lpPath, LPCWSTR lpFileName, LPCWSTR lpExtension, DWORD nBufferLength, LPWSTR lpBuffer, LPWSTR *lpFilePart)
 
LPSTR GetCommandLineA (VOID)
 
LPWSTR GetCommandLineW (VOID)
 
BOOL NeedCurrentDirectoryForExePathA (LPCSTR ExeName)
 
BOOL NeedCurrentDirectoryForExePathW (LPCWSTR ExeName)
 
DWORD GetEnvironmentVariableA (LPCSTR lpName, LPSTR lpBuffer, DWORD nSize)
 
DWORD GetEnvironmentVariableW (LPCWSTR lpName, LPWSTR lpBuffer, DWORD nSize)
 
BOOL SetEnvironmentVariableA (LPCSTR lpName, LPCSTR lpValue)
 
BOOL SetEnvironmentVariableW (LPCWSTR lpName, LPCWSTR lpValue)
 
LPCH GetEnvironmentStringsA (VOID)
 
LPWCH GetEnvironmentStringsW (VOID)
 
BOOL SetEnvironmentStringsA (LPCH NewEnvironment)
 
BOOL SetEnvironmentStringsW (LPWCH NewEnvironment)
 
DWORD ExpandEnvironmentStringsA (LPCSTR lpSrc, LPSTR lpDst, DWORD nSize)
 
DWORD ExpandEnvironmentStringsW (LPCWSTR lpSrc, LPWSTR lpDst, DWORD nSize)
 
BOOL FreeEnvironmentStringsA (LPCH lpszEnvironmentBlock)
 
BOOL FreeEnvironmentStringsW (LPWCH lpszEnvironmentBlock)
 
LPCH MergeEnvironmentStrings (PCSTR original, PCSTR merge)
 
DWORD GetEnvironmentVariableEBA (LPCSTR envBlock, LPCSTR lpName, LPSTR lpBuffer, DWORD nSize)
 
BOOL SetEnvironmentVariableEBA (LPSTR *envBlock, LPCSTR lpName, LPCSTR lpValue)
 
char ** EnvironmentBlockToEnvpA (LPCH lpszEnvironmentBlock)
 
DWORD GetEnvironmentVariableX (const char *lpName, char *lpBuffer, DWORD nSize)
 

Variables

char ** environ
 

Function Documentation

◆ EnvironmentBlockToEnvpA()

char** EnvironmentBlockToEnvpA ( LPCH  lpszEnvironmentBlock)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExpandEnvironmentStringsA()

DWORD ExpandEnvironmentStringsA ( LPCSTR  lpSrc,
LPSTR  lpDst,
DWORD  nSize 
)

◆ ExpandEnvironmentStringsW()

DWORD ExpandEnvironmentStringsW ( LPCWSTR  lpSrc,
LPWSTR  lpDst,
DWORD  nSize 
)

◆ FreeEnvironmentStringsA()

BOOL FreeEnvironmentStringsA ( LPCH  lpszEnvironmentBlock)

A brief history of the GetEnvironmentStrings functions: http://blogs.msdn.com/b/oldnewthing/archive/2013/01/17/10385718.aspx

◆ FreeEnvironmentStringsW()

BOOL FreeEnvironmentStringsW ( LPWCH  lpszEnvironmentBlock)

◆ GetCommandLineA()

LPSTR GetCommandLineA ( VOID  )

◆ GetCommandLineW()

LPWSTR GetCommandLineW ( VOID  )
Here is the caller graph for this function:

◆ GetCurrentDirectoryA()

DWORD GetCurrentDirectoryA ( DWORD  nBufferLength,
LPSTR  lpBuffer 
)

WinPR: Windows Portable Runtime Process Environment Functions

Copyright 2012 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2013 Thincast Technologies GmbH Copyright 2013 DI (FH) Martin Haimberger marti.nosp@m.n.ha.nosp@m.imber.nosp@m.ger@.nosp@m.thinc.nosp@m.ast..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Here is the call graph for this function:

◆ GetCurrentDirectoryW()

DWORD GetCurrentDirectoryW ( DWORD  nBufferLength,
LPWSTR  lpBuffer 
)

◆ GetEnvironmentStringsA()

LPCH GetEnvironmentStringsA ( VOID  )

◆ GetEnvironmentStringsW()

LPWCH GetEnvironmentStringsW ( VOID  )

◆ GetEnvironmentVariableA()

DWORD GetEnvironmentVariableA ( LPCSTR  lpName,
LPSTR  lpBuffer,
DWORD  nSize 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetEnvironmentVariableEBA()

DWORD GetEnvironmentVariableEBA ( LPCSTR  envBlock,
LPCSTR  lpName,
LPSTR  lpBuffer,
DWORD  nSize 
)
Here is the caller graph for this function:

◆ GetEnvironmentVariableW()

DWORD GetEnvironmentVariableW ( LPCWSTR  lpName,
LPWSTR  lpBuffer,
DWORD  nSize 
)
Here is the call graph for this function:

◆ GetEnvironmentVariableX()

DWORD GetEnvironmentVariableX ( const char *  lpName,
char *  lpBuffer,
DWORD  nSize 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MergeEnvironmentStrings()

LPCH MergeEnvironmentStrings ( PCSTR  original,
PCSTR  merge 
)
Here is the caller graph for this function:

◆ NeedCurrentDirectoryForExePathA()

BOOL NeedCurrentDirectoryForExePathA ( LPCSTR  ExeName)

◆ NeedCurrentDirectoryForExePathW()

BOOL NeedCurrentDirectoryForExePathW ( LPCWSTR  ExeName)

◆ SearchPathA()

DWORD SearchPathA ( LPCSTR  lpPath,
LPCSTR  lpFileName,
LPCSTR  lpExtension,
DWORD  nBufferLength,
LPSTR  lpBuffer,
LPSTR *  lpFilePart 
)

◆ SearchPathW()

DWORD SearchPathW ( LPCWSTR  lpPath,
LPCWSTR  lpFileName,
LPCWSTR  lpExtension,
DWORD  nBufferLength,
LPWSTR  lpBuffer,
LPWSTR *  lpFilePart 
)

◆ SetCurrentDirectoryA()

BOOL SetCurrentDirectoryA ( LPCSTR  lpPathName)

◆ SetCurrentDirectoryW()

BOOL SetCurrentDirectoryW ( LPCWSTR  lpPathName)

◆ SetEnvironmentStringsA()

BOOL SetEnvironmentStringsA ( LPCH  NewEnvironment)

◆ SetEnvironmentStringsW()

BOOL SetEnvironmentStringsW ( LPWCH  NewEnvironment)

◆ SetEnvironmentVariableA()

BOOL SetEnvironmentVariableA ( LPCSTR  lpName,
LPCSTR  lpValue 
)
Here is the caller graph for this function:

◆ SetEnvironmentVariableEBA()

BOOL SetEnvironmentVariableEBA ( LPSTR *  envBlock,
LPCSTR  lpName,
LPCSTR  lpValue 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetEnvironmentVariableW()

BOOL SetEnvironmentVariableW ( LPCWSTR  lpName,
LPCWSTR  lpValue 
)

Variable Documentation

◆ environ

char** environ
extern

GetEnvironmentStrings function: http://msdn.microsoft.com/en-us/library/windows/desktop/ms683187/

The GetEnvironmentStrings function returns a pointer to a block of memory that contains the environment variables of the calling process (both the system and the user environment variables). Each environment block contains the environment variables in the following format:

Var1=Value1\0 Var2=Value2\0 Var3=Value3\0 ... VarN=ValueN\0\0