elevate_binariesanddocs.zip
Elevate.dll
Elevate.exe
elevate_demo.zip
Elevate.dll
Elevate.exe
TestChild.exe
TestParent.exe
elevate_src.zip
|
#include "CoreLib.h"
//#include <vld.h>
int main(int argc, char **argv, char **envp)
{
GxApp.Init(argc, argv, envp);
BString TempData;
Process TempProcess;
Process::ProcessData TempProcessData;
TempData = System::AppDirectory("") + "TestChild.exe";
if (!TempProcessData.Extract(TempData))
{
printf("Error extracting information.\n");
return 1;
}
// Run the TestChild process with forced elevation,
// waiting for it to complete,
// attached to this console,
// and pipe stderr to internal buffers.
if (!TempProcess.StartProcess(TempProcessData.Command, TempProcessData.Argv, TempProcessData.Envp, TempProcessData.Directory, BString(), Process::Foreground, Process::Standard, Process::Piped, Process::NoDetachProcess, Process::ForceElevate))
{
printf("Error running process.\n");
return 1;
}
// Data should have come across the named pipe for stderr.
printf("Data from TestChild.exe: \"%s\"", *TempProcess.ReadStderr());
return 0;
}
|
By viewing downloads associated with this article you agree to the Terms of use and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Been writing software for a really long time - something like 18 years. Started on the TI/99-4A, moved to the Tandy 1000, and somehow managed to skip all the lousy hardware/software jumps (286, 386, first Pentiums, Win95, etc.)
I now run a small software business called CubicleSoft with a few products you might be interested in. VerifyMyPC and MyUpdate Toolkit are the most popular. I'm also the author of a book called "Safe C++ Design Principles".