Mail Archives: cygwin/1999/03/22/10:06:22
------=_NextPart_000_0016_01BE7450.190FBCA0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
>> Pls. refer documentation of DevIoControl(..) =20
>Coud you please point me where can I find the documentation about this =
API.I am=20
>quite a newbie as to Windows programming.
hi,
u can find info about the api in SDK documentation , if u have msdev u =
can look up that api call and it lists all the control parameters. but =
anyway i am sending u the information. I havent tried doing any =
low-level device specific stuff so i cannot send u any example (sorry =
about that) :-
BOOL DeviceIoControl(
HANDLE hDevice, // handle to device of interest
DWORD dwIoControlCode, // control code of operation to perform
LPVOID lpInBuffer, // pointer to buffer to supply input data
DWORD nInBufferSize, // size, in bytes, of input buffer
LPVOID lpOutBuffer, // pointer to buffer to receive output =
data
DWORD nOutBufferSize, // size, in bytes, of output buffer
LPDWORD lpBytesReturned, // pointer to variable to receive byte =
count
LPOVERLAPPED lpOverlapped // pointer to structure for asynchronous =
operation
);
=20
Parameters
hDevice=20
Handle to the device that is to perform the operation. Call the =
CreateFile function to obtain a device handle.=20
dwIoControlCode=20
Specifies the control code for the operation. This value identifies =
the specific operation to be performed and the type of device on which =
the operation is to be performed. The following values are defined: =
Value Meaning=20
FSCTL_ALLOW_EXTENDED_DASD_IO Signals the file system =
driver not to perform any I/O boundary checks on partition read or write =
calls. Instead, boundary checks are performed by the device driver. =20
FSCTL_DELETE_REPARSE_POINT Deletes a reparse point for a =
file or directory.=20
FSCTL_DISMOUNT_VOLUME Dismounts a volume.=20
FSCTL_ENABLE_UPGRADE Enables or disables upgrading an =
NTFS volume to NTFS version 5.=20
FSCTL_GET_COMPRESSION Obtains the compression state of a =
file or directory=20
FSCTL_GET_HFS_INFORMATION Returns Macintosh Finder =
information about the file associated with the input handle. =20
FSCTL_GET_REPARSE_POINT Returns reparse point data for a =
file or directory.=20
FSCTL_LOCK_VOLUME Locks a volume.=20
FSCTL_QUERY_ALLOCATED_RANGES Scans a file for ranges of =
the file for which disk space is allocated.=20
FSCTL_QUERY_FAT_BPB Returns the first 36 bytes of a =
FAT16 or FAT12 volume.=20
FSCTL_READ_COMPRESSION Reserved for future use.=20
FSCTL_SET_COMPRESSION Sets the compression state of a =
file or directory.=20
FSCTL_SET_REPARSE_POINT Sets a reparse point on a file =
or directory.=20
FSCTL_SET_SPARSE Marks a file as a sparse file.=20
FSCTL_SET_ZERO_DATA Sets a range of a files bytes to =
zeroes.=20
FSCTL_UNLOCK_VOLUME Unlocks a volume.=20
FSCTL_WRITE_COMPRESSION Reserved for future use.=20
IOCTL_DISK_CHECK_VERIFY Obsolete. Use =
IOCTL_STORAGE_CHECK_VERIFY=20
IOCTL_DISK_EJECT_MEDIA Obsolete. Use =
IOCTL_STORAGE_EJECT_MEDIA=20
IOCTL_DISK_FORMAT_TRACKS Formats a contiguous set of =
disk tracks.=20
IOCTL_DISK_GET_DRIVE_GEOMETRY Obtains information on the =
physical disk's geometry.=20
IOCTL_DISK_GET_DRIVE_LAYOUT Provides information about =
each partition on a disk.=20
IOCTL_DISK_GET_MEDIA_TYPES Obsolete. Use =
IOCTL_STORAGE_GET_MEDIA_TYPES=20
IOCTL_DISK_GET_PARTITION_INFO Obtains disk partition =
information.=20
IOCTL_DISK_LOAD_MEDIA Obsolete. Use =
IOCTL_STORAGE_LOAD_MEDIA=20
IOCTL_DISK_MEDIA_REMOVAL Obsolete. Use =
IOCTL_STORAGE_MEDIA_REMOVAL=20
IOCTL_DISK_PERFORMANCE Provides disk performance =
information.=20
IOCTL_DISK_REASSIGN_BLOCKS Maps disk blocks to =
spare-block pool.=20
IOCTL_DISK_SET_DRIVE_LAYOUT Partitions a disk.=20
IOCTL_DISK_SET_PARTITION_INFO Sets the disk partition =
type.=20
IOCTL_DISK_VERIFY Performs logical format of a disk =
extent.=20
IOCTL_SERIAL_LSRMST_INSERT Enables or disables placement =
of a line and modem status data into the data stream.=20
IOCTL_STORAGE_CHECK_VERIFY Checks for change in a =
removable-media device.=20
IOCTL_STORAGE_EJECT_MEDIA Ejects media from a SCSI =
device.=20
IOCTL_STORAGE_GET_MEDIA_TYPES Obtains information about =
media support.=20
IOCTL_STORAGE_LOAD_MEDIA Loads media into a device.=20
IOCTL_STORAGE_MEDIA_REMOVAL Enables or disables the =
media eject mechanism.=20
=20
=20
For more detailed information on each control code, see its topic. =
In particular, each topic provides details on the usage of the =
lpInBuffer, nInBufferSize, lpOutBuffer, nOutBufferSize, and =
lpBytesReturned parameters.=20
lpInBuffer=20
Pointer to a buffer that contains the data required to perform the =
operation.=20
This parameter can be NULL if the dwIoControlCode parameter =
specifies an operation that does not require input data.=20
nInBufferSize=20
Size, in bytes, of the buffer pointed to by lpInBuffer.=20
lpOutBuffer=20
Pointer to a buffer that receives the operation's output data.=20
This parameter can be NULL if the dwIoControlCode parameter =
specifies an operation that does not produce output data.=20
nOutBufferSize=20
Size, in bytes, of the buffer pointed to by lpOutBuffer.=20
lpBytesReturned=20
Pointer to a variable that receives the size, in bytes, of the data =
stored into the buffer pointed to by lpOutBuffer.=20
If lpOverlapped is NULL, lpBytesReturned cannot be NULL. Even when =
an operation produces no output data, and lpOutBuffer can be NULL, the =
DeviceIoControl function makes use of the variable pointed to by =
lpBytesReturned. After such an operation, the value of the variable is =
without meaning.=20
If lpOverlapped is not NULL, lpBytesReturned can be NULL. If this is =
an overlapped operation, you can get the number of bytes returned by =
calling GetOverlappedResult. If hDevice is associated with an I/O =
completion port, you can get the number of bytes returned by calling =
GetQueuedCompletionStatus.=20
lpOverlapped=20
Pointer to an OVERLAPPED structure.=20
If hDevice was opened with the FILE_FLAG_OVERLAPPED flag, this =
parameter must point to a valid OVERLAPPED structure. In this case, =
DeviceIoControl is performed as an overlapped (asynchronous) operation. =
If the device was opened with FILE_FLAG_OVERLAPPED and lpOverlapped is =
NULL, the function fails in unpredictable ways.=20
If hDevice was opened without specifying the FILE_FLAG_OVERLAPPED =
flag, this parameter is ignored and the DeviceIoControl function does =
not return until the operation has been completed, or an error occurs.=20
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error =
information, call GetLastError.=20
Remarks
If hDevice was opened with FILE_FLAG_OVERLAPPED and the lpOverlapped =
parameter points to an OVERLAPPED structure, DeviceIoControl is =
performed as an overlapped (asynchronous) operation. In this case, the =
OVERLAPPED structure must contain a handle to a manual-reset event =
object created by a call to the CreateEvent function. For more =
information on manual-reset event objects, see Synchronization.=20
Windows CE: No specific values are defined for the dwIoControlCode =
parameter. However, the writer of a custom device driver can define =
IOCTL_XXXX control codes, per the CTL_CODE macro. These control codes =
can then be advertised, and an application can use these control codes =
with DeviceIoControl to perform the driver-specific functions.=20
The lpOverlapped parameter is ignored and should be NULL.
QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winbase.h.
Import Library: Use kernel32.lib.
hope this will be of some help to u
Regards=20
Nirmal Prasad R.
------=_NextPart_000_0016_01BE7450.190FBCA0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><BR>>> Pls. refer documentation of DevIoControl(..) =
</DIV>
<DIV>>Coud you please point me where can I find the documentation =
about this=20
API.I am </DIV>
<DIV>>quite a newbie as to Windows programming.</DIV>
<DIV>hi,</DIV>
<DIV> </DIV>
<DIV>u can find info about the api in SDK documentation , if u have =
msdev u can=20
look up that api call and it lists all the control parameters. but =
anyway i am=20
sending u the information. I havent tried doing any low-level device =
specific=20
stuff so i cannot send u any example (sorry about that) :-</DIV>
<DIV> </DIV>
<DIV><PRE><CODE><B>BOOL DeviceIoControl(
HANDLE</B><I> hDevice</I><B>, </B>// handle to device of =
interest
<B> DWORD</B><I> dwIoControlCode</I><B>, </B>// control code of =
operation to perform
<B> LPVOID</B><I> lpInBuffer</I><B>, </B>// pointer to buffer =
to supply input data
<B> DWORD</B><I> nInBufferSize</I><B>, </B>// size, in bytes, =
of input buffer
<B> LPVOID</B><I> lpOutBuffer</I><B>, </B>// pointer to buffer =
to receive output data
<B> DWORD</B><I> nOutBufferSize</I><B>, </B>// size, in bytes, =
of output buffer
<B> LPDWORD</B><I> lpBytesReturned</I><B>, </B>// pointer to =
variable to receive byte count
<B> LPOVERLAPPED</B><I> lpOverlapped</I> // pointer to structure for =
asynchronous operation
<B>);</B>
</CODE></PRE>
<H4>Parameters</H4>
<DL>
<DT><I>hDevice</I>=20
<DD>Handle to the device that is to perform the operation. Call the =
<A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/filesio_7=
wmd.htm"><B>CreateFile</B></A>=20
function to obtain a device handle.=20
<DT><I>dwIoControlCode</I>=20
<DD>Specifies the control code for the operation. This value =
identifies the=20
specific operation to be performed and the type of device on which =
the=20
operation is to be performed. The following values are defined:=20
<TABLE cellSpacing=3D4 cols=3D2>
<TBODY>
<TR vAlign=3Dtop>
<TH align=3Dleft width=3D59%>Value</TH>
<TH align=3Dleft width=3D41%>Meaning</TH></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_8b3=
j.htm"><B>FSCTL_ALLOW_EXTENDED_DASD_IO</B></A></TD>
<TD width=3D41%>Signals the file system driver not to =
perform any=20
I/O boundary checks on partition read or write calls. =
Instead,=20
boundary checks are performed by the device driver. =
</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_44m=
s.htm"><B>FSCTL_DELETE_REPARSE_POINT</B></A></TD>
<TD width=3D41%>Deletes a reparse point for a file or =
directory.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_35i=
d.htm"><B>FSCTL_DISMOUNT_VOLUME</B></A></TD>
<TD width=3D41%>Dismounts a volume.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_0e0=
5.htm"><B>FSCTL_ENABLE_UPGRADE</B></A>=20
</TD>
<TD width=3D41%>Enables or disables upgrading an NTFS volume =
to=20
NTFS version 5.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_0ka=
6.htm"><B>FSCTL_GET_COMPRESSION</B></A></TD>
<TD width=3D41%>Obtains the compression state of a file or=20
directory</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_8rs=
e.htm"><B>FSCTL_GET_HFS_INFORMATION</B></A></TD>
<TD width=3D41%>Returns Macintosh Finder information about =
the=20
file associated with the input handle. </TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_56d=
0.htm"><B>FSCTL_GET_REPARSE_POINT</B></A></TD>
<TD width=3D41%>Returns reparse point data for a file or=20
directory.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_02w=
5.htm"><B>FSCTL_LOCK_VOLUME</B></A></TD>
<TD width=3D41%>Locks a volume.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_056=
b.htm"><B>FSCTL_QUERY_ALLOCATED_RANGES</B></A></TD>
<TD width=3D41%>Scans a file for ranges of the file for =
which disk=20
space is allocated.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_1js=
2.htm"><B>FSCTL_QUERY_FAT_BPB</B></A></TD>
<TD width=3D41%>Returns the first 36 bytes of a FAT16 or =
FAT12=20
volume.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><B>FSCTL_READ_COMPRESSION</B></TD>
<TD width=3D41%>Reserved for future use.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_627=
i.htm"><B>FSCTL_SET_COMPRESSION</B></A></TD>
<TD width=3D41%>Sets the compression state of a file or=20
directory.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_4qy=
c.htm"><B>FSCTL_SET_REPARSE_POINT</B></A></TD>
<TD width=3D41%>Sets a reparse point on a file or =
directory.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_535=
1.htm"><B>FSCTL_SET_SPARSE</B></A></TD>
<TD width=3D41%>Marks a file as a sparse file.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_9wb=
l.htm"><B>FSCTL_SET_ZERO_DATA</B></A></TD>
<TD width=3D41%>Sets a range of a files bytes to =
zeroes.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_5kb=
p.htm"><B>FSCTL_UNLOCK_VOLUME</B></A></TD>
<TD width=3D41%>Unlocks a volume.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><B>FSCTL_WRITE_COMPRESSION</B></TD>
<TD width=3D41%>Reserved for future use.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_35h=
5.htm"><B>IOCTL_DISK_CHECK_VERIFY</B></A></TD>
<TD width=3D41%>Obsolete. Use =
IOCTL_STORAGE_CHECK_VERIFY</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_7od=
d.htm"><B>IOCTL_DISK_EJECT_MEDIA</B></A></TD>
<TD width=3D41%>Obsolete. Use =
IOCTL_STORAGE_EJECT_MEDIA</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_3sf=
n.htm"><B>IOCTL_DISK_FORMAT_TRACKS</B></A></TD>
<TD width=3D41%>Formats a contiguous set of disk =
tracks.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_4o6=
x.htm"><B>IOCTL_DISK_GET_DRIVE_GEOMETRY</B></A></TD>
<TD width=3D41%>Obtains information on the physical disk's=20
geometry.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_5xd=
g.htm"><B>IOCTL_DISK_GET_DRIVE_LAYOUT</B></A></TD>
<TD width=3D41%>Provides information about each partition on =
a=20
disk.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_1kq=
b.htm"><B>IOCTL_DISK_GET_MEDIA_TYPES</B></A></TD>
<TD width=3D41%>Obsolete. Use =
IOCTL_STORAGE_GET_MEDIA_TYPES</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_0ns=
f.htm"><B>IOCTL_DISK_GET_PARTITION_INFO</B></A></TD>
<TD width=3D41%>Obtains disk partition =
information.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_2vj=
5.htm"><B>IOCTL_DISK_LOAD_MEDIA</B></A></TD>
<TD width=3D41%>Obsolete. Use =
IOCTL_STORAGE_LOAD_MEDIA</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_8cr=
w.htm"><B>IOCTL_DISK_MEDIA_REMOVAL</B></A></TD>
<TD width=3D41%>Obsolete. Use =
IOCTL_STORAGE_MEDIA_REMOVAL</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_5lp=
h.htm"><B>IOCTL_DISK_PERFORMANCE</B></A></TD>
<TD width=3D41%>Provides disk performance =
information.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_490=
z.htm"><B>IOCTL_DISK_REASSIGN_BLOCKS</B></A></TD>
<TD width=3D41%>Maps disk blocks to spare-block =
pool.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_7sm=
s.htm"><B>IOCTL_DISK_SET_DRIVE_LAYOUT</B></A></TD>
<TD width=3D41%>Partitions a disk.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_39p=
r.htm"><B>IOCTL_DISK_SET_PARTITION_INFO</B></A></TD>
<TD width=3D41%>Sets the disk partition type.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_41d=
l.htm"><B>IOCTL_DISK_VERIFY</B></A></TD>
<TD width=3D41%>Performs logical format of a disk =
extent.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_53l=
g.htm"><B>IOCTL_SERIAL_LSRMST_INSERT</B></A></TD>
<TD width=3D41%>Enables or disables placement of a line and =
modem=20
status data into the data stream.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_6kf=
t.htm"><B>IOCTL_STORAGE_CHECK_VERIFY</B></A></TD>
<TD width=3D41%>Checks for change in a removable-media =
device.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_2ko=
1.htm"><B>IOCTL_STORAGE_EJECT_MEDIA</B></A></TD>
<TD width=3D41%>Ejects media from a SCSI device.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_0jo=
z.htm"><B>IOCTL_STORAGE_GET_MEDIA_TYPES</B></A></TD>
<TD width=3D41%>Obtains information about media =
support.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_5x5=
t.htm"><B>IOCTL_STORAGE_LOAD_MEDIA</B></A></TD>
<TD width=3D41%>Loads media into a device.</TD></TR>
<TR vAlign=3Dtop>
<TD width=3D59%><A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/devio_6ye=
k.htm"><B>IOCTL_STORAGE_MEDIA_REMOVAL</B></A></TD>
<TD width=3D41%>Enables or disables the media eject=20
mechanism.</TD></TR></TBODY></TABLE><BR>
<P>For more detailed information on each control code, see its =
topic. In=20
particular, each topic provides details on the usage of the=20
<I>lpInBuffer</I>, <I>nInBufferSize</I>, <I>lpOutBuffer</I>,=20
<I>nOutBufferSize</I>, and <I>lpBytesReturned</I> parameters. </P>
<DT><I>lpInBuffer</I>=20
<DD>Pointer to a buffer that contains the data required to perform =
the=20
operation.=20
<P>This parameter can be NULL if the <I>dwIoControlCode</I> =
parameter=20
specifies an operation that does not require input data. </P>
<DT><I>nInBufferSize</I>=20
<DD>Size, in bytes, of the buffer pointed to by <I>lpInBuffer</I>.=20
<DT><I>lpOutBuffer</I>=20
<DD>Pointer to a buffer that receives the operation's output data.=20
<P>This parameter can be NULL if the <I>dwIoControlCode</I> =
parameter=20
specifies an operation that does not produce output data. </P>
<DT><I>nOutBufferSize</I>=20
<DD>Size, in bytes, of the buffer pointed to by <I>lpOutBuffer</I>.=20
<DT><I>lpBytesReturned</I>=20
<DD>Pointer to a variable that receives the size, in bytes, of the =
data=20
stored into the buffer pointed to by <I>lpOutBuffer</I>.=20
<P>If <I>lpOverlapped</I> is NULL, <I>lpBytesReturned</I> cannot be =
NULL.=20
Even when an operation produces no output data, and =
<I>lpOutBuffer</I> can=20
be NULL, the <B>DeviceIoControl</B> function makes use of the =
variable=20
pointed to by <I>lpBytesReturned</I>. After such an operation, the =
value of=20
the variable is without meaning.=20
<P>If <I>lpOverlapped</I> is not NULL, <I>lpBytesReturned</I> can be =
NULL.=20
If this is an overlapped operation, you can get the number of bytes =
returned=20
by calling <A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/synchro_7=
5v8.htm"><B>GetOverlappedResult</B></A>.=20
If <I>hDevice</I> is associated with an I/O completion port, you can =
get the=20
number of bytes returned by calling <A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/filesio_0=
71v.htm"><B>GetQueuedCompletionStatus</B></A>.=20
</P>
<DT><I>lpOverlapped</I>=20
<DD>Pointer to an <A=20
=
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/synchro_8=
tf6.htm"><B>OVERLAPPED</B></A>=20
structure.=20
<P>If <I>hDevice</I> was opened with the FILE_FLAG_OVERLAPPED flag, =
this=20
parameter must point to a valid <B>OVERLAPPED</B> structure. In this =
case,=20
<B>DeviceIoControl</B> is performed as an overlapped (asynchronous)=20
operation. If the device was opened with FILE_FLAG_OVERLAPPED and=20
<I>lpOverlapped</I> is NULL, the function fails in unpredictable =
ways.=20
<P>If <I>hDevice</I> was opened without specifying the =
FILE_FLAG_OVERLAPPED=20
flag, this parameter is ignored and the <B>DeviceIoControl</B> =
function does=20
not return until the operation has been completed, or an error =
occurs.=20
</P></DD></DL>
<H4>Return Values</H4>
<P>If the function succeeds, the return value is nonzero.</P>
<P>If the function fails, the return value is zero. To get extended =
error=20
information, call <A=20
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/errors_3u=
wi.htm"><B>GetLastError</B></A>.=20
</P>
<H4>Remarks</H4>
<P>If <I>hDevice</I> was opened with FILE_FLAG_OVERLAPPED and the=20
<I>lpOverlapped</I> parameter points to an <B>OVERLAPPED</B> structure,=20
<B>DeviceIoControl</B> is performed as an overlapped (asynchronous) =
operation.=20
In this case, the <B>OVERLAPPED</B> structure must contain a handle to a =
manual-reset event object created by a call to the <B>CreateEvent</B> =
function.=20
For more information on manual-reset event objects, see <A=20
href=3D"mk:@MSITStore:E:\MSDN\winbase.chm::/devdoc/live/pdwbase/synchro_4=
q3y.htm">Synchronization</A>.=20
</P>
<P><B>Windows CE:</B> No specific values are defined for the =
<I>dwIoControlCode=20
</I>parameter. However, the writer of a custom device driver can define=20
<I>IOCTL_XXXX</I> control codes, per the CTL_CODE macro. These control =
codes can=20
then be advertised, and an application can use these control codes with=20
<B>DeviceIoControl</B> to perform the driver-specific functions. </P>
<P>The <I>lpOverlapped</I> parameter is ignored and should be NULL.</P>
<H4>QuickInfo</H4>
<P><B> Windows NT: </B>Requires version 3.1 or later.<BR><B> =
Windows: </B>Requires Windows 95 or later.<BR><B> Windows CE: =
</B>Requires=20
version 1.0 or later.<BR><B> Header: </B>Declared in=20
winbase.h.<BR><B> Import Library: </B>Use kernel32.lib.</P>
<P> </P>
<P>hope this will be of some help to u</P>
<P> </P>
<P>Regards </P>
<P> </P>
<P>Nirmal Prasad R.</P></DIV></BODY></HTML>
------=_NextPart_000_0016_01BE7450.190FBCA0
Content-Type: text/plain; charset=us-ascii
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
------=_NextPart_000_0016_01BE7450.190FBCA0--
- Raw text -