#pragma namespace("\\\\.\\root")

instance of __namespace
{
	Name = "pchealth";
};

#pragma namespace("\\\\.\\root\\pchealth")
instance of __Win32Provider as $DataProv
{
	Name = "MS_VIEW_INSTANCE_PROVIDER";
	ClsId = "{AA70DDF4-E11C-11D1-ABB0-00C04FD9159E}";
	ImpersonationLevel = 1;
	PerUserInitialization = "True";
	
};

instance of __InstanceProviderRegistration
{
	Provider = $DataProv;
	SupportsGet = True;
	SupportsDelete = True;
	SupportsEnumeration = True;
	QuerySupportLevels = {"WQL:UnarySelect"};
};

instance of __MethodProviderRegistration
{
	Provider = $DataProv;
};

//______________________________________________________________________________
//
//  Name:            PCH_ProgramGroup 
//  Synopsis:        This is a View class.
//                   Mapped from Win32_ProgramGroup.
//                   Source Properties : GroupName, Name, UserName
//                   View Properties : Groupname, Name, UserName
//                   There is a change property a string with constant 
//                   value = "SnapShot". This is required for delta computation.
//  Missing Data:    None
//  Additional Data: None
//  Created By:      kalyanin
//______________________________________________________________________________
    		
[
	union,
	ViewSources {"select GroupName, Name, UserName FROM Win32_ProgramGroup"},
	ViewSpaces ("\\\\.\\root\\cimv2"),
	dynamic, provider("MS_VIEW_INSTANCE_PROVIDER")
]

class PCH_ProgramGroup
{
	[PropertySources{"GroupName"}]
	string  GroupName;

	[key, PropertySources{"Name"}]
	string Name;

	[PropertySources{"UserName"}]
	string UserName;

	[PropertySources{""}]
	string Change = "SnapShot";
};

//______________________________________________________________________________
//
//  Name:            PCH_NetWorkConnection
//  Synopsis:        This is a View class.
//                   Mapped from Win32_NetworkConnection.
//                   Source Properties : Name, LocalName, RemoteName,
//                                       ResourceType, Status
//                   View Properties : Name, LocalName, RemoteName,
//                                     Type, Status
//                   There is a change property a string with constant 
//                   value = "SnapShot". This is required for delta computation.
//  Missing Data:    None
//  Additional Data: Name
//          Reasons: Name is a "key" property in win32_NetworkConnection
//                   class. All Key properties from the source class 
//                   need to be present in the view class.
//  Created By:      kalyanin
//______________________________________________________________________________

[
	union,
	ViewSources {"select Name, LocalName, RemoteName, ResourceType, Status FROM Win32_NetworkConnection"},
	ViewSpaces ("\\\\.\\root\\cimv2"),
	dynamic, provider("MS_VIEW_INSTANCE_PROVIDER")
]

class PCH_NetworkConnection
{
	[key, PropertySources{"Name"}]
	string  Name;

	[PropertySources{"LocalName"}]
	string  LocalName;

	[PropertySources{"RemoteName"}]
	string RemoteName;

	[PropertySources{"ResourceType"}]
	string Type;

	[PropertySources{"Status"}]
	string Status;

	[PropertySources{""}]
	string Change = "SnapShot";
};
//______________________________________________________________________________
//
//  Name:            PCH_PrintJob 
//  Synopsis:        This is a View class.
//                   Mapped from Win32_PrintJob.
//                   Source Properties : Name, Size, Status, 
//                                       TimeSubmitted, PagesPrinted
//                   View Properties : Name, Size, Status, 
//                                     TimeSubmitted, PagesPrinted
//                   There is a change property a string with constant 
//                   value = "SnapShot". This is required for delta computation.
//  Missing Data:    None
//  Additional Data: None
//  Created By:      kalyanin
//______________________________________________________________________________

[
	union,
	ViewSources {"select Name, Size, Status, TimeSubmitted, PagesPrinted FROM Win32_PrintJob"},
	ViewSpaces ("\\\\.\\root\\cimv2"),
	dynamic, provider("MS_VIEW_INSTANCE_PROVIDER")
]
class PCH_PrintJob
{
	[key, PropertySources{"Name"}]
	string Name;

	[PropertySources{"Size"}]
	Uint32  Size;

	[PropertySources{"Status"}]
	string Status;

	[PropertySources{"TimeSubmitted"}]
	DateTime TimeSubmitted;

	[PropertySources{"PagesPrinted"}]
	Uint32 PagesPrinted;

	[PropertySources{""}]
	string Change = "SnapShot";
	
};

