<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">Make the remaning code match the current formatting instead of being really ugly, and make some changes to IoCreateFileStreamObject (which is wrong anyways, since it's doing what *Lite should do)</pre><pre class="diff" id="context">Modified: trunk/reactos/ntoskrnl/io/file.c
</pre><hr /><div class="file">
<div class="fileheader"><big><b>Modified: trunk/reactos/ntoskrnl/io/file.c</b></big></div>
<pre class="diff"><small id="info">--- trunk/reactos/ntoskrnl/io/file.c        2005-05-09 03:58:35 UTC (rev 15177)
+++ trunk/reactos/ntoskrnl/io/file.c        2005-05-09 04:31:04 UTC (rev 15178)
@@ -4,7 +4,8 @@
</small></pre><pre class="diff" id="context"> &nbsp;* FILE: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ntoskrnl/io/file.c
 &nbsp;* PURPOSE: &nbsp; &nbsp; &nbsp; &nbsp; I/O File Object &amp; NT File Handle Access/Managment of Files.
 &nbsp;* 
</pre><pre class="diff" id="removed">- * PROGRAMMERS: &nbsp; &nbsp; <span id="removedchars">David Welch (welch@mcmail.com</span>)
</pre><pre class="diff" id="added">+ * PROGRAMMERS: &nbsp; &nbsp; <span id="addedchars">Alex Ionescu (alex@relsoft.net</span>)
+ * &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;David Welch (welch@mcmail.com)
</pre><pre class="diff" id="context"> &nbsp;*/
 
 /* INCLUDES *****************************************************************/
@@ -767,6 +768,7 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp;ObDereferenceObject (DeviceObject);
 &nbsp; &nbsp; &nbsp;return STATUS_OBJECT_NAME_COLLISION;
 &nbsp; }
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; /* FIXME: wt... */
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FileObject = IoCreateStreamFileObject(NULL, DeviceObject);
 &nbsp; ObDereferenceObject (DeviceObject);
 &nbsp; &nbsp; &nbsp; }
@@ -997,55 +999,50 @@
</pre><pre class="diff" id="context"> IoCreateStreamFileObject(PFILE_OBJECT FileObject,
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PDEVICE_OBJECT DeviceObject)
 {
</pre><pre class="diff" id="removed">- &nbsp;PFILE_OBJECT CreatedFileObject;
- &nbsp;<span id="removedchars">NTSTATUS Status</span>;
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;PFILE_OBJECT CreatedFileObject</span>;
+ &nbsp; &nbsp;NTSTATUS Status;
+ &nbsp; &nbsp;
+ &nbsp; &nbsp;/* FIXME: This function should call ObInsertObject. The &quot;Lite&quot; version 
+ &nbsp; &nbsp; &nbsp; doesnt. This function is also called from IoCreateFile for some 
+ &nbsp; &nbsp; &nbsp; reason. These hacks need to be removed.
+ &nbsp; &nbsp;*/
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp;DPRINT(&quot;IoCreateStreamFileObject(FileObject %x, DeviceObject %x)\n&quot;,
- &nbsp;<span id="removedchars">FileObject, DeviceObject);</span>
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;DPRINT(&quot;IoCreateStreamFileObject(FileObject %x, DeviceObject %x)\n&quot;,</span>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FileObject, DeviceObject);
+ &nbsp; &nbsp;PAGED_CODE();
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp;ASSERT_IRQL(PASSIVE_LEVEL);
-
- &nbsp;Status = ObCreateObject(KernelMode,
- &nbsp; &nbsp; IoFileObjectType,
- &nbsp; &nbsp; NULL,
- &nbsp; &nbsp; KernelMode,
- &nbsp; &nbsp; NULL,
- &nbsp; &nbsp; sizeof(FILE_OBJECT),
- &nbsp; &nbsp; 0,
- &nbsp; &nbsp; 0,
- &nbsp; &nbsp; (PVOID*)&amp;CreatedFileObject);
- &nbsp;<span id="removedchars">if (!NT_SUCCESS(Status))</span>
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;/* Create the File Object */</span>
+ &nbsp; &nbsp;Status = ObCreateObject(KernelMode,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IoFileObjectType,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NULL,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;KernelMode,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NULL,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sizeof(FILE_OBJECT),
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(PVOID*)&amp;CreatedFileObject);
+ &nbsp; &nbsp;if (!NT_SUCCESS(Status))
</pre><pre class="diff" id="context"> &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp;DPRINT(&quot;Could not create FileObject\n&quot;);
- &nbsp; &nbsp; &nbsp;<span id="removedchars">return (NULL</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp;<span id="addedchars"> &nbsp;DPRINT1(&quot;Could not create FileObject\n&quot;</span>);
+ &nbsp; &nbsp; &nbsp; &nbsp;return (NULL);
</pre><pre class="diff" id="context"> &nbsp; &nbsp; }
 
</pre><pre class="diff" id="removed">- &nbsp;if (FileObject != NULL)
- &nbsp; &nbsp;{
- &nbsp; &nbsp; &nbsp;DeviceObject = FileObject-&gt;DeviceObject;
- &nbsp; &nbsp;}
- &nbsp;<span id="removedchars">DeviceObject = IoGetAttachedDevice(DeviceObject);</span>
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;/* Choose Device Object */</span>
+ &nbsp; &nbsp;if (FileObject) DeviceObject = FileObject-&gt;DeviceObject;
+ &nbsp; &nbsp;DPRINT(&quot;DeviceObject %x\n&quot;, DeviceObject);
+ &nbsp; &nbsp;
+ &nbsp; &nbsp;/* Set File Object Data */
+ &nbsp; &nbsp;CreatedFileObject-&gt;DeviceObject = DeviceObject; 
+ &nbsp; &nbsp;CreatedFileObject-&gt;Vpb = DeviceObject-&gt;Vpb;
+ &nbsp; &nbsp;CreatedFileObject-&gt;Type = IO_TYPE_FILE;
+ &nbsp; &nbsp;CreatedFileObject-&gt;Flags = FO_STREAM_FILE;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp;<span id="removedchars">DPRINT(&quot;DeviceObject %x\n&quot;, DeviceObject);</span>
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;/* Initialize Lock and Event */</span>
+ &nbsp; &nbsp;KeInitializeEvent(&amp;CreatedFileObject-&gt;Event, NotificationEvent, FALSE);
+ &nbsp; &nbsp;KeInitializeEvent(&amp;CreatedFileObject-&gt;Lock, SynchronizationEvent, TRUE);
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp;if (DeviceObject-&gt;Vpb &amp;&amp; 
- &nbsp; &nbsp; &nbsp;DeviceObject-&gt;Vpb-&gt;DeviceObject)
- &nbsp; &nbsp;{
- &nbsp; &nbsp; &nbsp;CreatedFileObject-&gt;DeviceObject = DeviceObject-&gt;Vpb-&gt;DeviceObject;
- &nbsp; &nbsp;}
- &nbsp;else
- &nbsp; &nbsp;{
- &nbsp; &nbsp; &nbsp;CreatedFileObject-&gt;DeviceObject = DeviceObject; 
- &nbsp; &nbsp;}
- &nbsp;CreatedFileObject-&gt;Vpb = DeviceObject-&gt;Vpb;
- &nbsp;CreatedFileObject-&gt;Type = IO_TYPE_FILE;
- &nbsp;CreatedFileObject-&gt;Flags |= FO_DIRECT_DEVICE_OPEN;
-
- &nbsp;// shouldn't we initialize the lock event, and several other things here too?
- &nbsp;KeInitializeEvent(&amp;CreatedFileObject-&gt;Event, NotificationEvent, FALSE);
- &nbsp;KeInitializeEvent(&amp;CreatedFileObject-&gt;Lock, SynchronizationEvent, TRUE);
-
- &nbsp;<span id="removedchars">return CreatedFileObject;</span>
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;/* Return file */</span>
+ &nbsp; &nbsp;return CreatedFileObject;
</pre><pre class="diff" id="context"> }
 
 /*
@@ -1390,41 +1387,48 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IN ULONG MaxMessageSize,
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IN PLARGE_INTEGER TimeOut)
 {
</pre><pre class="diff" id="removed">- &nbsp; MAILSLOT_CREATE_PARAMETERS Buffer;
</pre><pre class="diff" id="added">+ &nbsp; <span id="addedchars"> </span>MAILSLOT_CREATE_PARAMETERS Buffer;
</pre><pre class="diff" id="context"> &nbsp; &nbsp;
</pre><pre class="diff" id="removed">- &nbsp; DPRINT(&quot;NtCreateMailslotFile(FileHandle %x, DesiredAccess %x, &quot;
- &nbsp; &quot;ObjectAttributes %x ObjectAttributes-&gt;ObjectName-&gt;Buffer %S)\n&quot;,
- &nbsp; FileHandle,DesiredAccess,ObjectAttributes,
- &nbsp; <span id="removedchars">ObjectAttributes-&gt;ObjectName-&gt;Buffer);</span>
</pre><pre class="diff" id="added">+ &nbsp; <span id="addedchars"> DPRINT(&quot;NtCreateMailslotFile(FileHandle %x, DesiredAccess %x, &quot;</span>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;ObjectAttributes %x ObjectAttributes-&gt;ObjectName-&gt;Buffer %S)\n&quot;,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FileHandle,DesiredAccess,ObjectAttributes,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ObjectAttributes-&gt;ObjectName-&gt;Buffer);
+ &nbsp; &nbsp;PAGED_CODE();
</pre><pre class="diff" id="context"> &nbsp; &nbsp;
</pre><pre class="diff" id="removed">- &nbsp; ASSERT_IRQL(PASSIVE_LEVEL);
- &nbsp; 
- &nbsp; if (TimeOut != NULL)
- &nbsp; &nbsp; {
- Buffer.ReadTimeout.QuadPart = TimeOut-&gt;QuadPart;
- Buffer.TimeoutSpecified = TRUE;
- &nbsp; &nbsp; }
- &nbsp; else
- &nbsp; &nbsp; {
- Buffer.TimeoutSpecified = FALSE;
- &nbsp; &nbsp; }
- &nbsp; Buffer.MailslotQuota = MailslotQuota;
- &nbsp; <span id="removedchars">Buffer.MaximumMessageSize = MaxMessageSize;</span>
</pre><pre class="diff" id="added">+ &nbsp; <span id="addedchars"> /* Check for Timeout */</span>
+ &nbsp; &nbsp;if (TimeOut)
+ &nbsp; &nbsp;{
+ &nbsp; &nbsp; &nbsp; &nbsp;/* Enable it */
+ &nbsp; &nbsp; &nbsp; &nbsp;Buffer.TimeoutSpecified = TRUE;
+ &nbsp; &nbsp; &nbsp; &nbsp;
+ &nbsp; &nbsp; &nbsp; &nbsp;/* FIXME: Add SEH */
+ &nbsp; &nbsp; &nbsp; &nbsp;Buffer.ReadTimeout = *TimeOut;
+ &nbsp; &nbsp;}
+ &nbsp; &nbsp;else
+ &nbsp; &nbsp;{
+ &nbsp; &nbsp; &nbsp; &nbsp;/* No timeout */
+ &nbsp; &nbsp; &nbsp; &nbsp;Buffer.TimeoutSpecified = FALSE;
+ &nbsp; &nbsp;}
+ &nbsp; &nbsp;
+ &nbsp; &nbsp;/* Set Settings */
+ &nbsp; &nbsp;Buffer.MailslotQuota = MailslotQuota;
+ &nbsp; &nbsp;Buffer.MaximumMessageSize = MaxMessageSize;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; return IoCreateFile(FileHandle,
- &nbsp; &nbsp; &nbsp; &nbsp; DesiredAccess,
- &nbsp; &nbsp; &nbsp; &nbsp; ObjectAttributes,
- &nbsp; &nbsp; &nbsp; &nbsp; IoStatusBlock,
- &nbsp; &nbsp; &nbsp; &nbsp; NULL,
- &nbsp; &nbsp; &nbsp; &nbsp; FILE_ATTRIBUTE_NORMAL,
- &nbsp; &nbsp; &nbsp; &nbsp; FILE_SHARE_READ | FILE_SHARE_WRITE,
- &nbsp; &nbsp; &nbsp; &nbsp; FILE_CREATE,
- &nbsp; &nbsp; &nbsp; &nbsp; CreateOptions,
- &nbsp; &nbsp; &nbsp; &nbsp; NULL,
- &nbsp; &nbsp; &nbsp; &nbsp; 0,
- &nbsp; &nbsp; &nbsp; &nbsp; CreateFileTypeMailslot,
- &nbsp; &nbsp; &nbsp; &nbsp; (PVOID)&amp;Buffer,
- &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp; 0);</span>
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">/* Call I/O */</span>
+ &nbsp; &nbsp;return IoCreateFile(FileHandle,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DesiredAccess,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ObjectAttributes,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IoStatusBlock,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NULL,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FILE_ATTRIBUTE_NORMAL,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FILE_SHARE_READ | FILE_SHARE_WRITE,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FILE_CREATE,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CreateOptions,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NULL,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CreateFileTypeMailslot,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(PVOID)&amp;Buffer,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0);
</pre><pre class="diff" id="context"> }
 
 NTSTATUS
@@ -1444,45 +1448,52 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ULONG OutboundQuota,
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PLARGE_INTEGER DefaultTimeout)
 {
</pre><pre class="diff" id="removed">- &nbsp;NAMED_PIPE_CREATE_PARAMETERS Buffer;
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;</span>NAMED_PIPE_CREATE_PARAMETERS Buffer;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp;DPRINT(&quot;NtCreateNamedPipeFile(FileHandle %x, DesiredAccess %x, &quot;
- &nbsp;&quot;ObjectAttributes %x ObjectAttributes-&gt;ObjectName-&gt;Buffer %S)\n&quot;,
- &nbsp;FileHandle,DesiredAccess,ObjectAttributes,
- &nbsp;<span id="removedchars">ObjectAttributes-&gt;ObjectName-&gt;Buffer);</span>
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;DPRINT(&quot;NtCreateNamedPipeFile(FileHandle %x, DesiredAccess %x, &quot;</span>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;ObjectAttributes %x ObjectAttributes-&gt;ObjectName-&gt;Buffer %S)\n&quot;,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FileHandle,DesiredAccess,ObjectAttributes,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ObjectAttributes-&gt;ObjectName-&gt;Buffer);
+ &nbsp; &nbsp;PAGED_CODE();
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp;ASSERT_IRQL(PASSIVE_LEVEL);
-
- &nbsp;<span id="removedchars">if (DefaultTimeout != NULL)</span>
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;/* Check for Timeout */</span>
+ &nbsp; &nbsp;if (DefaultTimeout)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp;Buffer.DefaultTimeout.QuadPart = DefaultTimeout-&gt;QuadPart;
- &nbsp; &nbsp; &nbsp;<span id="removedchars">Buffer.TimeoutSpecified = TRUE;</span>
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp;<span id="addedchars"> &nbsp;/* Enable it */</span>
+ &nbsp; &nbsp; &nbsp; &nbsp;Buffer.TimeoutSpecified = TRUE;
+ &nbsp; &nbsp; &nbsp; &nbsp;
+ &nbsp; &nbsp; &nbsp; &nbsp;/* FIXME: Add SEH */
+ &nbsp; &nbsp; &nbsp; &nbsp;Buffer.DefaultTimeout = *DefaultTimeout;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; }
</pre><pre class="diff" id="removed">- &nbsp;else
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;</span>else
</pre><pre class="diff" id="context"> &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp;<span id="removedchars">Buffer.TimeoutSpecified = FALSE;</span>
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp;<span id="addedchars"> &nbsp;/* No timeout */</span>
+ &nbsp; &nbsp; &nbsp; &nbsp;Buffer.TimeoutSpecified = FALSE;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; }
</pre><pre class="diff" id="removed">- &nbsp;Buffer.NamedPipeType = NamedPipeType;
- &nbsp;Buffer.ReadMode = ReadMode;
- &nbsp;Buffer.CompletionMode = CompletionMode;
- &nbsp;Buffer.MaximumInstances = MaximumInstances;
- &nbsp;Buffer.InboundQuota = InboundQuota;
- &nbsp;<span id="removedchars">Buffer.OutboundQuota = OutboundQuota;</span>
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;</span>
+ &nbsp; &nbsp;/* Set Settings */
+ &nbsp; &nbsp;Buffer.NamedPipeType = NamedPipeType;
+ &nbsp; &nbsp;Buffer.ReadMode = ReadMode;
+ &nbsp; &nbsp;Buffer.CompletionMode = CompletionMode;
+ &nbsp; &nbsp;Buffer.MaximumInstances = MaximumInstances;
+ &nbsp; &nbsp;Buffer.InboundQuota = InboundQuota;
+ &nbsp; &nbsp;Buffer.OutboundQuota = OutboundQuota;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp;return IoCreateFile(FileHandle,
- &nbsp; &nbsp; &nbsp; &nbsp;DesiredAccess,
- &nbsp; &nbsp; &nbsp; &nbsp;ObjectAttributes,
- &nbsp; &nbsp; &nbsp; &nbsp;IoStatusBlock,
- &nbsp; &nbsp; &nbsp; &nbsp;NULL,
- &nbsp; &nbsp; &nbsp; &nbsp;FILE_ATTRIBUTE_NORMAL,
- &nbsp; &nbsp; &nbsp; &nbsp;ShareAccess,
- &nbsp; &nbsp; &nbsp; &nbsp;CreateDisposition,
- &nbsp; &nbsp; &nbsp; &nbsp;CreateOptions,
- &nbsp; &nbsp; &nbsp; &nbsp;NULL,
- &nbsp; &nbsp; &nbsp; &nbsp;0,
- &nbsp; &nbsp; &nbsp; &nbsp;CreateFileTypeNamedPipe,
- &nbsp; &nbsp; &nbsp; &nbsp;(PVOID)&amp;Buffer,
- &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp;0);</span>
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">/* Call I/O */</span>
+ &nbsp; &nbsp;return IoCreateFile(FileHandle,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DesiredAccess,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ObjectAttributes,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IoStatusBlock,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NULL,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FILE_ATTRIBUTE_NORMAL,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ShareAccess,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CreateDisposition,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CreateOptions,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NULL,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CreateFileTypeNamedPipe,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(PVOID)&amp;Buffer,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0);
</pre><pre class="diff" id="context"> }
 
 /*
@@ -1513,8 +1524,8 @@
</pre><pre class="diff" id="context"> STDCALL
 NtFlushWriteBuffer(VOID)
 {
</pre><pre class="diff" id="removed">- &nbsp;KeFlushWriteBuffer();
- &nbsp;<span id="removedchars">return STATUS_SUCCESS</span>;
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;KeFlushWriteBuffer()</span>;
+ &nbsp; &nbsp;return STATUS_SUCCESS;
</pre><pre class="diff" id="context"> }
 
 /*
@@ -1960,36 +1971,36 @@
</pre><pre class="diff" id="context"> NtQueryAttributesFile(IN POBJECT_ATTRIBUTES ObjectAttributes,
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OUT PFILE_BASIC_INFORMATION FileInformation)
 {
</pre><pre class="diff" id="removed">- &nbsp;IO_STATUS_BLOCK IoStatusBlock;
- &nbsp;HANDLE FileHandle;
- &nbsp;<span id="removedchars">NTSTATUS Status</span>;
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;IO_STATUS_BLOCK IoStatusBlock</span>;
+ &nbsp; &nbsp;HANDLE FileHandle;
+ &nbsp; &nbsp;NTSTATUS Status;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp;/* Open the file */
- &nbsp;Status = ZwOpenFile (&amp;FileHandle,
- &nbsp; &nbsp; &nbsp; &nbsp; SYNCHRONIZE | FILE_READ_ATTRIBUTES,
- &nbsp; &nbsp; &nbsp; &nbsp; ObjectAttributes,
- &nbsp; &nbsp; &nbsp; &nbsp; &amp;IoStatusBlock,
- &nbsp; &nbsp; &nbsp; &nbsp; FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
- &nbsp; &nbsp; &nbsp; &nbsp; FILE_SYNCHRONOUS_IO_NONALERT);
- &nbsp;<span id="removedchars">if (!NT_SUCCESS (Status))</span>
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;/* Open the file */</span>
+ &nbsp; &nbsp;Status = ZwOpenFile(&amp;FileHandle,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SYNCHRONIZE | FILE_READ_ATTRIBUTES,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ObjectAttributes,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&amp;IoStatusBlock,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FILE_SYNCHRONOUS_IO_NONALERT);
+ &nbsp; &nbsp;if (!NT_SUCCESS (Status))
</pre><pre class="diff" id="context"> &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp;DPRINT (&quot;ZwOpenFile() failed (Status %lx)\n&quot;, Status);
- &nbsp; &nbsp; &nbsp;<span id="removedchars">return Status</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp;<span id="addedchars"> &nbsp;DPRINT (&quot;ZwOpenFile() failed (Status %lx)\n&quot;, Status)</span>;
+ &nbsp; &nbsp; &nbsp; &nbsp;return Status;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; }
 
