[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ros-diffs
Subject:    [ros-diffs] [jimtabor] 13768: Check for removable media and
From:       <jimtabor () svn ! reactos ! com>
Date:       2005-02-27 21:17:24
Message-ID: 000001c51d11$bb987eb0$6601a8c0 () penelope
[Download RAW message or body]

Check for removable media and Partition length is 0, for
DiskClassCheckReadWrite.
Modified: trunk/reactos/drivers/storage/disk/disk.c
  _____  

Modified: trunk/reactos/drivers/storage/disk/disk.c
--- trunk/reactos/drivers/storage/disk/disk.c	2005-02-27 20:38:36 UTC
(rev 13767)
+++ trunk/reactos/drivers/storage/disk/disk.c	2005-02-27 21:17:24 UTC
(rev 13768)
@@ -406,10 +406,26 @@

       return(STATUS_INVALID_PARAMETER);
     }
 
+
+
   IrpStack = IoGetCurrentIrpStackLocation(Irp);  
   EndingOffset.QuadPart = IrpStack->Parameters.Read.ByteOffset.QuadPart
+
                           IrpStack->Parameters.Read.Length;
 
+
+  DPRINT("Ending %I64d, and RealEnding %I64d! PartSize
%I64d\n",EndingOffset.QuadPart,
+          DeviceExtension->PartitionLength.QuadPart,
+	  DeviceExtension->PartitionLength.QuadPart /
+          DeviceExtension->DiskGeometry->BytesPerSector);
+
+  if ((DeviceObject->Characteristics & FILE_REMOVABLE_MEDIA) &&
+      (DeviceExtension->DiskGeometry->MediaType == RemovableMedia))
+    {
+/* Assume if removable media and if Partition length is 0, Partition
not built yet! */
+	if (DeviceExtension->PartitionLength.QuadPart == 0)
+            return(STATUS_SUCCESS);
+    }
+
   if (EndingOffset.QuadPart >
DeviceExtension->PartitionLength.QuadPart)
     {
       Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;

[Attachment #3 (text/html)]

<html>
<head>
<style>
<!--
body { background-color:#ffffff }
.file { border:1px solid #eeeeee; margin-top:1em; margin-bottom:1em }
.pathname { font-family:monospace; float:right }
.fileheader { margin-bottom:.5em }
.diff { margin:0 }
.tasklist { padding:4px; border:1px dashed #000000; margin-top:1em }
.tasklist ul { margin-top:0; margin-bottom:0 }
tr.alt { background-color:#eeeeee }
#added { background-color:#ddffdd }
#addedchars { background-color:#99ff99; font-weight:bolder }
tr.alt #added { background-color:#ccf7cc }
#removed { background-color:#ffdddd }
#removedchars { background-color:#ff9999; font-weight:bolder }
tr.alt #removed { background-color:#f7cccc }
#info { color:#888888 }
#context { background-color:#eeeeee }
td {padding-left:.3em; padding-right:.3em }
tr.head { border-bottom-width:1px; border-bottom-style:solid }
tr.head td { padding:0; padding-top:.2em }
.task { background-color:#ffff00 }
.comment { padding:4px; border:1px dashed #000000; background-color:#ffffdd }
.error { color:red }
hr { border-width:0px; height:2px; background:black }
-->
</style>
</head>
<body>
<pre class="comment">Check for removable media and Partition length is 0, for \
DiskClassCheckReadWrite.</pre><pre class="diff" id="context">Modified: \
trunk/reactos/drivers/storage/disk/disk.c </pre><hr /><div class="file">
<div class="fileheader"><big><b>Modified: \
trunk/reactos/drivers/storage/disk/disk.c</b></big></div> <pre class="diff"><small \
id="info">--- trunk/reactos/drivers/storage/disk/disk.c	2005-02-27 20:38:36 UTC (rev \
                13767)
+++ trunk/reactos/drivers/storage/disk/disk.c	2005-02-27 21:17:24 UTC (rev 13768)
@@ -406,10 +406,26 @@
</small></pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; \
return(STATUS_INVALID_PARAMETER);  &nbsp; &nbsp; }
 
</pre><pre class="diff" id="added">+
+
</pre><pre class="diff" id="context"> &nbsp; IrpStack = \
IoGetCurrentIrpStackLocation(Irp); &nbsp;  &nbsp; EndingOffset.QuadPart = \
IrpStack-&gt;Parameters.Read.ByteOffset.QuadPart +  &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
IrpStack-&gt;Parameters.Read.Length;  
</pre><pre class="diff" id="added">+
+ &nbsp;DPRINT(&quot;Ending %I64d, and RealEnding %I64d! PartSize \
%I64d\n&quot;,EndingOffset.QuadPart, + &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;DeviceExtension-&gt;PartitionLength.QuadPart, +	 \
&nbsp;DeviceExtension-&gt;PartitionLength.QuadPart / + &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;DeviceExtension-&gt;DiskGeometry-&gt;BytesPerSector); +
+ &nbsp;if ((DeviceObject-&gt;Characteristics &amp; FILE_REMOVABLE_MEDIA) &amp;&amp;
+ &nbsp; &nbsp; &nbsp;(DeviceExtension-&gt;DiskGeometry-&gt;MediaType == \
RemovableMedia)) + &nbsp; &nbsp;{
+/* Assume if removable media and if Partition length is 0, Partition not built yet! \
*/ +	if (DeviceExtension-&gt;PartitionLength.QuadPart == 0)
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return(STATUS_SUCCESS);
+ &nbsp; &nbsp;}
+
</pre><pre class="diff" id="context"> &nbsp; if (EndingOffset.QuadPart &gt; \
DeviceExtension-&gt;PartitionLength.QuadPart)  &nbsp; &nbsp; {
 &nbsp; &nbsp; &nbsp; Irp-&gt;IoStatus.Status = STATUS_INVALID_PARAMETER;
</pre>
</div>

</body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic