// ntifs.h
// CTL_CODE(0x0009, 0x023, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_FIND_FILES_BY_SID 0x0009008F
View the official Windows Driver Kit DDI reference// winioctl.h
// CTL_CODE(0x0009, 0x023, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_FIND_FILES_BY_SID 0x0009008F
View the official Win32 API reference// CTL_CODE(0x0009, 0x023, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_FIND_FILES_BY_SID 0x0009008F
View the official Windows hardware development documentationNo description available.
The FSCTL_FIND_FILES_BY_SID control code searches a directory for a file whose creator owner matches the specified security identifier (SID).
FSCTL_FIND_FILES_BY_SID
To perform this operation, call FltFsControlFile or ZwFsControlFile.
See FSCTL_FIND_FILES_BY_SID IOCTL (winioctl.h).
Searches a directory for a file whose creator owner matches the specified SID.
To perform this operation, call the DeviceIoControl function with the following parameters.
BOOL DeviceIoControl(
(HANDLE) hDevice, // handle to volume
FSCTL_FIND_FILES_BY_SID, // dwIoControlCode
(LPVOID) lpInBuffer, // input buffer
(DWORD) nInBufferSize, // size of input buffer
(LPVOID) lpOutBuffer, // output buffer
(DWORD) nOutBufferSize, // size of output buffer
(LPDWORD) lpBytesReturned, // number of bytes returned
(LPOVERLAPPED) lpOverlapped // OVERLAPPED structure
);
Irp->IoStatus.Status is set to STATUS_SUCCESS if the request is successful.
Otherwise, Status to the appropriate error condition as a NTSTATUS code.
For more information, see NTSTATUS Values.
This control code requires the use of disk quotas on the volume.
In Windows 8 and Windows Server 2012, this code is supported by the following technologies.
| Technology | Supported |
|---|---|
| Server Message Block (SMB) 3.0 protocol | Yes |
| SMB 3.0 Transparent Failover (TFO) | Yes |
| SMB 3.0 with Scale-out File Shares (SO) | Yes |
| Cluster Shared Volume File System (CsvFS) | Yes |
| Resilient File System (ReFS) | No |
The FSCTL_FIND_FILES_BY_SID control code searches a directory for a file whose creator and owner matches the specified security ID (SID).
To perform this operation, minifilter drivers call FltFsControlFile and file systems, redirectors, and legacy file system filter drivers call ZwFsControlFile with the following parameters.
FileObject [in]: FltFsControlFile only. The file object pointer for the directory to search. This parameter is required and cannot be NULL.
FileHandle [in]: ZwFsControlFile only. The file handle for the directory to search. This parameter is required and cannot be NULL.
FsControlCode [in]: control code for the operation. Use FSCTL_FIND_FILES_BY_SID for this operation.
InputBuffer [in]: A pointer to an input buffer that is described by the FIND_BY_SID_DATA structure.
InputBufferLength [in]: The length, in bytes, of the buffer at InputBuffer.
OutputBuffer [out]: A pointer to a caller-allocated array of quad-aligned FIND_BY_SID_OUTPUT structures that receive the fully qualified path names for each file.
OutputBufferLength [out]: Size, in bytes, of the data returned in the buffer that is pointed to by the OutputBuffer parameter.
When FltFsControlFile and ZwFsControlFile process the FSCTL_FIND_FILES_BY_SID control code, these routines check every file and directory on the volume. This operation might be slow if there are many files on the volume, even if the directory to search is very small.