Hardware Dev Center

Expand Minimize

FltOpenVolume routine

The FltOpenVolume routine returns a handle and a file object pointer for the file system volume that a given minifilter driver instance is attached to.

Syntax


NTSTATUS FltOpenVolume(
  _In_  PFLT_INSTANCE Instance,
  _Out_ PHANDLE       VolumeHandle,
  _Out_ PFILE_OBJECT  *VolumeFileObject
);

Parameters

Instance [in]

Opaque instance pointer for the instance. This instance must be attached to a local volume.

VolumeHandle [out]

Handle for the file system volume.

VolumeFileObject [out]

Pointer to a caller-allocated variable that receives a file object pointer for the root directory of the volume. This parameter is optional and can be NULL.

Return value

FltOpenVolume returns STATUS_SUCCESS or an appropriate NTSTATUS value such as the following:

Return codeDescription
STATUS_FLT_DELETING_OBJECT

The instance or volume is being torn down. This is an error code.

STATUS_INVALID_PARAMETER

The instance is attached to a network volume. This is an error code.

 

Remarks

When the handle returned in the VolumeHandle parameter is no longer needed, the caller must release it by calling FltClose. Thus every successful call to FltOpenVolume must be matched by a subsequent call to FltClose.

If a file object pointer is returned in the VolumeFileObject parameter, the caller must release it when it is no longer needed by calling ObDereferenceObject.

The instance specified by the Instance parameter must be attached to a local volume. If it is attached to a network volume, FltOpenVolume returns STATUS_INVALID_PARAMETER.

To get a pointer to the device object for a given volume, call FltGetDeviceObject.

To get detailed information about the volume that a given instance is attached to, call FltQueryVolumeInformation.

Requirements

Target platform

Universal

Version

Available in Microsoft Windows 2000 Update Rollup 1 for SP4, Windows XP SP3, Windows Server 2003 SP1, and later versions of the Windows operating system.

Header

Fltkernel.h (include Fltkernel.h)

Library

FltMgr.lib

IRQL

PASSIVE_LEVEL

See also

FltClose
FltGetDeviceObject
FltGetFilterFromInstance
FltObjectDereference
FltQueryVolumeInformation
ObDereferenceObject

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft