UWF_Overlay (Standard 8)

7/8/2014

Review the syntax, members, and examples of the UWF_Overlay WMI provider class for Windows Embedded 8 Standard (Standard 8).

This class contains the current size of the Unified Write Filter (UWF) overlay and manages the critical and warning thresholds for the overlay size.

Syntax

class UWF_Overlay {
    [key]  string Id;
    [read] UInt32 OverlayConsumption;
    [read] UInt32 AvailableSpace;
    [read] UInt32 CriticalOverlayThreshold;
    [read] UInt32 WarningOverlayThreshold;

    UInt32 GetOverlayFiles(
        [in] string Volume,
        [out, EmbeddedInstance("UWF_OverlayFile")] string OverlayFiles[]
    );
    UInt32 SetWarningThreshold(
        UInt32 size
    );
    UInt32 SetCriticalThreshold(
        UInt32 size
    );
};

Members

The following tables list any methods and properties that belong to this class.

Methods

Methods

Description

GetOverlayFiles

Returns a list of files of a volume that were cached in the UWF overlay.

SetWarningThreshold

Sets the warning threshold for monitoring the size of the UWF overlay.

SetCriticalThreshold

Sets the critical warning threshold for monitoring the size of the UWF overlay.

Properties

Property

Data Type

Qualifiers

Description

Id

string

[key]

A unique ID. This is always set to UWF_Overlay.

OverlayConsumption

UInt32

[read]

The current size, in MB, of the UWF overlay.

AvailableSpace

UInt32

[read]

The amount of free space, in MB, available to the UWF overlay.

CriticalOverlayThreshold

UInt32

[read]

The critical threshold size, in MB. UWF sends a critical threshold notification event when the UWF overlay size reaches or exceeds this value.

WarningOverlayThreshold

UInt32

[read]

The warning threshold size, in MB. UWF sends a warning threshold notification event when the UWF overlay size reaches or exceeds this value.

Examples

The following example demonstrates how to use the UWF Overlay by using the WMI provider in a PowerShell script.

$COMPUTER = "localhost"
$NAMESPACE = "root\standardcimv2\embedded"

# Function to set the Unified Write Filter overlay warning threshold

function Set-OverlayWarningThreshold($ThresholdSize) {

    # Retrieve the Overlay WMI object
    
    $OverlayInstance = Get-WMIObject -namespace $NAMESPACE -class UWF_Overlay;

    if(!$OverlayInstance) {
        "Unable to get handle to an instance of the UWF Overlay class"
        return;
    }
    
    # Call the instance method to set the warning threshold value
                    
    $retval = $OverlayInstance.SetWarningThreshold($ThresholdSize);
                                            
    # Check the return value to verify that setting the warning threshold is successful
    
    if ($retval.ReturnValue -eq 0) {
        "Overlay warning threshold has been set to " + $ThresholdSize + " MB"
    } else {
        "Unknown Error: " + "{0:x0}" -f $retval.ReturnValue
    }
}

# Function to set the Unified Write Filter overlay critical threshold

function Set-OverlayCriticalThreshold($ThresholdSize) {

    # Retrieve the Overlay WMI object
    
    $OverlayInstance = Get-WMIObject -namespace $NAMESPACE -class UWF_Overlay;

    if(!$OverlayInstance) {
        "Unable to get handle to an instance of the UWF Overlay class"
        return;
    }
    
    # Call the instance method to set the warning threshold value
                    
    $retval = $OverlayInstance.SetCriticalThreshold($ThresholdSize);
                                            
    # Check the return value to verify that setting the critical threshold is successful
    
    if ($retval.ReturnValue -eq 0) {
        "Overlay critical threshold has been set to " + $ThresholdSize + " MB"
    } else {
        "Unknown Error: " + "{0:x0}" -f $retval.ReturnValue
    }
}

# Function to print the current Overlay information

function Get-OverlayInformation() {

    # Retrieve the Overlay WMI object
    
    $OverlayInstance = Get-WMIObject -namespace $NAMESPACE -class UWF_Overlay;

    if(!$OverlayInstance) {
        "Unable to get handle to an instance of the UWF Overlay class"
        return;
    }
    
    # Display the current values of the overlay properties

    "`nOverlay Consumption: " + $OverlayInstance.OverlayConsumption
    "Available Space: " + $OverlayInstance.AvailableSpace
    "Critical Overlay Threshold: " + $OverlayInstance.CriticalOverlayThreshold
    "Warning Overlay Threshold: " + $OverlayInstance.WarningOverlayThreshold
}

# Examples of using these functions

"`nSetting the warning threshold to 768 MB."
Set-OverlayWarningThreshold( 768 )

"`nSetting the critical threshold to 896 MB."
Set-OverlayCriticalThreshold( 896 )

"`nDisplaying the current state of the overlay."
Get-OverlayInformation

Remarks

Only one UWF_Overlay instance exists for a system protected with UWF.

Requirements

Architecture

x64,
x86

MOF

uwfwmi.mof

WMI Namespace

root\standardcimv2\embedded

WMI Provider

UWF

See Also

Reference

Unified Write Filter WMI Provider Reference

Concepts

Unified Write Filter (UWF) Overview