The KsSynchronousDeviceControl function issues a synchronous device I/O control operation to the KS object that is specified by a file handle.
HRESULT KsSynchronousDeviceControl( _In_ HANDLE Handle, _In_ ULONG IoControl, _In_opt_ PVOID InBuffer, _In_ ULONG InLength, _Out_opt_ PVOID OutBuffer, _In_ ULONG OutLength, _Inout_ PULONG BytesReturned );
- Handle [in]
Handle to the KS object on which to perform the operation.
- IoControl [in]
Control code that identifies a specific type of operation to perform on a KS object.
- InBuffer [in, optional]
Pointer to a buffer that contains data that specifies the operation to perform.
- InLength [in]
Size, in bytes, of the buffer at InBuffer.
- OutBuffer [out, optional]
Pointer to a buffer that contains either data for the operation or buffer space that receives data for the operation.
- OutLength [in]
Size, in bytes, of the buffer at OutBuffer.
- BytesReturned [in, out]
Pointer to a variable that receives the size, in bytes, of the data that KsSynchronousDeviceControl stores in the buffer at OutBuffer.
Returns NOERROR if successful; otherwise, returns an error code.
To retrieve the handle to the KS object, an application should call the IKsObject::KsGetObjectHandle method.
An application can set the control code in IoControl and the buffers at InBuffer and OutBuffer as follows to specify the operation to perform:
Set IoControl to IOCTL_KS_PROPERTY to access a property. Set InBuffer to point to a KSPROPERTY structure that specifies the property of the property set to access and whether to retrieve information about the property or set information in the property. To set information in the property, set OutBuffer to point to that information. To retrieve information from the property, set OutBuffer to receive that information.
Set IoControl to IOCTL_KS_METHOD to execute a method. Set InBuffer to point to a KSMETHOD structure that specifies the method of the method set to execute and whether to read and/or write data related to the method. To read data, set OutBuffer to point to that data. To write data, set OutBuffer to receive that data.
Set IoControl to IOCTL_KS_ENABLE_EVENT to request that the KS object specified by Handle notify the application whenever a specific event action occurs. Set InBuffer to point to a KSEVENT structure that specifies the event of the event set about which to notify. Set OutBuffer to point to a KSEVENTDATA structure that describes how the KS object should notify the application when the event occurs. Also see KS Events.
Set IoControl to IOCTL_KS_DISABLE_EVENT to inform the KS object specified by Handle to stop notifying the application whenever a specific event action occurs. Set InBuffer to point to the KSEVENTDATA structure that was previously used in the event-notification request.
To retrieve a list of all properties, events, or methods supported by a filter, an application can set IoControl to IOCTL_KS_PROPERTY, IOCTL_KS_ENABLE_EVENT, or IOCTL_KS_METHOD. For the KSPROPERTY, KSEVENT, or KSMETHOD structure to which InBuffer points, set the Set member to GUID_NULL and set the Flags member to KSPROPERTY_TYPE_SETSUPPORT.
After the call to KsSynchronousDeviceControl, OutBuffer will contain an array of set GUIDs supported by the object specified by Handle.
Build date: 11/16/2013