Article ID: 938335 - View products that this article applies to.
This article describes the API for the Windows Disk Protection feature in Windows SteadyState.
Note Windows SteadyState was formerly known as Microsoft Shared Computer Toolkit for Windows XP.
Whether you manage computers in a school computer lab or in an Internet café, in a library, or even in your home, Windows SteadyState can help make it easy for you to keep the computers running the way that you want them to, regardless of who uses them. Windows SteadyState is offered at no charge to all Windows Genuine Advantage customers who are running Windows XP. For more information about Windows SteadyState, visit the following Microsoft Web site:
http://technet.microsoft.com/en-us/library/bb490856.aspxNote Currently, this tool is only supported for use with Windows XP.
Windows SteadyState includes a feature that is called Windows Disk Protection. Windows Disk Protection saves or clears all changes to the operating system partition at the disk protection level that you set. Windows SteadyState uses a Windows Management Instrumentation (WMI) data provider, also known as an API. The API lets a member of the Administrators group query whether Windows Disk Protection has been turned on. If Windows Disk Protection is turned on, you can use the API to modify the specific disk protection level for changes that are made to the hard disk.
The WMI interface for Windows Disk Protection has the following three properties:
The CurrentStatus propertyThe CurrentStatus property is a read-only property. When you query this property, it returns a value that indicates whether Windows Disk Protection is active or is passive. There are two possible values:
Note The passive state (WDP_PASSIVE) is not a user-selectable state or a writable state that is available by using the Windows SteadyState user interface. Instead, this state is used internally by Windows SteadyState. Under typical circumstances, the value of this property will be WDP_ACTIVE.
The CurrentMode propertyBy using the CurrentMode property, you can set or retrieve the current mode for Windows Disk Protection. The CurrentMode property can only be applied if the CurrentStatus property is WDP_ACTIVE. The following table describes the values that are available for the CurrentMode property. These values correspond directly to the three levels of disk protection that are available when Windows Disk Protection is turned on.
Collapse this tableExpand this table
The PersistDateTime propertyBy using the PersistDateTime property, you can query or specify the date and the time at which WDP_MODE_PERSIST expires. If Windows Disk Protection is turned on, Windows Disk Protection automatically reverts to WDP_MODE_DISCARD when WDP_MODE_PERSIST expires. When you query the PersistDateTime property, the data type for the PersistDateTime property is WBemScripting.SWbemDateTime.
Note The PersistDateTime property has no effect unless the CurrentMode property is set to WDP_MODE_PERSIST.
The following example code sets the Windows Disk Protection level to the Retain Changes Temporarily option (WDP_MODE_PERSIST). Also, this code specifies the date and the time that this mode expires and reverts to the Remove All Changes at Restart option (WDP_MODE_DISCARD).
Example codeMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure. However, they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
For more information, visit the following MSDN Web sites: