Last active
December 9, 2019 09:59
-
-
Save ermshiperete/e6ef7b399702bfbf9e40e4cfebde75cc to your computer and use it in GitHub Desktop.
ConsoleApplication1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.vs/ | |
bin/ | |
obj/ | |
Debug/ | |
Release/ | |
*.user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <tchar.h> | |
#include <stdio.h> | |
#include <strsafe.h> | |
#define BUFSIZE 4096 | |
HANDLE g_hChildStd_IN_Rd = NULL; | |
HANDLE g_hChildStd_IN_Wr = NULL; | |
HANDLE g_hChildStd_OUT_Rd = NULL; | |
HANDLE g_hChildStd_OUT_Wr = NULL; | |
HANDLE g_hChildStd_ERR_Rd = NULL; | |
HANDLE g_hChildStd_ERR_Wr = NULL; | |
HANDLE g_hInputFile = NULL; | |
void CreateChildProcess(TCHAR* command, TCHAR* workdDir); | |
void CreateChildProcessA(CHAR* command, CHAR* workdDir); | |
void WriteToPipe(void); | |
void ReadFromPipe(void); | |
void ReadFromErrPipe(void); | |
void ErrorExit(PTSTR); | |
int _tmain(int argc, TCHAR* argv[]) | |
{ | |
SECURITY_ATTRIBUTES saAttr; | |
printf("\n->Start of parent execution.\n"); | |
// Set the bInheritHandle flag so pipe handles are inherited. | |
ZeroMemory(&saAttr, sizeof(SECURITY_ATTRIBUTES)); | |
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); | |
saAttr.bInheritHandle = TRUE; | |
saAttr.lpSecurityDescriptor = NULL; | |
// Create a pipe for the child process's STDOUT. | |
if (!CreatePipe(&g_hChildStd_OUT_Rd, &g_hChildStd_OUT_Wr, &saAttr, 0)) | |
ErrorExit(TEXT("StdoutRd CreatePipe")); | |
// Ensure the read handle to the pipe for STDOUT is not inherited. | |
if (!SetHandleInformation(g_hChildStd_OUT_Rd, HANDLE_FLAG_INHERIT, 0)) | |
ErrorExit(TEXT("Stdout SetHandleInformation")); | |
/* | |
// Create a pipe for the child process's STDERR. | |
if (!CreatePipe(&g_hChildStd_ERR_Rd, &g_hChildStd_ERR_Wr, &saAttr, 0)) | |
ErrorExit(TEXT("StdERRRd CreatePipe")); | |
// Ensure the read handle to the pipe for STDERR is not inherited. | |
if (!SetHandleInformation(g_hChildStd_ERR_Rd, HANDLE_FLAG_INHERIT, 0)) | |
ErrorExit(TEXT("StdERR SetHandleInformation")); | |
// Create a pipe for the child process's STDIN. | |
if (!CreatePipe(&g_hChildStd_IN_Rd, &g_hChildStd_IN_Wr, &saAttr, 0)) | |
ErrorExit(TEXT("Stdin CreatePipe")); | |
// Ensure the write handle to the pipe for STDIN is not inherited. | |
if (!SetHandleInformation(g_hChildStd_IN_Wr, HANDLE_FLAG_INHERIT, 0)) | |
ErrorExit(TEXT("Stdin SetHandleInformation")); | |
*/ | |
// Get a handle to an input file for the parent. | |
// This example assumes a plain text file and uses string output to verify data flow. | |
TCHAR* cmd; | |
TCHAR szTempFileName[MAX_PATH]; | |
TCHAR lpTempPathBuffer[MAX_PATH]; | |
//if (argc == 1) | |
{ | |
// ErrorExit(TEXT("Please specify an input file.\n")); | |
DWORD dwRetVal; | |
UINT uRetVal; | |
dwRetVal = GetTempPath(MAX_PATH, lpTempPathBuffer); | |
if (dwRetVal > MAX_PATH || (dwRetVal == 0)) | |
{ | |
ErrorExit(TEXT("Can't get temp path")); | |
} | |
_tcscpy_s(szTempFileName, lpTempPathBuffer); | |
_tcscat_s(szTempFileName, TEXT("testW.sh")); | |
HANDLE hFile = CreateFile((LPTSTR)szTempFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, | |
FILE_ATTRIBUTE_NORMAL, NULL); | |
if (hFile == INVALID_HANDLE_VALUE) | |
ErrorExit(TEXT("Creating of file failed")); | |
TCHAR* text = TEXT("#!/bin/bash\necho \"Hello World!\"\npwd\n/bin/ls -al\n"); | |
DWORD written; | |
WriteFile(hFile, text, _tcslen(text) * 2, &written, NULL); | |
printf("Wrote %d of %d characters to %ls\n", (int)written, _tcslen(text), szTempFileName); | |
CloseHandle(hFile); | |
cmd = szTempFileName; | |
TCHAR batchFile[MAX_PATH]; | |
_tcscpy_s(batchFile, lpTempPathBuffer); | |
_tcscat_s(batchFile, TEXT("testW.bat")); | |
hFile = CreateFile((LPTSTR)batchFile, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, | |
FILE_ATTRIBUTE_NORMAL, NULL); | |
if (hFile == INVALID_HANDLE_VALUE) | |
ErrorExit(TEXT("Creating of file failed")); | |
text = TEXT("echo \"Hello World!\"\n"); | |
WriteFile(hFile, text, _tcslen(text) * 2, &written, NULL); | |
printf("Wrote %d of %d characters to %ls\n", (int)written, _tcslen(text), batchFile); | |
CloseHandle(hFile); | |
_tcscpy_s(batchFile, lpTempPathBuffer); | |
_tcscat_s(batchFile, TEXT("testA.bat")); | |
hFile = CreateFile((LPTSTR)batchFile, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, | |
FILE_ATTRIBUTE_NORMAL, NULL); | |
if (hFile == INVALID_HANDLE_VALUE) | |
ErrorExit(TEXT("Creating of file failed")); | |
{ | |
CHAR textA[] = "echo \"Hello World!\"\n"; | |
WriteFile(hFile, textA, strlen(textA), &written, NULL); | |
printf("Wrote %d of %d characters to %ls\n", (int)written, strlen(textA), batchFile); | |
CloseHandle(hFile); | |
} | |
_tcscpy_s(batchFile, lpTempPathBuffer); | |
_tcscat_s(batchFile, TEXT("testA.sh")); | |
hFile = CreateFile((LPTSTR)batchFile, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, | |
FILE_ATTRIBUTE_NORMAL, NULL); | |
if (hFile == INVALID_HANDLE_VALUE) | |
ErrorExit(TEXT("Creating of file failed")); | |
{ | |
CHAR textA[] = "#!/bin/bash\necho \"Hello World!\"\npwd\n/bin/ls -al\n"; | |
WriteFile(hFile, textA, strlen(textA), &written, NULL); | |
printf("Wrote %d of %d characters to %ls\n", (int)written, strlen(textA), batchFile); | |
CloseHandle(hFile); | |
} | |
} | |
/* | |
else | |
{ | |
cmd = argv[1]; | |
} | |
*/ | |
// Create the child process. | |
TCHAR cmdString[MAX_PATH]; | |
CHAR cmdStringA[MAX_PATH]; | |
TCHAR* option = argc > 1 ? argv[1] : TEXT("1"); | |
printf("option=%ls\n", option); | |
if (_tcscmp(option, TEXT("1")) == 0) | |
{ | |
_tcscpy_s(cmdString, TEXT("/bin/cat testW.sh")); | |
printf("Executing %ls\n", cmdString); | |
CreateChildProcess(cmdString, lpTempPathBuffer); | |
} | |
else if (_tcscmp(option, TEXT("2")) == 0) | |
{ | |
_tcscpy_s(cmdString, lpTempPathBuffer); | |
_tcscat_s(cmdString, TEXT("testW.bat")); | |
printf("Executing %ls\n", cmdString); | |
CreateChildProcess(cmdString, lpTempPathBuffer); | |
} | |
else if (_tcscmp(option, TEXT("3")) == 0) | |
{ | |
/* | |
strcpy_s(cmdStringA, "/bin/cat testA.sh"); | |
printf("Executing %s\n", cmdStringA); | |
CreateChildProcessA(cmdStringA, lpTempPathBuffer); | |
*/ | |
_tcscpy_s(cmdString, TEXT("/bin/cat testA.sh")); | |
printf("Executing %ls\n", cmdString); | |
CreateChildProcess(cmdString, lpTempPathBuffer); | |
} | |
else if (_tcscmp(option, TEXT("4")) == 0) | |
{ | |
/* | |
strcpy_s(cmdStringA, TEXT("testA.bat")); | |
printf("Executing %s\n", cmdStringA); | |
CreateChildProcessA(cmdStringA, lpTempPathBuffer); | |
*/ | |
_tcscpy_s(cmdString, lpTempPathBuffer); | |
_tcscat_s(cmdString, TEXT("testA.bat")); | |
printf("Executing %ls\n", cmdString); | |
CreateChildProcess(cmdString, lpTempPathBuffer); | |
} | |
// _tcscpy_s(cmdString, TEXT("/bin/bash testW.sh")); | |
// _tcscpy_s(cmdString, TEXT("testW.bat")); | |
// _tcscpy_s(cmdString, TEXT("/bin/cat testW.sh")); | |
// _tcscpy_s(cmdString, TEXT("/bin/ls -al")); | |
// _tcscat_s(cmdString, cmd); | |
// _tcscat_s(cmdString, TEXT("\"")); | |
//printf("Executing %ls\n", cmdString); | |
//CreateChildProcess(cmdString, lpTempPathBuffer); | |
/* | |
g_hInputFile = CreateFile( | |
argv[1], | |
GENERIC_READ, | |
0, | |
NULL, | |
OPEN_EXISTING, | |
FILE_ATTRIBUTE_READONLY, | |
NULL); | |
if ( g_hInputFile == INVALID_HANDLE_VALUE ) | |
ErrorExit(TEXT("CreateFile")); | |
// Write to the pipe that is the standard input for a child process. | |
// Data is written to the pipe's buffers, so it is not necessary to wait | |
// until the child process is running before writing data. | |
WriteToPipe(); | |
printf( "\n->Contents of %s written to child STDIN pipe.\n", argv[1]); | |
*/ | |
// Read from pipe that is the standard output for child process. | |
CloseHandle(g_hChildStd_OUT_Wr); | |
printf("\n->Contents of child process STDOUT:\n\n"); | |
ReadFromPipe(); | |
// printf( "\n->Contents of child process STDERR:\n\n"); | |
// ReadFromErrPipe(); | |
printf("\n->End of parent execution.\n"); | |
// The remaining open handles are cleaned up when this process terminates. | |
// To avoid resource leaks in a larger application, close handles explicitly. | |
return 0; | |
} | |
void CreateChildProcess(TCHAR* command, TCHAR* workDir) | |
// Create a child process that uses the previously created pipes for STDIN and STDOUT. | |
{ | |
printf("Executing %ls in %ls\n", command, workDir); | |
PROCESS_INFORMATION piProcInfo; | |
STARTUPINFO siStartInfo; | |
BOOL bSuccess = FALSE; | |
// Set up members of the PROCESS_INFORMATION structure. | |
ZeroMemory(&piProcInfo, sizeof(PROCESS_INFORMATION)); | |
// Set up members of the STARTUPINFO structure. | |
// This structure specifies the STDIN and STDOUT handles for redirection. | |
ZeroMemory(&siStartInfo, sizeof(STARTUPINFO)); | |
siStartInfo.cb = sizeof(STARTUPINFO); | |
siStartInfo.hStdError = g_hChildStd_OUT_Wr; | |
siStartInfo.hStdOutput = g_hChildStd_OUT_Wr; | |
// siStartInfo.hStdInput = g_hChildStd_IN_Rd; | |
siStartInfo.dwFlags |= STARTF_USESTDHANDLES; | |
// Create the child process. | |
bSuccess = CreateProcess(NULL, | |
command, // command line | |
NULL, // process security attributes | |
NULL, // primary thread security attributes | |
TRUE, // handles are inherited | |
0, // creation flags | |
NULL, // use parent's environment | |
workDir, | |
&siStartInfo, // STARTUPINFO pointer | |
&piProcInfo); // receives PROCESS_INFORMATION | |
// If an error occurs, exit the application. | |
if (!bSuccess) | |
ErrorExit(TEXT("CreateProcess")); | |
else | |
{ | |
// Close handles to the child process and its primary thread. | |
// Some applications might keep these handles to monitor the status | |
// of the child process, for example. | |
printf("Started process %d, thread %d\n", piProcInfo.dwProcessId, piProcInfo.dwThreadId); | |
//WaitForSingleObject(piProcInfo.hProcess, INFINITE); | |
//DWORD exitCode = 0; | |
//GetExitCodeProcess(piProcInfo.hProcess, &exitCode); | |
//printf("process exited with %d\n", exitCode); | |
CloseHandle(piProcInfo.hProcess); | |
CloseHandle(piProcInfo.hThread); | |
} | |
} | |
void CreateChildProcessA(CHAR* command, CHAR* workDir) | |
// Create a child process that uses the previously created pipes for STDIN and STDOUT. | |
{ | |
PROCESS_INFORMATION piProcInfo; | |
STARTUPINFOA siStartInfo; | |
BOOL bSuccess = FALSE; | |
// Set up members of the PROCESS_INFORMATION structure. | |
ZeroMemory(&piProcInfo, sizeof(PROCESS_INFORMATION)); | |
// Set up members of the STARTUPINFO structure. | |
// This structure specifies the STDIN and STDOUT handles for redirection. | |
ZeroMemory(&siStartInfo, sizeof(STARTUPINFO)); | |
siStartInfo.cb = sizeof(STARTUPINFO); | |
siStartInfo.hStdError = g_hChildStd_OUT_Wr; | |
siStartInfo.hStdOutput = g_hChildStd_OUT_Wr; | |
// siStartInfo.hStdInput = g_hChildStd_IN_Rd; | |
siStartInfo.dwFlags |= STARTF_USESTDHANDLES; | |
// Create the child process. | |
bSuccess = CreateProcessA(NULL, | |
command, // command line | |
NULL, // process security attributes | |
NULL, // primary thread security attributes | |
TRUE, // handles are inherited | |
0, // creation flags | |
NULL, // use parent's environment | |
workDir, | |
&siStartInfo, // STARTUPINFO pointer | |
&piProcInfo); // receives PROCESS_INFORMATION | |
// If an error occurs, exit the application. | |
if (!bSuccess) | |
ErrorExit(TEXT("CreateProcess")); | |
else | |
{ | |
// Close handles to the child process and its primary thread. | |
// Some applications might keep these handles to monitor the status | |
// of the child process, for example. | |
printf("Started process %d, thread %d\n", piProcInfo.dwProcessId, piProcInfo.dwThreadId); | |
//WaitForSingleObject(piProcInfo.hProcess, INFINITE); | |
//DWORD exitCode = 0; | |
//GetExitCodeProcess(piProcInfo.hProcess, &exitCode); | |
//printf("process exited with %d\n", exitCode); | |
CloseHandle(piProcInfo.hProcess); | |
CloseHandle(piProcInfo.hThread); | |
} | |
} | |
void WriteToPipe(void) | |
// Read from a file and write its contents to the pipe for the child's STDIN. | |
// Stop when there is no more data. | |
{ | |
DWORD dwRead, dwWritten; | |
CHAR chBuf[BUFSIZE]; | |
BOOL bSuccess = FALSE; | |
for (;;) | |
{ | |
bSuccess = ReadFile(g_hInputFile, chBuf, BUFSIZE, &dwRead, NULL); | |
if (!bSuccess || dwRead == 0) break; | |
bSuccess = WriteFile(g_hChildStd_IN_Wr, chBuf, dwRead, &dwWritten, NULL); | |
if (!bSuccess) break; | |
} | |
// Close the pipe handle so the child process stops reading. | |
if (!CloseHandle(g_hChildStd_IN_Wr)) | |
ErrorExit(TEXT("StdInWr CloseHandle")); | |
} | |
void ReadFromPipe(void) | |
// Read output from the child process's pipe for STDOUT | |
// and write to the parent process's pipe for STDOUT. | |
// Stop when there is no more data. | |
{ | |
DWORD dwRead, dwWritten; | |
CHAR chBuf[BUFSIZE]; | |
BOOL bSuccess = FALSE; | |
HANDLE hParentStdOut = GetStdHandle(STD_OUTPUT_HANDLE); | |
for (;;) | |
{ | |
printf("Reading stdout:\n"); | |
bSuccess = ReadFile(g_hChildStd_OUT_Rd, chBuf, BUFSIZE, &dwRead, NULL); | |
chBuf[dwRead] = 0; | |
printf("read %d: >>%s<<\n", dwRead, chBuf); | |
if (!bSuccess || dwRead == 0) break; | |
bSuccess = WriteFile(hParentStdOut, chBuf, | |
dwRead, &dwWritten, NULL); | |
if (!bSuccess) break; | |
} | |
} | |
void ReadFromErrPipe(void) | |
// Read output from the child process's pipe for STDERR | |
// and write to the parent process's pipe for STDERR. | |
// Stop when there is no more data. | |
{ | |
DWORD dwRead, dwWritten; | |
CHAR chBuf[BUFSIZE]; | |
BOOL bSuccess = FALSE; | |
HANDLE hParentStdErr = GetStdHandle(STD_ERROR_HANDLE); | |
for (;;) | |
{ | |
bSuccess = ReadFile(g_hChildStd_ERR_Rd, chBuf, BUFSIZE, &dwRead, NULL); | |
if (!bSuccess || dwRead == 0) break; | |
bSuccess = WriteFile(hParentStdErr, chBuf, | |
dwRead, &dwWritten, NULL); | |
if (!bSuccess) break; | |
} | |
} | |
void ErrorExit(LPTSTR lpszFunction) | |
// Format a readable error message, display a message box, | |
// and exit from the application. | |
{ | |
LPVOID lpMsgBuf; | |
LPVOID lpDisplayBuf; | |
DWORD dw = GetLastError(); | |
FormatMessage( | |
FORMAT_MESSAGE_ALLOCATE_BUFFER | | |
FORMAT_MESSAGE_FROM_SYSTEM | | |
FORMAT_MESSAGE_IGNORE_INSERTS, | |
NULL, | |
dw, | |
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), | |
(LPTSTR)&lpMsgBuf, | |
0, NULL); | |
lpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZEROINIT, | |
(lstrlen((LPCTSTR)lpMsgBuf) + lstrlen((LPCTSTR)lpszFunction) + 40) * sizeof(TCHAR)); | |
StringCchPrintf((LPTSTR)lpDisplayBuf, | |
LocalSize(lpDisplayBuf) / sizeof(TCHAR), | |
TEXT("%s failed with error %d: %s"), | |
lpszFunction, dw, lpMsgBuf); | |
MessageBox(NULL, (LPCTSTR)lpDisplayBuf, TEXT("Error"), MB_OK); | |
LocalFree(lpMsgBuf); | |
LocalFree(lpDisplayBuf); | |
ExitProcess(1); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| |
Microsoft Visual Studio Solution File, Format Version 12.00 | |
# Visual Studio Version 16 | |
VisualStudioVersion = 16.0.29519.87 | |
MinimumVisualStudioVersion = 10.0.40219.1 | |
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConsoleApplication1", "ConsoleApplication1\ConsoleApplication1.vcxproj", "{9968AF04-729B-476D-A4C4-9B04DA3745EC}" | |
EndProject | |
Global | |
GlobalSection(SolutionConfigurationPlatforms) = preSolution | |
Debug|x64 = Debug|x64 | |
Debug|x86 = Debug|x86 | |
Release|x64 = Release|x64 | |
Release|x86 = Release|x86 | |
EndGlobalSection | |
GlobalSection(ProjectConfigurationPlatforms) = postSolution | |
{9968AF04-729B-476D-A4C4-9B04DA3745EC}.Debug|x64.ActiveCfg = Debug|x64 | |
{9968AF04-729B-476D-A4C4-9B04DA3745EC}.Debug|x64.Build.0 = Debug|x64 | |
{9968AF04-729B-476D-A4C4-9B04DA3745EC}.Debug|x86.ActiveCfg = Debug|Win32 | |
{9968AF04-729B-476D-A4C4-9B04DA3745EC}.Debug|x86.Build.0 = Debug|Win32 | |
{9968AF04-729B-476D-A4C4-9B04DA3745EC}.Release|x64.ActiveCfg = Release|x64 | |
{9968AF04-729B-476D-A4C4-9B04DA3745EC}.Release|x64.Build.0 = Release|x64 | |
{9968AF04-729B-476D-A4C4-9B04DA3745EC}.Release|x86.ActiveCfg = Release|Win32 | |
{9968AF04-729B-476D-A4C4-9B04DA3745EC}.Release|x86.Build.0 = Release|Win32 | |
EndGlobalSection | |
GlobalSection(SolutionProperties) = preSolution | |
HideSolutionNode = FALSE | |
EndGlobalSection | |
GlobalSection(ExtensibilityGlobals) = postSolution | |
SolutionGuid = {82983F17-16DE-43CB-A84B-34A53D25BE14} | |
EndGlobalSection | |
EndGlobal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<ItemGroup Label="ProjectConfigurations"> | |
<ProjectConfiguration Include="Debug|Win32"> | |
<Configuration>Debug</Configuration> | |
<Platform>Win32</Platform> | |
</ProjectConfiguration> | |
<ProjectConfiguration Include="Release|Win32"> | |
<Configuration>Release</Configuration> | |
<Platform>Win32</Platform> | |
</ProjectConfiguration> | |
<ProjectConfiguration Include="Debug|x64"> | |
<Configuration>Debug</Configuration> | |
<Platform>x64</Platform> | |
</ProjectConfiguration> | |
<ProjectConfiguration Include="Release|x64"> | |
<Configuration>Release</Configuration> | |
<Platform>x64</Platform> | |
</ProjectConfiguration> | |
</ItemGroup> | |
<PropertyGroup Label="Globals"> | |
<VCProjectVersion>16.0</VCProjectVersion> | |
<ProjectGuid>{9968AF04-729B-476D-A4C4-9B04DA3745EC}</ProjectGuid> | |
<Keyword>Win32Proj</Keyword> | |
<RootNamespace>ConsoleApplication1</RootNamespace> | |
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> | |
</PropertyGroup> | |
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | |
<ConfigurationType>Application</ConfigurationType> | |
<UseDebugLibraries>true</UseDebugLibraries> | |
<PlatformToolset>v142</PlatformToolset> | |
<CharacterSet>Unicode</CharacterSet> | |
</PropertyGroup> | |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | |
<ConfigurationType>Application</ConfigurationType> | |
<UseDebugLibraries>false</UseDebugLibraries> | |
<PlatformToolset>v142</PlatformToolset> | |
<WholeProgramOptimization>true</WholeProgramOptimization> | |
<CharacterSet>Unicode</CharacterSet> | |
</PropertyGroup> | |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | |
<ConfigurationType>Application</ConfigurationType> | |
<UseDebugLibraries>true</UseDebugLibraries> | |
<PlatformToolset>v142</PlatformToolset> | |
<CharacterSet>Unicode</CharacterSet> | |
</PropertyGroup> | |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | |
<ConfigurationType>Application</ConfigurationType> | |
<UseDebugLibraries>false</UseDebugLibraries> | |
<PlatformToolset>v142</PlatformToolset> | |
<WholeProgramOptimization>true</WholeProgramOptimization> | |
<CharacterSet>Unicode</CharacterSet> | |
</PropertyGroup> | |
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | |
<ImportGroup Label="ExtensionSettings"> | |
</ImportGroup> | |
<ImportGroup Label="Shared"> | |
</ImportGroup> | |
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | |
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | |
</ImportGroup> | |
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | |
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | |
</ImportGroup> | |
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | |
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | |
</ImportGroup> | |
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | |
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | |
</ImportGroup> | |
<PropertyGroup Label="UserMacros" /> | |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | |
<LinkIncremental>true</LinkIncremental> | |
</PropertyGroup> | |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | |
<LinkIncremental>true</LinkIncremental> | |
</PropertyGroup> | |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | |
<LinkIncremental>false</LinkIncremental> | |
</PropertyGroup> | |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | |
<LinkIncremental>false</LinkIncremental> | |
</PropertyGroup> | |
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | |
<ClCompile> | |
<PrecompiledHeader> | |
</PrecompiledHeader> | |
<WarningLevel>Level3</WarningLevel> | |
<Optimization>Disabled</Optimization> | |
<SDLCheck>true</SDLCheck> | |
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> | |
</ClCompile> | |
<Link> | |
<SubSystem>Console</SubSystem> | |
<GenerateDebugInformation>true</GenerateDebugInformation> | |
</Link> | |
</ItemDefinitionGroup> | |
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | |
<ClCompile> | |
<PrecompiledHeader> | |
</PrecompiledHeader> | |
<WarningLevel>Level3</WarningLevel> | |
<Optimization>Disabled</Optimization> | |
<SDLCheck>true</SDLCheck> | |
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
<ConformanceMode>true</ConformanceMode> | |
</ClCompile> | |
<Link> | |
<SubSystem>Console</SubSystem> | |
<GenerateDebugInformation>true</GenerateDebugInformation> | |
</Link> | |
</ItemDefinitionGroup> | |
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | |
<ClCompile> | |
<PrecompiledHeader> | |
</PrecompiledHeader> | |
<WarningLevel>Level3</WarningLevel> | |
<Optimization>MaxSpeed</Optimization> | |
<FunctionLevelLinking>true</FunctionLevelLinking> | |
<IntrinsicFunctions>true</IntrinsicFunctions> | |
<SDLCheck>true</SDLCheck> | |
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
<ConformanceMode>true</ConformanceMode> | |
</ClCompile> | |
<Link> | |
<SubSystem>Console</SubSystem> | |
<EnableCOMDATFolding>true</EnableCOMDATFolding> | |
<OptimizeReferences>true</OptimizeReferences> | |
<GenerateDebugInformation>true</GenerateDebugInformation> | |
</Link> | |
</ItemDefinitionGroup> | |
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | |
<ClCompile> | |
<PrecompiledHeader> | |
</PrecompiledHeader> | |
<WarningLevel>Level3</WarningLevel> | |
<Optimization>MaxSpeed</Optimization> | |
<FunctionLevelLinking>true</FunctionLevelLinking> | |
<IntrinsicFunctions>true</IntrinsicFunctions> | |
<SDLCheck>true</SDLCheck> | |
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
<ConformanceMode>true</ConformanceMode> | |
</ClCompile> | |
<Link> | |
<SubSystem>Console</SubSystem> | |
<EnableCOMDATFolding>true</EnableCOMDATFolding> | |
<OptimizeReferences>true</OptimizeReferences> | |
<GenerateDebugInformation>true</GenerateDebugInformation> | |
</Link> | |
</ItemDefinitionGroup> | |
<ItemGroup> | |
<ClCompile Include="ConsoleApplication1.cpp" /> | |
</ItemGroup> | |
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | |
<ImportGroup Label="ExtensionTargets"> | |
</ImportGroup> | |
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<ItemGroup> | |
<Filter Include="Source Files"> | |
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> | |
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> | |
</Filter> | |
<Filter Include="Header Files"> | |
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> | |
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions> | |
</Filter> | |
<Filter Include="Resource Files"> | |
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> | |
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> | |
</Filter> | |
</ItemGroup> | |
<ItemGroup> | |
<ClCompile Include="ConsoleApplication1.cpp"> | |
<Filter>Source Files</Filter> | |
</ClCompile> | |
</ItemGroup> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment