Lock method of the Win32_EncryptableVolume class
The Lock method of the Win32_EncryptableVolume class dismounts the volume and removes the volume's encryption key from system memory. The contents of the volume remain inaccessible until it is unlocked by either the UnlockWithExternalKey method or the UnlockWithNumericalPassword method. This method cannot be successfully run for the currently running operating system volume.
Note
If the disc supports hardware encryption, the band is set to "locked".
Syntax
uint32 Lock(
[in, optional] boolean ForceDismount
);
Parameters
-
ForceDismount [in, optional]
-
Type: boolean
If true the disk is forcibly dismounted.
Return value
Type: uint32
This method returns one of the following codes or another error code if it fails.
Return code/value | Description |
---|---|
|
The method was successful. |
|
Applications are accessing this volume. If all access is nonexclusive, specifying the ForceDismount parameter as true allows the method to run successfully. |
|
The volume is fully decrypted and cannot be locked. |
|
The volume's encryption key is available in the clear on the disk, preventing the volume from being locked. |
|
The volume does not have key protectors of the type "Numerical Password" or "External Key" that are necessary to unlock the volume. |
Remarks
Managed Object Format (MOF) files contain the definitions for Windows Management Instrumentation (WMI) classes. MOF files are not installed as part of the Windows SDK. They are installed on the server when you add the associated role by using the Server Manager. For more information about MOF files, see Managed Object Format (MOF).
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows Vista Enterprise, Windows Vista Ultimate [desktop apps only] |
Minimum supported server |
Windows Server 2008 [desktop apps only] |
Namespace |
Root\CIMV2\Security\MicrosoftVolumeEncryption |
MOF |
|
See also