Author: ekohl
Date: Sat May 6 19:37:40 2006
New Revision: 21813
URL:
http://svn.reactos.ru/svn/reactos?rev=21813&view=rev
Log:
The MSFS_FCB struct is actually a CCB (Context Control Block) instead of an FCB (File
Control Block). Rename it accordingly and store pointers to it in
FileObject->FsContext2 instead of FileObject->FsContext.
Modified:
trunk/reactos/drivers/filesystems/ms/create.c
trunk/reactos/drivers/filesystems/ms/finfo.c
trunk/reactos/drivers/filesystems/ms/fsctrl.c
trunk/reactos/drivers/filesystems/ms/msfs.h
trunk/reactos/drivers/filesystems/ms/rw.c
Modified: trunk/reactos/drivers/filesystems/ms/create.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/filesystems/ms/crea…
==============================================================================
--- trunk/reactos/drivers/filesystems/ms/create.c (original)
+++ trunk/reactos/drivers/filesystems/ms/create.c Sat May 6 19:37:40 2006
@@ -25,7 +25,7 @@
PFILE_OBJECT FileObject;
PMSFS_DEVICE_EXTENSION DeviceExtension;
PMSFS_MAILSLOT Mailslot;
- PMSFS_FCB Fcb;
+ PMSFS_CCB Ccb;
PMSFS_MAILSLOT current = NULL;
PLIST_ENTRY current_entry;
KIRQL oldIrql;
@@ -38,8 +38,8 @@
DPRINT("Mailslot name: %wZ\n", &FileObject->FileName);
- Fcb = ExAllocatePool(NonPagedPool, sizeof(MSFS_FCB));
- if (Fcb == NULL)
+ Ccb = ExAllocatePool(NonPagedPool, sizeof(MSFS_CCB));
+ if (Ccb == NULL)
{
Irp->IoStatus.Status = STATUS_NO_MEMORY;
Irp->IoStatus.Information = 0;
@@ -67,7 +67,7 @@
if (current_entry == &DeviceExtension->MailslotListHead)
{
- ExFreePool(Fcb);
+ ExFreePool(Ccb);
KeUnlockMutex(&DeviceExtension->MailslotListLock);
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
@@ -80,17 +80,17 @@
Mailslot = current;
- KeAcquireSpinLock(&Mailslot->FcbListLock, &oldIrql);
- InsertTailList(&Mailslot->FcbListHead, &Fcb->FcbListEntry);
- KeReleaseSpinLock(&Mailslot->FcbListLock, oldIrql);
+ KeAcquireSpinLock(&Mailslot->CcbListLock, &oldIrql);
+ InsertTailList(&Mailslot->CcbListHead, &Ccb->CcbListEntry);
+ KeReleaseSpinLock(&Mailslot->CcbListLock, oldIrql);
Mailslot->ReferenceCount++;
- Fcb->Mailslot = Mailslot;
+ Ccb->Mailslot = Mailslot;
KeUnlockMutex(&DeviceExtension->MailslotListLock);
- FileObject->FsContext = Fcb;
+ FileObject->FsContext2 = Ccb;
FileObject->Flags |= FO_MAILSLOT;
Irp->IoStatus.Status = STATUS_SUCCESS;
@@ -110,7 +110,7 @@
PFILE_OBJECT FileObject;
PMSFS_DEVICE_EXTENSION DeviceExtension;
PMSFS_MAILSLOT Mailslot;
- PMSFS_FCB Fcb;
+ PMSFS_CCB Ccb;
KIRQL oldIrql;
PLIST_ENTRY current_entry;
PMSFS_MAILSLOT current;
@@ -153,8 +153,8 @@
RtlCopyUnicodeString(&Mailslot->Name, &FileObject->FileName);
- Fcb = ExAllocatePool(NonPagedPool, sizeof(MSFS_FCB));
- if (Fcb == NULL)
+ Ccb = ExAllocatePool(NonPagedPool, sizeof(MSFS_CCB));
+ if (Ccb == NULL)
{
ExFreePool(Mailslot);
@@ -167,8 +167,8 @@
}
Mailslot->ReferenceCount = 0;
- InitializeListHead(&Mailslot->FcbListHead);
- KeInitializeSpinLock(&Mailslot->FcbListLock);
+ InitializeListHead(&Mailslot->CcbListHead);
+ KeInitializeSpinLock(&Mailslot->CcbListLock);
Mailslot->MaxMessageSize = Buffer->MaximumMessageSize;
Mailslot->MessageCount = 0;
@@ -209,17 +209,17 @@
&Mailslot->MailslotListEntry);
}
- KeAcquireSpinLock(&Mailslot->FcbListLock, &oldIrql);
- InsertTailList(&Mailslot->FcbListHead, &Fcb->FcbListEntry);
- KeReleaseSpinLock(&Mailslot->FcbListLock, oldIrql);
+ KeAcquireSpinLock(&Mailslot->CcbListLock, &oldIrql);
+ InsertTailList(&Mailslot->CcbListHead, &Ccb->CcbListEntry);
+ KeReleaseSpinLock(&Mailslot->CcbListLock, oldIrql);
Mailslot->ReferenceCount++;
- Mailslot->ServerFcb = Fcb;
- Fcb->Mailslot = Mailslot;
+ Mailslot->ServerCcb = Ccb;
+ Ccb->Mailslot = Mailslot;
KeUnlockMutex(&DeviceExtension->MailslotListLock);
- FileObject->FsContext = Fcb;
+ FileObject->FsContext2 = Ccb;
FileObject->Flags |= FO_MAILSLOT;
Irp->IoStatus.Status = STATUS_SUCCESS;
@@ -239,7 +239,7 @@
PFILE_OBJECT FileObject;
PMSFS_DEVICE_EXTENSION DeviceExtension;
PMSFS_MAILSLOT Mailslot;
- PMSFS_FCB Fcb;
+ PMSFS_CCB Ccb;
PMSFS_MESSAGE Message;
KIRQL oldIrql;
@@ -263,13 +263,13 @@
return(STATUS_SUCCESS);
}
- Fcb = FileObject->FsContext;
- Mailslot = Fcb->Mailslot;
+ Ccb = FileObject->FsContext2;
+ Mailslot = Ccb->Mailslot;
DPRINT("Mailslot name: %wZ\n", &Mailslot->Name);
Mailslot->ReferenceCount--;
- if (Mailslot->ServerFcb == Fcb)
+ if (Mailslot->ServerCcb == Ccb)
{
/* delete all messages from message-list */
KeAcquireSpinLock(&Mailslot->MessageListLock, &oldIrql);
@@ -285,14 +285,14 @@
Mailslot->MessageCount = 0;
KeReleaseSpinLock(&Mailslot->MessageListLock, oldIrql);
- Mailslot->ServerFcb = NULL;
- }
-
- KeAcquireSpinLock(&Mailslot->FcbListLock, &oldIrql);
- RemoveEntryList(&Fcb->FcbListEntry);
- KeReleaseSpinLock(&Mailslot->FcbListLock, oldIrql);
- ExFreePool(Fcb);
- FileObject->FsContext = NULL;
+ Mailslot->ServerCcb = NULL;
+ }
+
+ KeAcquireSpinLock(&Mailslot->CcbListLock, &oldIrql);
+ RemoveEntryList(&Ccb->CcbListEntry);
+ KeReleaseSpinLock(&Mailslot->CcbListLock, oldIrql);
+ ExFreePool(Ccb);
+ FileObject->FsContext2 = NULL;
if (Mailslot->ReferenceCount == 0)
{
Modified: trunk/reactos/drivers/filesystems/ms/finfo.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/filesystems/ms/finf…
==============================================================================
--- trunk/reactos/drivers/filesystems/ms/finfo.c (original)
+++ trunk/reactos/drivers/filesystems/ms/finfo.c Sat May 6 19:37:40 2006
@@ -18,7 +18,7 @@
/* FUNCTIONS *****************************************************************/
static NTSTATUS
-MsfsQueryMailslotInformation(PMSFS_FCB Fcb,
+MsfsQueryMailslotInformation(PMSFS_CCB Ccb,
PFILE_MAILSLOT_QUERY_INFORMATION Buffer,
PULONG BufferLength)
{
@@ -28,7 +28,7 @@
if (*BufferLength < sizeof(FILE_MAILSLOT_QUERY_INFORMATION))
return(STATUS_BUFFER_OVERFLOW);
- Mailslot = Fcb->Mailslot;
+ Mailslot = Ccb->Mailslot;
Buffer->MaximumMessageSize = Mailslot->MaxMessageSize;
Buffer->ReadTimeout = Mailslot->TimeOut;
@@ -37,7 +37,7 @@
Buffer->MessagesAvailable = Mailslot->MessageCount;
if (Mailslot->MessageCount == 0)
{
- Buffer->NextMessageSize = 0;
+ Buffer->NextMessageSize = MAILSLOT_NO_MESSAGE;
}
else
{
@@ -53,14 +53,14 @@
static NTSTATUS
-MsfsSetMailslotInformation(PMSFS_FCB Fcb,
+MsfsSetMailslotInformation(PMSFS_CCB Ccb,
PFILE_MAILSLOT_SET_INFORMATION Buffer,
PULONG BufferLength)
{
if (*BufferLength < sizeof(FILE_MAILSLOT_SET_INFORMATION))
return(STATUS_BUFFER_OVERFLOW);
- Fcb->Mailslot->TimeOut = *Buffer->ReadTimeout;
+ Ccb->Mailslot->TimeOut = *Buffer->ReadTimeout;
return(STATUS_SUCCESS);
}
@@ -74,7 +74,7 @@
FILE_INFORMATION_CLASS FileInformationClass;
PFILE_OBJECT FileObject;
PMSFS_DEVICE_EXTENSION DeviceExtension;
- PMSFS_FCB Fcb;
+ PMSFS_CCB Ccb;
PMSFS_MAILSLOT Mailslot;
PVOID SystemBuffer;
ULONG BufferLength;
@@ -86,13 +86,13 @@
FileInformationClass = IoStack->Parameters.QueryFile.FileInformationClass;
DeviceExtension = DeviceObject->DeviceExtension;
FileObject = IoStack->FileObject;
- Fcb = (PMSFS_FCB)FileObject->FsContext;
- Mailslot = Fcb->Mailslot;
+ Ccb = (PMSFS_CCB)FileObject->FsContext2;
+ Mailslot = Ccb->Mailslot;
DPRINT("Mailslot name: %wZ\n", &Mailslot->Name);
/* querying information is not permitted on client side */
- if (Fcb->Mailslot->ServerFcb != Fcb)
+ if (Ccb->Mailslot->ServerCcb != Ccb)
{
Status = STATUS_ACCESS_DENIED;
@@ -111,7 +111,7 @@
switch (FileInformationClass)
{
case FileMailslotQueryInformation:
- Status = MsfsQueryMailslotInformation(Fcb,
+ Status = MsfsQueryMailslotInformation(Ccb,
SystemBuffer,
&BufferLength);
break;
@@ -139,7 +139,7 @@
PIO_STACK_LOCATION IoStack;
FILE_INFORMATION_CLASS FileInformationClass;
PFILE_OBJECT FileObject;
- PMSFS_FCB Fcb;
+ PMSFS_CCB Ccb;
PMSFS_MAILSLOT Mailslot;
PVOID SystemBuffer;
ULONG BufferLength;
@@ -150,13 +150,13 @@
IoStack = IoGetCurrentIrpStackLocation (Irp);
FileInformationClass = IoStack->Parameters.QueryFile.FileInformationClass;
FileObject = IoStack->FileObject;
- Fcb = (PMSFS_FCB)FileObject->FsContext;
- Mailslot = Fcb->Mailslot;
+ Ccb = (PMSFS_CCB)FileObject->FsContext2;
+ Mailslot = Ccb->Mailslot;
DPRINT("Mailslot name: %wZ\n", &Mailslot->Name);
/* setting information is not permitted on client side */
- if (Fcb->Mailslot->ServerFcb != Fcb)
+ if (Ccb->Mailslot->ServerCcb != Ccb)
{
Status = STATUS_ACCESS_DENIED;
@@ -178,7 +178,7 @@
switch (FileInformationClass)
{
case FileMailslotSetInformation:
- Status = MsfsSetMailslotInformation(Fcb,
+ Status = MsfsSetMailslotInformation(Ccb,
SystemBuffer,
&BufferLength);
break;
Modified: trunk/reactos/drivers/filesystems/ms/fsctrl.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/filesystems/ms/fsct…
==============================================================================
--- trunk/reactos/drivers/filesystems/ms/fsctrl.c (original)
+++ trunk/reactos/drivers/filesystems/ms/fsctrl.c Sat May 6 19:37:40 2006
@@ -24,15 +24,15 @@
PIO_STACK_LOCATION IoStack;
PFILE_OBJECT FileObject;
PMSFS_MAILSLOT Mailslot;
- PMSFS_FCB Fcb;
+ PMSFS_CCB Ccb;
NTSTATUS Status;
DPRINT1("MsfsFileSystemControl(DeviceObject %p Irp %p)\n", DeviceObject,
Irp);
IoStack = IoGetCurrentIrpStackLocation(Irp);
FileObject = IoStack->FileObject;
- Fcb = FileObject->FsContext;
- Mailslot = Fcb->Mailslot;
+ Ccb = FileObject->FsContext2;
+ Mailslot = Ccb->Mailslot;
DPRINT1("Mailslot name: %wZ\n", &Mailslot->Name);
Modified: trunk/reactos/drivers/filesystems/ms/msfs.h
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/filesystems/ms/msfs…
==============================================================================
--- trunk/reactos/drivers/filesystems/ms/msfs.h (original)
+++ trunk/reactos/drivers/filesystems/ms/msfs.h Sat May 6 19:37:40 2006
@@ -4,7 +4,7 @@
#include <ntifs.h>
#include <ndk/ntndk.h>
-/*
+/*
* FIXME: GCC doesn't have a working option for defaulting to a calling
* convention. It will always default to cdecl. The MS DDK was designed
* for compilers which support this option, and thus some of their headers
@@ -30,9 +30,9 @@
{
UNICODE_STRING Name;
LIST_ENTRY MailslotListEntry;
- KSPIN_LOCK FcbListLock;
- LIST_ENTRY FcbListHead;
- struct _MSFS_FCB *ServerFcb;
+ KSPIN_LOCK CcbListLock;
+ LIST_ENTRY CcbListHead;
+ struct _MSFS_CCB *ServerCcb;
ULONG ReferenceCount;
LARGE_INTEGER TimeOut;
KEVENT MessageEvent;
@@ -42,11 +42,11 @@
LIST_ENTRY MessageListHead;
} MSFS_MAILSLOT, *PMSFS_MAILSLOT;
-typedef struct _MSFS_FCB
+typedef struct _MSFS_CCB
{
- LIST_ENTRY FcbListEntry;
+ LIST_ENTRY CcbListEntry;
PMSFS_MAILSLOT Mailslot;
-} MSFS_FCB, *PMSFS_FCB;
+} MSFS_CCB, *PMSFS_CCB;
typedef struct _MSFS_MESSAGE
{
Modified: trunk/reactos/drivers/filesystems/ms/rw.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/filesystems/ms/rw.c…
==============================================================================
--- trunk/reactos/drivers/filesystems/ms/rw.c (original)
+++ trunk/reactos/drivers/filesystems/ms/rw.c Sat May 6 19:37:40 2006
@@ -24,7 +24,7 @@
PIO_STACK_LOCATION IoStack;
PFILE_OBJECT FileObject;
PMSFS_MAILSLOT Mailslot;
- PMSFS_FCB Fcb;
+ PMSFS_CCB Ccb;
PMSFS_MESSAGE Message;
KIRQL oldIrql;
ULONG Length;
@@ -36,13 +36,13 @@
IoStack = IoGetCurrentIrpStackLocation (Irp);
FileObject = IoStack->FileObject;
- Fcb = (PMSFS_FCB)FileObject->FsContext;
- Mailslot = Fcb->Mailslot;
+ Ccb = (PMSFS_CCB)FileObject->FsContext2;
+ Mailslot = Ccb->Mailslot;
DPRINT("MailslotName: %wZ\n", &Mailslot->Name);
/* reading is not permitted on client side */
- if (Fcb->Mailslot->ServerFcb != Fcb)
+ if (Ccb->Mailslot->ServerCcb != Ccb)
{
Irp->IoStatus.Status = STATUS_ACCESS_DENIED;
Irp->IoStatus.Information = 0;
@@ -100,7 +100,7 @@
PIO_STACK_LOCATION IoStack;
PFILE_OBJECT FileObject;
PMSFS_MAILSLOT Mailslot;
- PMSFS_FCB Fcb;
+ PMSFS_CCB Ccb;
PMSFS_MESSAGE Message;
KIRQL oldIrql;
ULONG Length;
@@ -110,13 +110,13 @@
IoStack = IoGetCurrentIrpStackLocation (Irp);
FileObject = IoStack->FileObject;
- Fcb = (PMSFS_FCB)FileObject->FsContext;
- Mailslot = Fcb->Mailslot;
+ Ccb = (PMSFS_CCB)FileObject->FsContext2;
+ Mailslot = Ccb->Mailslot;
DPRINT("MailslotName: %wZ\n", &Mailslot->Name);
/* writing is not permitted on server side */
- if (Fcb->Mailslot->ServerFcb == Fcb)
+ if (Ccb->Mailslot->ServerCcb == Ccb)
{
Irp->IoStatus.Status = STATUS_ACCESS_DENIED;
Irp->IoStatus.Information = 0;