secureswitools/swianalysistoolkit/source/chainvalidityandinstallfilestatustools/common/launchprocess.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 /**
       
    20  @file 
       
    21  @internalComponent 
       
    22 */
       
    23 
       
    24 #ifndef LAUNCHPROCESS_H
       
    25 #define LAUNCHPROCESS_H
       
    26 
       
    27 #define  BUFSIZE 2048
       
    28 #include <iostream>
       
    29 #include <windows.h>
       
    30 #include <string>
       
    31 #include <fstream>
       
    32 
       
    33 const std::string SignSISChainDirectoryName = "Chain";
       
    34 /**
       
    35  * The LaunchProcess provides methods which executes the supporting executables SignSIS.exe and DumpSWICertstoreTool.exe
       
    36  * @internalComponent 
       
    37  */
       
    38 
       
    39 class LaunchProcess
       
    40 {
       
    41 public:
       
    42 
       
    43 	LaunchProcess();
       
    44 
       
    45 	~LaunchProcess();
       
    46 
       
    47 	/** This function takes the command line input in order to execute the supporting executables
       
    48 	   SignSIS.exe and DumpSWICertstoreTool.exe.
       
    49 	   @param	aParameters		Command line input of the Supporting Executable.
       
    50 	   @param	aProcID			Supporting executable index.
       
    51 	  */
       
    52 	std::string ExecuteProcess(std::string aParameters, int aProcID) ;
       
    53 
       
    54 public:
       
    55 
       
    56 	HANDLE PrHandle[2];
       
    57 	PROCESS_INFORMATION piProcessInfo;
       
    58 	DWORD GetSignSISExitCode() const { return iSignSISExitCode ;}
       
    59 	DWORD GetDumpSwiCertstoreExitCode() const { return iDumpSwiCertstoreExitCode ;}
       
    60 
       
    61 #ifdef DUMPINSTALLFILESTATUSTOOL
       
    62 	DWORD GetDumpSISExitCode() const{ return iDumpSISExitCode ;}
       
    63 #endif
       
    64 
       
    65 private:
       
    66 
       
    67 	/** Displys the reason for exit of DumpSWICertstoreTool.exe.
       
    68 	   @param	aExitCode	Exitcode of DumpSWICertstoreTool.exe.
       
    69 	  */
       
    70 	void DisplayError(const DWORD& aExitCode);
       
    71 
       
    72 private:
       
    73 
       
    74 	DWORD iSignSISExitCode;
       
    75 	DWORD iDumpSwiCertstoreExitCode;
       
    76 
       
    77 #ifdef DUMPINSTALLFILESTATUSTOOL
       
    78 	DWORD iDumpSISExitCode;
       
    79 #endif
       
    80 };
       
    81 
       
    82 #endif//LAUNCHPROCESS_H