You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.4 KiB
48 lines
1.4 KiB
/*
|
|
* Copyright 2002-2019 Intel Corporation.
|
|
*
|
|
* This software is provided to you as Sample Source Code as defined in the accompanying
|
|
* End User License Agreement for the Intel(R) Software Development Products ("Agreement")
|
|
* section 1.L.
|
|
*
|
|
* This software and the related documents are provided as is, with no express or implied
|
|
* warranties, other than those that are expressly stated in the License.
|
|
*/
|
|
|
|
//Child process application
|
|
#include <windows.h>
|
|
#include <stdio.h>
|
|
#include <iostream>
|
|
using std::string;
|
|
using std::cout;
|
|
using std::endl;
|
|
|
|
int main(int argc, char * argv[])
|
|
{
|
|
CHAR * expectedArgv[3] = {{"win_child_process.exe"}, {"param1 param2"}, {"param3"}};
|
|
string currentArgv;
|
|
|
|
//Take into account that a path might be added to the executable name
|
|
currentArgv = argv[0];
|
|
string::size_type index = currentArgv.find(expectedArgv[0]);
|
|
if(index == string::npos)
|
|
{
|
|
//Got unexpected parameter
|
|
cout << "Got unexpected parameter: " << argv[0] << endl;
|
|
return (-1);
|
|
}
|
|
//All the rest should have exact match
|
|
for(int i = 1; i < argc; i++)
|
|
{
|
|
currentArgv = argv[i];
|
|
if(currentArgv.compare(expectedArgv[i]) != 0)
|
|
{
|
|
//Got unexpected parameter
|
|
cout << "Got unexpected parameter: " << argv[i] << endl;
|
|
return (-1);
|
|
}
|
|
}
|
|
cout << "win_child_process - the correct run!" << endl;
|
|
return 0;
|
|
}
|