|
Packit Service |
fa4841 |
/**
|
|
Packit Service |
fa4841 |
* WinPR: Windows Portable Runtime
|
|
Packit Service |
fa4841 |
* Process Environment Functions
|
|
Packit Service |
fa4841 |
*
|
|
Packit Service |
fa4841 |
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
Packit Service |
fa4841 |
* Copyright 2013 Thincast Technologies GmbH
|
|
Packit Service |
fa4841 |
* Copyright 2013 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
|
|
Packit Service |
fa4841 |
*
|
|
Packit Service |
fa4841 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
Packit Service |
fa4841 |
* you may not use this file except in compliance with the License.
|
|
Packit Service |
fa4841 |
* You may obtain a copy of the License at
|
|
Packit Service |
fa4841 |
*
|
|
Packit Service |
fa4841 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
Packit Service |
fa4841 |
*
|
|
Packit Service |
fa4841 |
* Unless required by applicable law or agreed to in writing, software
|
|
Packit Service |
fa4841 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
Packit Service |
fa4841 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
Packit Service |
fa4841 |
* See the License for the specific language governing permissions and
|
|
Packit Service |
fa4841 |
* limitations under the License.
|
|
Packit Service |
fa4841 |
*/
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifndef WINPR_ENVIRONMENT_H
|
|
Packit Service |
fa4841 |
#define WINPR_ENVIRONMENT_H
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#include <winpr/winpr.h>
|
|
Packit Service |
fa4841 |
#include <winpr/wtypes.h>
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifndef _WIN32
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifdef __cplusplus
|
|
Packit Service |
b1ea74 |
extern "C"
|
|
Packit Service |
b1ea74 |
{
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
WINPR_API DWORD GetCurrentDirectoryA(DWORD nBufferLength, LPSTR lpBuffer);
|
|
Packit Service |
b1ea74 |
WINPR_API DWORD GetCurrentDirectoryW(DWORD nBufferLength, LPWSTR lpBuffer);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
WINPR_API BOOL SetCurrentDirectoryA(LPCSTR lpPathName);
|
|
Packit Service |
b1ea74 |
WINPR_API BOOL SetCurrentDirectoryW(LPCWSTR lpPathName);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
WINPR_API DWORD SearchPathA(LPCSTR lpPath, LPCSTR lpFileName, LPCSTR lpExtension,
|
|
Packit Service |
b1ea74 |
DWORD nBufferLength, LPSTR lpBuffer, LPSTR* lpFilePart);
|
|
Packit Service |
b1ea74 |
WINPR_API DWORD SearchPathW(LPCWSTR lpPath, LPCWSTR lpFileName, LPCWSTR lpExtension,
|
|
Packit Service |
b1ea74 |
DWORD nBufferLength, LPWSTR lpBuffer, LPWSTR* lpFilePart);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
WINPR_API LPSTR GetCommandLineA(VOID);
|
|
Packit Service |
b1ea74 |
WINPR_API LPWSTR GetCommandLineW(VOID);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
WINPR_API BOOL NeedCurrentDirectoryForExePathA(LPCSTR ExeName);
|
|
Packit Service |
b1ea74 |
WINPR_API BOOL NeedCurrentDirectoryForExePathW(LPCWSTR ExeName);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifdef __cplusplus
|
|
Packit Service |
fa4841 |
}
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifdef UNICODE
|
|
Packit Service |
b1ea74 |
#define GetCurrentDirectory GetCurrentDirectoryW
|
|
Packit Service |
b1ea74 |
#define SetCurrentDirectory SetCurrentDirectoryW
|
|
Packit Service |
b1ea74 |
#define SearchPath SearchPathW
|
|
Packit Service |
b1ea74 |
#define GetCommandLine GetCommandLineW
|
|
Packit Service |
b1ea74 |
#define NeedCurrentDirectoryForExePath NeedCurrentDirectoryForExePathW
|
|
Packit Service |
fa4841 |
#else
|
|
Packit Service |
b1ea74 |
#define GetCurrentDirectory GetCurrentDirectoryA
|
|
Packit Service |
b1ea74 |
#define SetCurrentDirectory SetCurrentDirectoryA
|
|
Packit Service |
b1ea74 |
#define SearchPath SearchPathA
|
|
Packit Service |
b1ea74 |
#define GetCommandLine GetCommandLineA
|
|
Packit Service |
b1ea74 |
#define NeedCurrentDirectoryForExePath NeedCurrentDirectoryForExePathA
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#if !defined(_WIN32) || defined(_UWP)
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifdef __cplusplus
|
|
Packit Service |
b1ea74 |
extern "C"
|
|
Packit Service |
b1ea74 |
{
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
WINPR_API DWORD GetEnvironmentVariableA(LPCSTR lpName, LPSTR lpBuffer, DWORD nSize);
|
|
Packit Service |
b1ea74 |
WINPR_API DWORD GetEnvironmentVariableW(LPCWSTR lpName, LPWSTR lpBuffer, DWORD nSize);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
WINPR_API BOOL SetEnvironmentVariableA(LPCSTR lpName, LPCSTR lpValue);
|
|
Packit Service |
b1ea74 |
WINPR_API BOOL SetEnvironmentVariableW(LPCWSTR lpName, LPCWSTR lpValue);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
/**
|
|
Packit Service |
b1ea74 |
* A brief history of the GetEnvironmentStrings functions:
|
|
Packit Service |
b1ea74 |
* http://blogs.msdn.com/b/oldnewthing/archive/2013/01/17/10385718.aspx
|
|
Packit Service |
b1ea74 |
*/
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
WINPR_API LPCH GetEnvironmentStrings(VOID);
|
|
Packit Service |
b1ea74 |
WINPR_API LPWCH GetEnvironmentStringsW(VOID);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
WINPR_API BOOL SetEnvironmentStringsA(LPCH NewEnvironment);
|
|
Packit Service |
b1ea74 |
WINPR_API BOOL SetEnvironmentStringsW(LPWCH NewEnvironment);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
WINPR_API DWORD ExpandEnvironmentStringsA(LPCSTR lpSrc, LPSTR lpDst, DWORD nSize);
|
|
Packit Service |
b1ea74 |
WINPR_API DWORD ExpandEnvironmentStringsW(LPCWSTR lpSrc, LPWSTR lpDst, DWORD nSize);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
WINPR_API BOOL FreeEnvironmentStringsA(LPCH lpszEnvironmentBlock);
|
|
Packit Service |
b1ea74 |
WINPR_API BOOL FreeEnvironmentStringsW(LPWCH lpszEnvironmentBlock);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifdef __cplusplus
|
|
Packit Service |
fa4841 |
}
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifdef UNICODE
|
|
Packit Service |
b1ea74 |
#define GetEnvironmentVariable GetEnvironmentVariableW
|
|
Packit Service |
b1ea74 |
#define SetEnvironmentVariable SetEnvironmentVariableW
|
|
Packit Service |
b1ea74 |
#define GetEnvironmentStrings GetEnvironmentStringsW
|
|
Packit Service |
b1ea74 |
#define SetEnvironmentStrings SetEnvironmentStringsW
|
|
Packit Service |
b1ea74 |
#define ExpandEnvironmentStrings ExpandEnvironmentStringsW
|
|
Packit Service |
b1ea74 |
#define FreeEnvironmentStrings FreeEnvironmentStringsW
|
|
Packit Service |
fa4841 |
#else
|
|
Packit Service |
b1ea74 |
#define GetEnvironmentVariable GetEnvironmentVariableA
|
|
Packit Service |
b1ea74 |
#define SetEnvironmentVariable SetEnvironmentVariableA
|
|
Packit Service |
b1ea74 |
#define GetEnvironmentStringsA GetEnvironmentStrings
|
|
Packit Service |
b1ea74 |
#define SetEnvironmentStrings SetEnvironmentStringsA
|
|
Packit Service |
b1ea74 |
#define ExpandEnvironmentStrings ExpandEnvironmentStringsA
|
|
Packit Service |
b1ea74 |
#define FreeEnvironmentStrings FreeEnvironmentStringsA
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifdef __cplusplus
|
|
Packit Service |
b1ea74 |
extern "C"
|
|
Packit Service |
b1ea74 |
{
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
WINPR_API LPCH MergeEnvironmentStrings(PCSTR original, PCSTR merge);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
WINPR_API DWORD GetEnvironmentVariableEBA(LPCSTR envBlock, LPCSTR lpName, LPSTR lpBuffer,
|
|
Packit Service |
b1ea74 |
DWORD nSize);
|
|
Packit Service |
b1ea74 |
WINPR_API BOOL SetEnvironmentVariableEBA(LPSTR* envBlock, LPCSTR lpName, LPCSTR lpValue);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
WINPR_API char** EnvironmentBlockToEnvpA(LPCH lpszEnvironmentBlock);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifdef __cplusplus
|
|
Packit Service |
fa4841 |
}
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#endif /* WINPR_ENVIRONMENT_H */
|