</pre><pre class="diff" id="removed">- &nbsp;/* Get file attributes */
- &nbsp;Status = ZwQueryInformationFile (FileHandle,
- &nbsp; &nbsp; &nbsp; &amp;IoStatusBlock,
- &nbsp; &nbsp; &nbsp; FileInformation,
- &nbsp; &nbsp; &nbsp; sizeof(FILE_BASIC_INFORMATION),
- &nbsp; &nbsp; &nbsp; FileBasicInformation);
- &nbsp;ZwClose (FileHandle);
- &nbsp;<span id="removedchars">if (!NT_SUCCESS (Status))</span>
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;/* Get file attributes */</span>
+ &nbsp; &nbsp;Status = ZwQueryInformationFile(FileHandle,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&amp;IoStatusBlock,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FileInformation,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sizeof(FILE_BASIC_INFORMATION),
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FileBasicInformation);
+ &nbsp; &nbsp;if (!NT_SUCCESS (Status))
</pre><pre class="diff" id="context"> &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp;DPRINT (&quot;ZwQueryInformationFile() failed (Status %lx)\n&quot;, Status);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp;<span id="addedchars"> &nbsp;</span>DPRINT (&quot;ZwQueryInformationFile() failed (Status %lx)\n&quot;, Status);
</pre><pre class="diff" id="context"> &nbsp; &nbsp; }
 
