Exemplo n.º 1
0
void ProcessUnitTests::testOpenCloseByName()
{
    Process p;
    p.Open(L"explorer.exe", PROCESS_QUERY_INFORMATION, FALSE);
    CPPUNIT_ASSERT(p.IsOpen());
    p.Close();
    CPPUNIT_ASSERT(! p.IsOpen());
}
Exemplo n.º 2
0
void ProcessUnitTests::testOpenClose()
{
    Process p;
    p.Open(::GetCurrentProcessId(), PROCESS_ALL_ACCESS);
    CPPUNIT_ASSERT(p.IsOpen());
    p.Close();
    CPPUNIT_ASSERT(! p.IsOpen());
    p.Open(::GetCurrentProcessId(), PROCESS_QUERY_INFORMATION);
    CPPUNIT_ASSERT(p.IsOpen());
}