2025-04-27 07:49:33 -04:00

209 lines
5.2 KiB
Plaintext

//////////////////////////////////////////////////////////////////////////////
// Index.mof contains:
// RSink Event Generator definitions for ESSTest
// Tests restricted sinks
//
// Event and provider definitions for:
// MSFT_EssTestRSinkBaseEvent
// MSFT_EssTestRSinkEvent1
// MSFT_EssTestRSinkEvent2
// MSFT_EssTestRSinkEvent3
// MSFT_EssTestRSinkEvent4
// MSFT_EssTestRSinkEvent5
#pragma namespace("\\\\.\\root\\cimv2")
//////////////////////////////////////////////////////////////////////////////
// MSFT_EssTestIndexEvent (single DWORD event)
class MSFT_EssTestRSinkBaseEvent : __ExtrinsicEvent
{
uint32 Index;
};
class MSFT_EssTestRSinkEvent1 : MSFT_EssTestRSinkBaseEvent
{
uint32 Index;
};
class MSFT_EssTestRSinkEvent2 : MSFT_EssTestRSinkBaseEvent
{
uint32 Index;
};
class MSFT_EssTestRSinkEvent3 : MSFT_EssTestRSinkBaseEvent
{
uint32 Index;
};
class MSFT_EssTestRSinkEvent4 : MSFT_EssTestRSinkBaseEvent
{
uint32 Index;
};
class MSFT_EssTestRSinkEvent5 : MSFT_EssTestRSinkBaseEvent
{
uint32 Index;
};
// Fires MSFT_EssTestRSinkEvent1-MSFT_EssTestRSinkEvent5
instance of MSFT_EssEventGenerator as $Gen1
{
Name = "RSink Event Generator";
CommandLine =
"mofprov \"/Nroot\\cimv2\" \"/PDecoupled RSink Event Generator\" "
"\"/F%ResultsFile%\" /B64000 /L1000 /R";
Script =
"PrintMOF();\n"
"\n"
"function PrintMOF()\n"
"{\n"
" var args = WScript.Arguments;\n"
"\n"
" for (Index = 0; Index < args(0); Index++)\n"
" {\n"
" var Class,\n"
" type = (Index % 5) + 1;\n"
"\n"
" Class = \"MSFT_EssTestRSinkEvent\" + type;\n"
"\n"
" if (%ScriptRule%)\n"
" {\n"
" var strOut =\n"
" \"instance of \" + Class + \" \" +\n"
" \"{\" +\n"
" \" Index = \" + Index + \";\" +\n"
" \"};\"\n"
" \n"
" WScript.Echo(strOut);\n"
" }\n"
" }\n"
"};\n";
};
instance of MSFT_EssTestWorkItem
{
Name = "RSink Events";
EventGenerator = $Gen1;
Enabled = false;
NumEvents = 5000;
TimesToExecute = 1;
MaxPermConsumers = 2;
MaxTempConsumers = 2;
SlowDownProviders = true;
};
instance of MSFT_EssTestFilter
{
Name = "RSink Ranges: 100-200,400-500";
EventGenerator = $Gen1;
Query =
"select * from MSFT_EssTestRSinkBaseEvent "
"where (Index >= 100 and Index <= 200) or"
"(Index >= 400 and Index <= 500)";
ScriptRule = "(Index >= 100 && Index <= 200) || "
"(Index >= 400 && Index <= 500)";
Behavior = 1;
};
instance of MSFT_EssTestFilter
{
Name = "RSink Ranges: 1000-1100";
EventGenerator = $Gen1;
Query =
"select * from MSFT_EssTestRSinkBaseEvent where "
"(Index >= 1000 and Index <= 1100)";
ScriptRule = "Index >= 1000 && Index <= 1100";
Behavior = 1;
OnAt = 2;
OffAt = 6;
};
instance of MSFT_EssTestFilter
{
Name = "RSink Ranges: 3000-3200 (on/off)";
EventGenerator = $Gen1;
Query =
"select * from MSFT_EssTestRSinkBaseEvent where "
"(Index >= 3000 and Index <= 3200)";
ScriptRule = "Index >= 3000 && Index <= 3200";
Behavior = 2;
OnAt = 2;
OffAt = 6;
};
instance of MSFT_EssTestFilter
{
Name = "RSink Ranges: 200-400,600-800,900-950";
EventGenerator = $Gen1;
Query =
"select * from MSFT_EssTestRSinkBaseEvent where "
"(Index >= 200 and Index <= 250) or "
"(Index >= 600 and Index <= 800) or "
"(Index >= 900 and Index <= 950)";
ScriptRule =
"(Index >= 200 && Index <= 250) || "
"(Index >= 600 && Index <= 800) || "
"(Index >= 900 && Index <= 950)";
Behavior = 1;
};
instance of MSFT_EssTestFilter
{
Name = "RSink Includes: 10,20,30,40,50,60,70,80,90,100";
EventGenerator = $Gen1;
Query =
"select * from MSFT_EssTestRSinkBaseEvent where "
"Index = 10 or Index = 20 or Index = 30 or "
"Index = 40 or Index = 50 or Index = 60 or "
"Index = 70 or Index = 80 or Index = 90 or "
"Index = 100";
ScriptRule =
"Index == 10 || Index == 20 || Index == 30 || "
"Index == 40 || Index == 50 || Index == 60 || "
"Index == 70 || Index == 80 || Index == 90 || "
"Index == 100";
Behavior = 1;
};
//////////////////////////////////////////////////////////////////////////////
// Decoupled event provider registration.
instance of Win32PseudoProvider as $P2
{
Name = "Decoupled RSink Event Generator";
};
instance of __EventProviderRegistration
{
Provider = $P2;
EventQueryList =
{
"select * from MSFT_EssTestRSinkEvent1",
"select * from MSFT_EssTestRSinkEvent2",
"select * from MSFT_EssTestRSinkEvent3",
"select * from MSFT_EssTestRSinkEvent4",
"select * from MSFT_EssTestRSinkEvent5"
};
};