IDiskQuotaControl::Initialize

[This is preliminary documentation and subject to change.]

Initializes a new QuotaControl object by opening the NTFS volume with the requested access rights. The return value indicates whether the volume supports NTFS disk quotas and whether the caller has sufficient access rights.

HRESULT Initialize(
  LPCWSTR pszPath, 
  BOOL bReadWrite
);
 

Parameters

pszPath
Specifies the name of the NTFS path to open. To obtain WRITE access, use a string of the form "\\.\X", where X is the drive letter for the volume. To obtain only READ access, use a string of the form "X:\".
bReadWrite
If this value is TRUE, the volume is opened in read/write mode. If this value is FALSE, the volume is opened in read-only mode.

Return Values

This method returns one of the following values.

Value Meaning
S_OK Success.
E_FAIL Failure reading volume quota information.
DQC_E_ACCESS_DENIED The caller has insufficient access rights.
DQC_E_BAD_PATHNAME The requested path name is invalid.
DQC_E_FILE_NOT_FOUND The requested file or object was not found.
DQC_E_INITIALIZED The controller object has already been initialized. Multiple initialization is not allowed.
DQC_E_INVALID_NAME The requested file path is invalid.
DQC_E_NO_QUOTAS_FS The file system does not support quotas. Currently, the file system must be NTFS.
DQC_E_NO_QUOTAS_FSVER The file system version does not support quotas. Currently, the file system must be NTFS 5.0 or later.
DQC_E_PATH_NOT_FOUND The requested file path was not found.

QuickInfo

  Windows NT: Requires version 5.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in dskquota.h.

See Also

File Systems Overview, File System Interfaces, IDiskQuotaControl