fracker
驱动太牛
驱动太牛
  • 注册日期2001-06-28
  • 最后登录2021-03-30
  • 粉丝0
  • 关注0
  • 积分219分
  • 威望81点
  • 贡献值0点
  • 好评度23点
  • 原创分0分
  • 专家分1分
  • 社区居民
阅读:1353回复:2

ZwDeviceIoControl函数原型

楼主#
更多 发布于:2002-04-01 10:47
哪位装了2000 IFS KIT ?帮我查一下ZwDeviceIoControl函数的原型,那个函数是在ntifs.h里面声明的。
Tom_lyd
驱动大牛
驱动大牛
  • 注册日期2001-09-02
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分10分
  • 威望1点
  • 贡献值0点
  • 好评度1点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2002-04-01 11:41
  
 Installable File System Kit
ZwDeviceIoControlFile
ZwDeviceIoControlFile sends a control code directly to a specified device driver, causing the corresponding driver to perform the specified operation.

NTSTATUS
  ZwDeviceIoControlFile(
    IN HANDLE  FileHandle,
    IN HANDLE  Event,
    IN PIO_APC_ROUTINE  ApcRoutine,
    IN PVOID  ApcContext,
    OUT PIO_STATUS_BLOCK  IoStatusBlock,
    IN ULONG  IoControlCode,
    IN PVOID  InputBuffer,
    IN PVOID  InputBufferLength,
    OUT PVOID  OutputBuffer,
    OUT PVOID  OutputBufferLength
    );
Parameters
FileHandle
Handle returned by ZwCreateFile or ZwOpenFile for the file object representing the device to which the control information should be given or from which information should be returned. The file object must have been opened for asynchronous I/O if the caller specifies an Event, ApcRoutine and ApcContext, or CompletionContext. For I/O to an underlying mass-storage device, the file object must have been opened for Direct Access to Storage Device (DASD) access.
Event
Optional handle to a caller-created event, which the caller will wait on for completion of the requested operation when the given event is set to the Signaled state. This parameter can be NULL. It must be NULL if the caller will wait on the FileHandle.
ApcRoutine
Address of an optional, caller-supplied APC routine to be called when the requested operation completes. This parameter can be NULL. It must be NULL if there is an I/O completion object associated with the file object.
ApcContext or CompletionContext
Pointer to a caller-determined context area if the caller supplies an APC or if an I/O completion object has been associated with the file object. When the operation completes, either ApcContext is passed to the APC if one was specified or CompletionContext is included as part of the completion message that the I/O Manager posts to the associated I/O completion object.
This parameter must be NULL if ApcRoutine is NULL and there is no I/O completion object associated with the file object.

IoStatusBlock
Pointer to a variable that receives the final completion status and information about the operation. For successful calls that return data, the number of bytes written to the OutputBuffer is returned in the Information member.
IoControlCode
IOCTL_XXX code that indicates which device I/O control operation is to be carried out on, usually by the underlying device driver. The value of this parameter determines the format(s) and required length(s) of the input and output buffers, as well as which of the following parameter pairs are required. For detailed information about the system-defined, device-type-specific IOCTL_XXX codes, see the Windows 2000 DDK documentation and Device Input and Output Control Codes in the Platform SDK documentation.
InputBuffer
Pointer to a caller-allocated buffer that contains device-specific information to be given to the target device. If IoControlCode specifies an operation that does not require input data, this pointer can be NULL.
InputBufferLength
Size in bytes of the buffer at InputBuffer. This value is ignored if InputBuffer is NULL.
OutputBuffer
Pointer to a caller-allocated buffer in which information is returned from the target device. If IoControlCode specifies an operation that does not produce output data, this pointer can be NULL.
OutputBufferLength
Size in bytes of the buffer at OutputBuffer. This value is ignored if OutputBuffer is NULL.
Return Value
ZwDeviceIoControlFile returns STATUS_SUCCESS if the underlying driver(s) successfully carried out the requested operation. Otherwise, the return value can be an error status code propagated from an underlying driver. Possible error status codes include the following:

STATUS_OBJECT_TYPE_MISMATCH
STATUS_INVALID_HANDLE
STATUS_INVALID_PARAMETER
STATUS_ACCESS_DENIED
STATUS_INSUFFICIENT_RESOURCES

Comments
ZwDeviceIoControlFile provides a consistent view of the input and output data to the system and to kernel-mode drivers, while providing applications and underlying drivers with a device-dependent method of specifying a communications interface.

For more information about system-defined IOCTL_XXX codes that kernel-mode drivers for particular types of devices must support, and about defining device-specific IOCTL_XXX or FS-specific FSCTL_XXX for new drivers, see the Windows 2000 DDK documentation and Device Input and Output Control Codes in the Platform SDK documentation.

If the caller opened the file for asynchronous I/O (with neither FILE_SYNCHRONOUS_XXX create/open option set), the specified event, if any, will be set to the signaled state when the device control operation completes. Otherwise, the file object specified by FileHandle will be set to the signaled state. If an ApcRoutine was specified, it is called with the ApcContext and IoStatusBlock pointers.

Callers of ZwDeviceIoControlFile must be running at IRQL PASSIVE_LEVEL.

See Also
IoCallDriver, IoBuildAsynchronousFsdRequest, IoBuildDeviceIoControlRequest, IoBuildSynchronousFsdRequest, ZwClose, ZwCreateFile, ZwOpenFile

Built on Thursday, August 17, 2000See Also
IoCallDriver, IoBuildAsynchronousFsdRequest, IoBuildDeviceIoControlRequest, IoBuildSynchronousFsdRequest, ZwClose, ZwCreateFile, ZwOpenFile
Tom_lyd
fracker
驱动太牛
驱动太牛
  • 注册日期2001-06-28
  • 最后登录2021-03-30
  • 粉丝0
  • 关注0
  • 积分219分
  • 威望81点
  • 贡献值0点
  • 好评度23点
  • 原创分0分
  • 专家分1分
  • 社区居民
板凳#
发布于:2002-04-01 12:09
谢谢!
游客

返回顶部