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
S_OK
0 (0x0)
The method was successful.
E_ACCESS_DENIED
2147942405 (0x80070005)
Applications are accessing this volume. If all access is nonexclusive, specifying the ForceDismount parameter as true allows the method to run successfully.
FVE_E_NOT_ENCRYPTED
2150694913 (0x80310001)
The volume is fully decrypted and cannot be locked.
FVE_E_PROTECTION_DISABLED
2150694945 (0x80310021)
The volume's encryption key is available in the clear on the disk, preventing the volume from being locked.
FVE_E_RECOVERY_KEY_REQUIRED
2150694946 (0x80310022)
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
Win32_encryptablevolume.mof

See also

Win32_EncryptableVolume