</pre><pre class="diff" id="removed">- &nbsp;<span id="removedchars">return Status</span>;
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;ZwClose(FileHandle)</span>;
+ &nbsp; &nbsp;return Status;
</pre><pre class="diff" id="context"> }
 
 /*
@@ -2184,36 +2195,36 @@
</pre><pre class="diff" id="context"> NtQueryFullAttributesFile(IN POBJECT_ATTRIBUTES ObjectAttributes,
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OUT PFILE_NETWORK_OPEN_INFORMATION FileInformation)
 {
</pre><pre class="diff" id="removed">- &nbsp;IO_STATUS_BLOCK IoStatusBlock;
- &nbsp;HANDLE FileHandle;
- &nbsp;<span id="removedchars">NTSTATUS Status</span>;
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;IO_STATUS_BLOCK IoStatusBlock</span>;
+ &nbsp; &nbsp;HANDLE FileHandle;
+ &nbsp; &nbsp;NTSTATUS Status;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp;/* Open the file */
- &nbsp;Status = ZwOpenFile (&amp;FileHandle,
- &nbsp; &nbsp; &nbsp; &nbsp; SYNCHRONIZE | FILE_READ_ATTRIBUTES,
- &nbsp; &nbsp; &nbsp; &nbsp; ObjectAttributes,
- &nbsp; &nbsp; &nbsp; &nbsp; &amp;IoStatusBlock,
- &nbsp; &nbsp; &nbsp; &nbsp; FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
- &nbsp; &nbsp; &nbsp; &nbsp; FILE_SYNCHRONOUS_IO_NONALERT);
- &nbsp;<span id="removedchars">if (!NT_SUCCESS (Status))</span>
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;/* Open the file */</span>
+ &nbsp; &nbsp;Status = ZwOpenFile(&amp;FileHandle,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SYNCHRONIZE | FILE_READ_ATTRIBUTES,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ObjectAttributes,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&amp;IoStatusBlock,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FILE_SYNCHRONOUS_IO_NONALERT);
+ &nbsp; &nbsp;if (!NT_SUCCESS (Status))
</pre><pre class="diff" id="context"> &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp;DPRINT (&quot;ZwOpenFile() failed (Status %lx)\n&quot;, Status);
- &nbsp; &nbsp; &nbsp;<span id="removedchars">return Status</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp;<span id="addedchars"> &nbsp;DPRINT (&quot;ZwOpenFile() failed (Status %lx)\n&quot;, Status)</span>;
+ &nbsp; &nbsp; &nbsp; &nbsp;return Status;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; }
 