//______________________________________________________________________________
//
//  Name:            PCH_NetworkProtocol 
//  Synopsis:        This is a View class.
//                   Mapped from Win32_NetworkProtocol.
//                   Source Properties : Name, ConnectionlessService,
//                                       GuaranteesDelivery,GuaranteesSequencing
//                   View Properties : Name, ConnectionlessService,
//                                     GuaranteesDelivery, GuaranteesSequencing
//                   There is a change property a string with constant 
//                   value = "SnapShot". This is required for delta computation.
//  Missing Data:    None
//  Additional Data: None
//  Created By:      kalyanin
//______________________________________________________________________________

[
	union,
	ViewSources {"select Name, ConnectionlessService, GuaranteesDelivery, GuaranteesSequencing from Win32_NetworkProtocol"},
	ViewSpaces ("\\\\.\\root\\cimv2"),
	dynamic, provider("MS_VIEW_INSTANCE_PROVIDER")
]

class PCH_NetworkProtocol
{
	[key, PropertySources{"Name"}]
	string  Name;

	[PropertySources{"ConnectionLessService"}]
	boolean ConnectionLessService ;

	[PropertySources{"GuaranteesDelivery"}]
	boolean GuaranteesDelivery;

	[PropertySources{"GuaranteesSequencing"}]
	boolean GuaranteesSequencing;

	[PropertySources{""}]
	string Change = "SnapShot";
};

//______________________________________________________________________________
//
//  Name:            PCH_Drive 
//  Synopsis:        This is a View class.
//                   Mapped from Win32_LogicalDisk.
//                   Source Properties : DeviceID, FileSystem, 
//                                       FreeSpace, Size
//                   View Properties : DriveLetter, FileSystemType,
//                                       FreeBytes, AvailBytes
//                   There is a change property a string with constant 
//                   value = "SnapShot". This is required for delta computation.
//  Missing Data:    None
//  Additional Data: None
//  Created By:      kalyanin
//______________________________________________________________________________

[   Union,
	ViewSources {"select DeviceID, FileSystem, FreeSpace, Size FROM win32_LogicalDisk"},
	ViewSpaces ("\\\\.\\root\\cimv2"),
	dynamic, provider("MS_VIEW_INSTANCE_PROVIDER")
]
class PCH_Drive
{
	[key, PropertySources{"DeviceID"}]
	string  DriveLetter;

	[PropertySources{"FileSystem"}]
	string FileSystemType ;

	[PropertySources{"FreeSpace"}]
	uint64 FreeBytes;

	[PropertySources{"Size"}]
	uint64 AvailBytes;

	[PropertySources{""}]
	string Change = "SnapShot";
};

//-----------------------------------------------------------------------------
// Created by		: a-jammar
// Date				: 04/14/1999
// Sypnosis			: This creates a view class to map Win32_CODECFile.
//					  What we call "category" is the "group" field from
//					  Win32_CODECFile. What we call "group" is a registry
//					  key grouping the CODECs, and isn't in Win32_CODECFile.
//
//					  NOTE: SELECT * used because "Group" is a keyword.
//
// Missing data		: Group, Key
//-----------------------------------------------------------------------------

[
	union,
	ViewSources {"SELECT * FROM Win32_CODECFile"},
	ViewSpaces ("\\\\.\\root\\cimv2"),
	dynamic, provider("MS_VIEW_INSTANCE_PROVIDER")
]
class PCH_CODEC
{
	[PropertySources{""}]
	string Change = "SnapShot";

	[PropertySources{"description"}]
	string Description;

	[key, PropertySources{"name"}]
	string CODECDriver;

	[PropertySources{"version"}]
	string Version;

	[PropertySources{"group"}]
	string Category;

	[PropertySources{"creationdate"}]
	datetime Date;

	[PropertySources{"filesize"}]
	uint64 SizeBytes;

	[PropertySources{""}, Description("MISSING DATA")]
	string Group = "MISSING";

	[PropertySources{""}, Description("MISSING DATA")]
	string Key = "MISSING";
};


//-----------------------------------------------------------------------------
// Created by		: a-jammar
// Date				: 04/06/1999
// Sypnosis			: This creates a view class to map Win32_CDROMDrive.
//					  NOTE: TotalSpaceKB replaced with TotalSpace.
//					  NOTE: Removing the "device" property?
//
// Missing data		: TransferFile, TransferSizeBytes, CPUUtilAt300KBS,
//					  IntegrityFile, IntegritySize, device(registry)
//-----------------------------------------------------------------------------

[
	union,
	ViewSources {"SELECT DeviceID, Drive, VolumeName, TransferRate, DriveIntegrity, "
			     "Description, SCSITargetId, Manufacturer, MaxMediaSize FROM Win32_CDROMDrive"},
	ViewSpaces ("\\\\.\\root\\cimv2"),
	dynamic, provider("MS_VIEW_INSTANCE_PROVIDER")
]
class PCH_CDROM
{
	[PropertySources{""}]
	string Change = "SnapShot";

	[key, PropertySources{"DeviceID"}] // new property - a key in source class
	string DeviceID;

	[key, PropertySources{"Drive"}]
	string DriveLetter;

	[PropertySources{"VolumeName"}]
	string VolumeName;

	[PropertySources{"MaxMediaSize"}]
	uint64 TotalSpace;

	[PropertySources{"TransferRate"}]
	real64 TransferRateKBS;

	[PropertySources{"DriveIntegrity"}]
	boolean DataTransferIntegrity;

	[PropertySources{"Description"}]
	string Description;

	[PropertySources{"SCSITargetId"}]
	uint16 SCSI;

	[PropertySources{"Manufacturer"}]
	string Manufacturer;

	[PropertySources{""}, Description("MISSING DATA")]
	string TransferFile = "MISSING";

	[PropertySources{""}, Description("MISSING DATA")]
	uint64 TransferSizeBytes = 0;

	[PropertySources{""}, Description("MISSING DATA")]
	uint32 CPUUtilAt300KBS = 0;

	[PropertySources{""}, Description("MISSING DATA")]
	string IntegrityFile = "MISSING";

	[PropertySources{""}, Description("MISSING DATA")]
	uint64 IntegritySize = 0;
};


//-----------------------------------------------------------------------------
// Created by		: a-jammar
// Date				: 04/06/1999
// Sypnosis			: This creates a view class for startup items.
//
// Missing data		: None.
//-----------------------------------------------------------------------------

[
	union,
	ViewSources {"SELECT User, Name, Location, Command FROM Win32_StartupCommand"},
	ViewSpaces ("\\\\.\\root\\cimv2"),
	dynamic, provider("MS_VIEW_INSTANCE_PROVIDER")
]
class PCH_Startup
{
	[PropertySources{""}]
	string Change = "SnapShot";

	[key, PropertySources{"User"}] // new property - a key in source class
	string User;

	[key, PropertySources{"Name"}]
	string Name;

	[key, PropertySources{"Location"}]
	string LoadedFrom;

	[key, PropertySources{"Command"}]
	string Command;
};


//-----------------------------------------------------------------------------
// Created by		: a-jammar
// Date				: 04/14/1999
// Sypnosis			: This creates a view class to show RUNNING TASK.
//					  Note that this class uses two queries and a join between
//					  the cimv2 classes. The order of the strings is very
//					  important in the ViewSources, ViewSpaces and
//					  PropertySources constructs. The first string in the
//					  ViewSpaces corresponds to the namespace for the first
//					  SELECT in ViewSources. When specifying the properties
//					  in PropertySources, the first string corresponds to the
//					  results of the first SELECT, the second to the second
//					  SELECT.
//
// Missing data		: PartOf, Address
//-----------------------------------------------------------------------------

[
	JoinOn("Win32_Process.ExecutablePath = CIM_DataFile.Name"),
	ViewSources {"SELECT Caption, ExecutablePath, Handle FROM Win32_Process", 
			     "SELECT Name, Version, Description, Manufacturer, CreationDate FROM CIM_DataFile"},
	ViewSpaces {"\\\\.\\root\\cimv2", "\\\\.\\root\\cimv2"},
	dynamic, provider("MS_VIEW_INSTANCE_PROVIDER"),
	EnumerateClasses{"Win32_Process"}
]
class PCH_RunningTask
{
	[PropertySources{"", ""}]
	string Change = "SnapShot";

	[PropertySources{"Caption", ""}]
	string Name;

	[key, PropertySources{"ExecutablePath", "Name"}]
	string Path;

	[key, PropertySources{"Handle", ""}] // new property - a key in source class
	string Handle;

	[PropertySources{"", "Version"}]
	string Version;

	[PropertySources{"", "Description"}]
	string Description;

	[PropertySources{"", "Manufacturer"}]
	string Manufacturer;

	[PropertySources{"", "CreationDate"}]
	datetime Date;

	[PropertySources{"", ""}, Description("MISSING DATA")]
	string PartOf = "MISSING";

	[PropertySources{"", ""}, Description("MISSING DATA")]
	string Address = "MISSING";
};