</pre><pre class="diff" id="removed">- &nbsp;/* Get file attributes */
- &nbsp;Status = ZwQueryInformationFile (FileHandle,
- &nbsp; &nbsp; &nbsp; &amp;IoStatusBlock,
- &nbsp; &nbsp; &nbsp; FileInformation,
- &nbsp; &nbsp; &nbsp; sizeof(FILE_NETWORK_OPEN_INFORMATION),
- &nbsp; &nbsp; &nbsp; FileNetworkOpenInformation);
- &nbsp;ZwClose (FileHandle);
- &nbsp;<span id="removedchars">if (!NT_SUCCESS (Status))</span>
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;/* Get file attributes */</span>
+ &nbsp; &nbsp;Status = ZwQueryInformationFile(FileHandle,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&amp;IoStatusBlock,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FileInformation,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sizeof(FILE_NETWORK_OPEN_INFORMATION),
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FileNetworkOpenInformation);
+ &nbsp; &nbsp;if (!NT_SUCCESS (Status))
</pre><pre class="diff" id="context"> &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp;DPRINT (&quot;ZwQueryInformationFile() failed (Status %lx)\n&quot;, Status);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp;<span id="addedchars"> &nbsp;</span>DPRINT (&quot;ZwQueryInformationFile() failed (Status %lx)\n&quot;, Status);
</pre><pre class="diff" id="context"> &nbsp; &nbsp; }
 
</pre><pre class="diff" id="removed">- &nbsp;<span id="removedchars">return Status</span>;
</pre><pre class="diff" id="added">+ &nbsp;<span id="addedchars"> &nbsp;ZwClose (FileHandle)</span>;
+ &nbsp; &nbsp;return Status;
</pre><pre class="diff" id="context"> }
 
 /*
</pre>
</div>

</body>
</html>