Коммит 126768af создал по автору David Welch's avatar David Welch
Просмотр файлов

Lots of changes to the kernel

svn path=/trunk/; revision=527
владелец 0deeaa0d
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
In no particular order
Rex Jolliff (rex@lvcablemodem.com)
Boudewijn Dekker (ariadne@xs4all.nl)
Eric Kohl (ekohl@abo.rhein-zeitung.de)
Emanuele Aliberti (ea@iol.it)
David Welch (welch@cwcom.net)
Iwan Fatahi (i_fatahi@hotmail.com)
Robert Bergkvist (fragdance@hotmail.com)
Victor Kirhenshtein (sauros@iname.com)
Jason Filby (jasonfilby@yahoo.com)
1. Build environment
To build the system you need either mingw32 installed on Windows or a
mingw32 cross compiler running on unix.
2. Building
To build from Windows run 'make -fmakefile.dos'. To build from unix, edit
rules.mak and change the PREFIX variable to the correct value for your
cross-compiler, then run 'make'.
3. Installation
Installation isn't yet automated, sorry. The system can only be installed on
the first partition which must be formatted for DOS. Set up a directory
structure like the following
make directories C:\reactos,C:\reactos\system,C:\reactos\system\drivers
Copy apps/shell/shell.exe to C:\reactos\system
Copy services/dd/keyboard/keyboard.sys to C:\reactos\system\drivers
Copy services/dd/blue/blue.sys to C:\reactos\system\drivers
The system can only be started from DOS. Copy the following files,
services/dd/ide/ide.sys, services/fs/vfat/vfatfsd.sys and
loaders/dos/loadros.com, to a suitable directory. The system can then be
booted with the command 'loadros.com ide.sys vfatfsd.sys'.
About Reactos
1. What is Reactos
A project aiming to make an approximate clone of Windows NT, compatible
with most Windows applications.
The project has a website at http://www.sid-dis.com/reactos
2. Building Reactos
See the INSTALL file for more details.
3. More information
See the doc subdirectory for some sparse notes
4. Who is responsible
See the CREDITS file
5. Recent developments
See the NEWS file
...@@ -25,7 +25,8 @@ void main(int argc, char* argv[]) ...@@ -25,7 +25,8 @@ void main(int argc, char* argv[])
AllocConsole(); AllocConsole();
InputHandle = GetStdHandle(STD_INPUT_HANDLE); InputHandle = GetStdHandle(STD_INPUT_HANDLE);
OutputHandle = GetStdHandle(STD_OUTPUT_HANDLE); OutputHandle = GetStdHandle(STD_OUTPUT_HANDLE);
printf("GetCommandLineA() %s\n",GetCommandLineA());
debug_printf("GetCommandLineA() %s\n",GetCommandLineA()); debug_printf("GetCommandLineA() %s\n",GetCommandLineA());
for (i=0; i<argc; i++) for (i=0; i<argc; i++)
{ {
......
/*
*
*/
int main(int argc, char* argv[])
{
}
APC
Asynchronous procedure call
An APC is a Kernel-defined control object representing a procedure
that is called asynchronously. APCs are thread-context dependent; that
is, they are queued to a particular thread for execution.
There are three different kinds of APCs in NT:
User APCs are used by certain asynchronous NT system services to allow
user-mode applications or protected subsystems to synchronize the
execution of a thread with the completion of an operation or the
occurrence of an event such as a timers expiration. User APCs are, by
default, disabled. That is, they are queued to the user-mode thread,
but they are not executed except at well-defined points in the
program. Specifically, they can only be executed when an application
or protected subsystem has called a wait service and has enabled
alerts to occur, or if it has called the test-alert service.
Kernel APCs are normal kernel-mode APCs. They are much like a normal
user APC except that they are executable by default. That is, they are
enabled except when the thread is already executing a Kernel APC.
(Note that a special Kernel APC always preempts these.)
Special Kernel APCs cannot be blocked except by running at a raised
IRQL. They are executed at APC_LEVEL IRQL (see IDT), in kernel mode.
These types of APCs are used by the system to force a thread to
execute a procedure in the threads context. An example of this is I/O
completion: the I/O Manager needs to get back into the context of the
original requestor of the I/O operation so that it can copy buffers,
and so forth. In order to do this, the I/O Manager must be able to
access the virtual address space of the thread/process, and the most
efficient way to complete the operation is to be in the calling
threads context.
/* /*
** File: keyboard.c * COPYRIGHT: See COPYING in the top level directory
** Description: ReactOS keyboard driver * PROJECT: ReactOS kernel
** Current version: 0.0.4 * FILE: services/dd/keyboard/keyboard.c
** Last modified: 28 May 1998 * PURPOSE: Keyboard driver
** * PROGRAMMER: Victor Kirhenshtein (sauros@iname.com)
* 31/08/98: Changed to interrupt driven model * Jason Filby (jasonfilby@yahoo.com);
* 29/06/98: NT interface by David Welch (welch@mcmail.com) */
*
** Written by Victor Kirhenshtein (sauros@iname.com) /* INCLUDES ****************************************************************/
** Initial attempt by Jason Filby
**
** Some parts of this code are based on Linux keyboard driver
** written by Johan Myreen.
**
**
** KNOWN BUGS:
**
** * Repeat counter isn't supported
**
*/
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <internal/mmhal.h> #include <internal/mmhal.h>
...@@ -32,6 +21,8 @@ ...@@ -32,6 +21,8 @@
#include "keyboard.h" #include "keyboard.h"
/* GLOBALS *******************************************************************/
/* /*
* Driver data * Driver data
*/ */
...@@ -43,7 +34,6 @@ static int extKey; ...@@ -43,7 +34,6 @@ static int extKey;
static BYTE ledStatus; static BYTE ledStatus;
static BYTE capsDown,numDown,scrollDown; static BYTE capsDown,numDown,scrollDown;
static DWORD ctrlKeyState; static DWORD ctrlKeyState;
static KSPIN_LOCK kbdBufferLock;
static PKINTERRUPT KbdInterrupt; static PKINTERRUPT KbdInterrupt;
static KDPC KbdDpc; static KDPC KbdDpc;
...@@ -119,12 +109,12 @@ static const BYTE asciiTable4[37]= ...@@ -119,12 +109,12 @@ static const BYTE asciiTable4[37]=
'{', '|', '}', '"' '{', '|', '}', '"'
}; };
/* FUNCTIONS *****************************************************************/
static void KbdWrite(int addr,BYTE data)
/* /*
* Write data to keyboard * FUNCTION: Write data to keyboard
*/ */
static void KbdWrite(int addr,BYTE data)
{ {
BYTE status; BYTE status;
...@@ -135,12 +125,10 @@ static void KbdWrite(int addr,BYTE data) ...@@ -135,12 +125,10 @@ static void KbdWrite(int addr,BYTE data)
outb_p(addr,data); outb_p(addr,data);
} }
static int KbdReadData(void)
/* /*
* Read data from port 0x60 * FUNCTION: Read data from port 0x60
*/ */
static int KbdReadData(void)
{ {
int i; int i;
BYTE status,data; BYTE status,data;
...@@ -371,7 +359,7 @@ static BYTE VirtualToAscii(WORD keyCode,BOOL isDown) ...@@ -371,7 +359,7 @@ static BYTE VirtualToAscii(WORD keyCode,BOOL isDown)
return asciiTable2[keyCode-VK_NUMPAD0]; return asciiTable2[keyCode-VK_NUMPAD0];
if ((keyCode>=186)&&(keyCode<=222)) if ((keyCode>=186)&&(keyCode<=222))
{ {
if (ctrlKeyState & SHIFT_PRESSED) if (ctrlKeyState & SHIFT_PRESSED)
return asciiTable4[keyCode-186]; return asciiTable4[keyCode-186];
else else
...@@ -525,7 +513,7 @@ static BOOLEAN KeyboardHandler(PKINTERRUPT Interrupt, PVOID Context) ...@@ -525,7 +513,7 @@ static BOOLEAN KeyboardHandler(PKINTERRUPT Interrupt, PVOID Context)
if (keysInBuffer==KBD_BUFFER_SIZE) // Buffer is full if (keysInBuffer==KBD_BUFFER_SIZE) // Buffer is full
{ {
extKey=0; extKey=0;
return FALSE; return(TRUE);
} }
kbdBuffer[bufHead].bKeyDown=isDown; kbdBuffer[bufHead].bKeyDown=isDown;
kbdBuffer[bufHead].wRepeatCount=1; kbdBuffer[bufHead].wRepeatCount=1;
...@@ -541,7 +529,6 @@ static BOOLEAN KeyboardHandler(PKINTERRUPT Interrupt, PVOID Context) ...@@ -541,7 +529,6 @@ static BOOLEAN KeyboardHandler(PKINTERRUPT Interrupt, PVOID Context)
bufHead&=KBD_WRAP_MASK; // Modulo KBD_BUFFER_SIZE bufHead&=KBD_WRAP_MASK; // Modulo KBD_BUFFER_SIZE
keysInBuffer++; keysInBuffer++;
extKey=0; extKey=0;
return TRUE; return TRUE;
} }
...@@ -593,16 +580,13 @@ static int InitializeKeyboard(void) ...@@ -593,16 +580,13 @@ static int InitializeKeyboard(void)
return 0; return 0;
} }
/* /*
* Read data from keyboard buffer * Read data from keyboard buffer
*/ */
BOOLEAN KbdSynchronizeRoutine(PVOID Context) BOOLEAN KbdSynchronizeRoutine(PVOID Context)
{ {
PIRP Irp = (PIRP)Context; PIRP Irp = (PIRP)Context;
KEY_EVENT_RECORD* rec = (KEY_EVENT_RECORD *) KEY_EVENT_RECORD* rec = (KEY_EVENT_RECORD *)Irp->AssociatedIrp.SystemBuffer;
Irp->AssociatedIrp.SystemBuffer;
PIO_STACK_LOCATION stk = IoGetCurrentIrpStackLocation(Irp); PIO_STACK_LOCATION stk = IoGetCurrentIrpStackLocation(Irp);
ULONG NrToRead = stk->Parameters.Read.Length/sizeof(KEY_EVENT_RECORD); ULONG NrToRead = stk->Parameters.Read.Length/sizeof(KEY_EVENT_RECORD);
int i; int i;
...@@ -634,7 +618,9 @@ BOOLEAN KbdSynchronizeRoutine(PVOID Context) ...@@ -634,7 +618,9 @@ BOOLEAN KbdSynchronizeRoutine(PVOID Context)
VOID KbdStartIo(PDEVICE_OBJECT DeviceObject, PIRP Irp) VOID KbdStartIo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{ {
#ifndef NDEBUG
PIO_STACK_LOCATION stk = IoGetCurrentIrpStackLocation(Irp); PIO_STACK_LOCATION stk = IoGetCurrentIrpStackLocation(Irp);
#endif
DPRINT("KeyboardStartIo(DeviceObject %x Irp %x)\n",DeviceObject,Irp); DPRINT("KeyboardStartIo(DeviceObject %x Irp %x)\n",DeviceObject,Irp);
...@@ -691,18 +677,16 @@ NTSTATUS KbdDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp) ...@@ -691,18 +677,16 @@ NTSTATUS KbdDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
return(Status); return(Status);
} }
NTSTATUS STDCALL DriverEntry(PDRIVER_OBJECT DriverObject,
PUNICODE_STRING RegistryPath)
/* /*
* Module entry point * FUNCTION: Module entry point
*/ */
STDCALL NTSTATUS
DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
{ {
PDEVICE_OBJECT DeviceObject; PDEVICE_OBJECT DeviceObject;
ANSI_STRING adevice_name; UNICODE_STRING DeviceName;
UNICODE_STRING device_name; UNICODE_STRING SymlinkName;
ANSI_STRING asymlink_name;
UNICODE_STRING symlink_name;
DbgPrint("Keyboard Driver 0.0.4\n"); DbgPrint("Keyboard Driver 0.0.4\n");
InitializeKeyboard(); InitializeKeyboard();
...@@ -710,16 +694,19 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) ...@@ -710,16 +694,19 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
DriverObject->MajorFunction[IRP_MJ_CLOSE] = KbdDispatch; DriverObject->MajorFunction[IRP_MJ_CLOSE] = KbdDispatch;
DriverObject->MajorFunction[IRP_MJ_READ] = KbdDispatch; DriverObject->MajorFunction[IRP_MJ_READ] = KbdDispatch;
DriverObject->DriverStartIo = KbdStartIo; DriverObject->DriverStartIo = KbdStartIo;
RtlInitAnsiString(&adevice_name,"\\Device\\Keyboard"); RtlInitUnicodeString(&DeviceName, L"\\Device\\Keyboard");
RtlAnsiStringToUnicodeString(&device_name,&adevice_name,TRUE); IoCreateDevice(DriverObject,
IoCreateDevice(DriverObject,0,&device_name,FILE_DEVICE_KEYBOARD,0, 0,
TRUE,&DeviceObject); &DeviceName,
DeviceObject->Flags = DO_BUFFERED_IO; FILE_DEVICE_KEYBOARD,
0,
RtlInitAnsiString(&asymlink_name,"\\??\\Keyboard"); TRUE,
RtlAnsiStringToUnicodeString(&symlink_name,&asymlink_name,TRUE); &DeviceObject);
IoCreateSymbolicLink(&symlink_name,&device_name); DeviceObject->Flags = DeviceObject->Flags | DO_BUFFERED_IO;
RtlInitUnicodeString(&SymlinkName, L"\\??\\Keyboard");
IoCreateSymbolicLink(&SymlinkName, &DeviceName);
return(STATUS_SUCCESS); return(STATUS_SUCCESS);
} }
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: services/fs/ext2/attr.c
* PURPOSE: Set/Get file attributes support
* PROGRAMMER: David Welch (welch@cwcom.net)
* UPDATE HISTORY:
*/
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <wchar.h>
#include <internal/string.h>
//#define NDEBUG
#include <internal/debug.h>
#include "ext2fs.h"
/* FUNCTIONS ****************************************************************/
NTSTATUS Ext2SetInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
DPRINT("Ext2SetInformation(DeviceObject %x Irp %x)\n",DeviceObject,Irp);
Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
Irp->IoStatus.Information = 0;
return(STATUS_UNSUCCESSFUL);
}
NTSTATUS Ext2QueryInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
NTSTATUS Status;
PIO_STACK_LOCATION Param;
PFILE_OBJECT FileObject;
PDEVICE_EXTENSION DeviceExt;
ULONG Length;
PFILE_BASIC_INFORMATION PFileBasicInformation;
PFILE_STANDARD_INFORMATION PFileStandardInformation;
PFILE_INTERNAL_INFORMATION PFileInternalInformation;
PFILE_EA_INFORMATION PFileEaInformation;
PFILE_ACCESS_INFORMATION PFileAccessInformation;
PFILE_NAME_INFORMATION PFileNameInformation;
PFILE_POSITION_INFORMATION PFilePositionInformation;
PVOID Buffer;
DPRINT("Ext2QueryInformation(DeviceObject %x Irp %x)\n", DeviceObject, Irp);
Param = IoGetCurrentIrpStackLocation(Irp);
FileObject = Param->FileObject;
DeviceExt = DeviceObject->DeviceExtension;
Length = Param->Parameters.QueryFile.Length;
Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
switch (Param->Parameters.QueryFile.FileInformationClass)
{
case FileDirectoryInformation:
case FileFullDirectoryInformation:
case FileBothDirectoryInformation:
Status = STATUS_NOT_IMPLEMENTED;
break;
case FileBasicInformation:
PFileBasicInformation = (PFILE_BASIC_INFORMATION)Buffer;
memset(PFileBasicInformation, 0, sizeof(FILE_BASIC_INFORMATION));
Status = STATUS_SUCCESS;
break;
case FileStandardInformation:
PFileStandardInformation = (PFILE_STANDARD_INFORMATION)Buffer;
memset(PFileStandardInformation, 0, sizeof(FILE_STANDARD_INFORMATION));
Status = STATUS_SUCCESS;
break;
case FileInternalInformation:
PFileInternalInformation = (PFILE_INTERNAL_INFORMATION)Buffer;
memset(PFileInternalInformation, 0, sizeof(FILE_INTERNAL_INFORMATION));
Status = STATUS_SUCCESS;
break;
case FileEaInformation:
PFileEaInformation = (PFILE_EA_INFORMATION)Buffer;
memset(PFileEaInformation, 0, sizeof(FILE_EA_INFORMATION));
PFileEaInformation->EaSize = 0;
Status = STATUS_SUCCESS;
break;
case FileAccessInformation:
PFileAccessInformation = (PFILE_ACCESS_INFORMATION)Buffer;
memset(PFileAccessInformation, 0, sizeof(FILE_ACCESS_INFORMATION));
PFileAccessInformation->AccessFlags = 0;
Status = STATUS_SUCCESS;
break;
case FileNameInformation:
PFileNameInformation = (PFILE_NAME_INFORMATION)Buffer;
memset(PFileNameInformation, 0, sizeof(FILE_NAME_INFORMATION));
Status = STATUS_SUCCESS;
break;
case FilePositionInformation:
PFilePositionInformation = (PFILE_POSITION_INFORMATION)Buffer;
memcpy(PFilePositionInformation,
&FileObject->CurrentByteOffset,
sizeof(FileObject->CurrentByteOffset));
Status = STATUS_SUCCESS;
break;
case FileRenameInformation:
Status = STATUS_NOT_IMPLEMENTED;
break;
default:
Status = STATUS_NOT_IMPLEMENTED;
}
Irp->IoStatus.Status = Status;
Irp->IoStatus.Information = 0;
return(STATUS_UNSUCCESSFUL);
}
/* /*
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
* FILE: services/fs/vfat/blockdev.c * FILE: services/fs/ext2/blockdev.c
* PURPOSE: Temporary sector reading support * PURPOSE: Temporary sector reading support
* PROGRAMMER: David Welch (welch@mcmail.com) * PROGRAMMER: David Welch (welch@cwcom.net)
* UPDATE HISTORY: * UPDATE HISTORY:
*/ */
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <string.h> #include <string.h>
#include <internal/string.h> #include <internal/string.h>
#define NDEBUG //#define NDEBUG
#include <internal/debug.h> #include <internal/debug.h>
#include "ext2fs.h" #include "ext2fs.h"
...@@ -42,8 +42,8 @@ BOOLEAN Ext2ReadSectors(IN PDEVICE_OBJECT pDeviceObject, ...@@ -42,8 +42,8 @@ BOOLEAN Ext2ReadSectors(IN PDEVICE_OBJECT pDeviceObject,
DPRINT("DiskSector:%ld BLKSZ:%ld sectorNumber:%ld:%ld\n", DPRINT("DiskSector:%ld BLKSZ:%ld sectorNumber:%ld:%ld\n",
(unsigned long) DiskSector, (unsigned long) DiskSector,
(unsigned long) BLOCKSIZE, (unsigned long) BLOCKSIZE,
(unsigned long) sectorNumber.HighPart, (unsigned long) sectorNumber.u.HighPart,
(unsigned long) sectorNumber.LowPart); (unsigned long) sectorNumber.u.LowPart);
KeInitializeEvent(&event, NotificationEvent, FALSE); KeInitializeEvent(&event, NotificationEvent, FALSE);
...@@ -59,17 +59,18 @@ BOOLEAN Ext2ReadSectors(IN PDEVICE_OBJECT pDeviceObject, ...@@ -59,17 +59,18 @@ BOOLEAN Ext2ReadSectors(IN PDEVICE_OBJECT pDeviceObject,
&event, &event,
&ioStatus ); &ioStatus );
if (!irp) { if (!irp)
{
DbgPrint("READ failed!!!\n"); DbgPrint("READ failed!!!\n");
return FALSE; return FALSE;
} }
DPRINT("Calling IO Driver...\n"); DPRINT("Calling IO Driver...\n");
status = IoCallDriver(pDeviceObject, status = IoCallDriver(pDeviceObject, irp);
irp);
DPRINT("Waiting for IO Operation...\n"); DPRINT("Waiting for IO Operation...\n");
if (status == STATUS_PENDING) { if (status == STATUS_PENDING)
{
KeWaitForSingleObject(&event, KeWaitForSingleObject(&event,
Suspended, Suspended,
KernelMode, KernelMode,
...@@ -77,14 +78,15 @@ BOOLEAN Ext2ReadSectors(IN PDEVICE_OBJECT pDeviceObject, ...@@ -77,14 +78,15 @@ BOOLEAN Ext2ReadSectors(IN PDEVICE_OBJECT pDeviceObject,
NULL); NULL);
DPRINT("Getting IO Status...\n"); DPRINT("Getting IO Status...\n");
status = ioStatus.Status; status = ioStatus.Status;
} }
if (!NT_SUCCESS(status)) { if (!NT_SUCCESS(status))
{
DbgPrint("IO failed!!! Error code: %d(%x)\n", status, status); DbgPrint("IO failed!!! Error code: %d(%x)\n", status, status);
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
} }
BOOLEAN VFATWriteSectors(IN PDEVICE_OBJECT pDeviceObject, BOOLEAN VFATWriteSectors(IN PDEVICE_OBJECT pDeviceObject,
......
...@@ -13,14 +13,15 @@ ...@@ -13,14 +13,15 @@
#include <wchar.h> #include <wchar.h>
#include <internal/string.h> #include <internal/string.h>
#define NDEBUG //#define NDEBUG
#include <internal/debug.h> #include <internal/debug.h>
#include "ext2fs.h" #include "ext2fs.h"
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
VOID Ext2ConvertName(PWSTR Out, PCH In, ULONG Len)
static VOID Ext2ConvertName(PWSTR Out, PCH In, ULONG Len)
{ {
ULONG i; ULONG i;
...@@ -42,8 +43,6 @@ PVOID Ext2ProcessDirEntry(PDEVICE_EXTENSION DeviceExt, ...@@ -42,8 +43,6 @@ PVOID Ext2ProcessDirEntry(PDEVICE_EXTENSION DeviceExt,
PFILE_DIRECTORY_INFORMATION FDI; PFILE_DIRECTORY_INFORMATION FDI;
PFILE_NAMES_INFORMATION FNI; PFILE_NAMES_INFORMATION FNI;
PFILE_BOTH_DIRECTORY_INFORMATION FBI; PFILE_BOTH_DIRECTORY_INFORMATION FBI;
ULONG i;
PWSTR FileName;
struct ext2_inode inode; struct ext2_inode inode;
DPRINT("FileIndex %d\n",FileIndex); DPRINT("FileIndex %d\n",FileIndex);
...@@ -108,13 +107,11 @@ NTSTATUS Ext2QueryDirectory(PDEVICE_EXTENSION DeviceExt, ...@@ -108,13 +107,11 @@ NTSTATUS Ext2QueryDirectory(PDEVICE_EXTENSION DeviceExt,
ULONG Max; ULONG Max;
ULONG i; ULONG i;
ULONG StartIndex; ULONG StartIndex;
PVOID Buffer; PVOID Buffer = NULL;
struct ext2_dir_entry dir_entry; struct ext2_dir_entry dir_entry;
ULONG CurrentIndex;
DPRINT("Buffer %x\n",Buffer);
Buffer = Irp->UserBuffer; Buffer = Irp->UserBuffer;
DPRINT("Buffer %x\n",Buffer);
DPRINT("IoStack->Flags %x\n",IoStack->Flags); DPRINT("IoStack->Flags %x\n",IoStack->Flags);
if (IoStack->Flags & SL_RETURN_SINGLE_ENTRY) if (IoStack->Flags & SL_RETURN_SINGLE_ENTRY)
...@@ -201,6 +198,7 @@ BOOL Ext2ScanDir(PDEVICE_EXTENSION DeviceExt, ...@@ -201,6 +198,7 @@ BOOL Ext2ScanDir(PDEVICE_EXTENSION DeviceExt,
char name[255]; char name[255];
struct ext2_dir_entry* current; struct ext2_dir_entry* current;
ULONG block; ULONG block;
BOOL b;
DPRINT("Ext2ScanDir(dir %x, filename %s, ret %x)\n",dir,filename,ret); DPRINT("Ext2ScanDir(dir %x, filename %s, ret %x)\n",dir,filename,ret);
...@@ -210,10 +208,15 @@ BOOL Ext2ScanDir(PDEVICE_EXTENSION DeviceExt, ...@@ -210,10 +208,15 @@ BOOL Ext2ScanDir(PDEVICE_EXTENSION DeviceExt,
for (; (block = Ext2BlockMap(DeviceExt, dir, i)) != 0; i++) for (; (block = Ext2BlockMap(DeviceExt, dir, i)) != 0; i++)
{ {
DPRINT("block %d\n",block); DPRINT("block %d\n",block);
Ext2ReadSectors(DeviceExt->StorageDevice, b = Ext2ReadSectors(DeviceExt->StorageDevice,
block, block,
1, 1,
buffer); buffer);
if (!b)
{
DbgPrint("ext2fs:%s:%d: Disk io failed\n", __FILE__, __LINE__);
return(FALSE);
}
offset = (*StartIndex)%BLOCKSIZE; offset = (*StartIndex)%BLOCKSIZE;
while (offset < BLOCKSIZE) while (offset < BLOCKSIZE)
...@@ -264,7 +267,7 @@ NTSTATUS Ext2OpenFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject, ...@@ -264,7 +267,7 @@ NTSTATUS Ext2OpenFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject,
* FUNCTION: Opens a file * FUNCTION: Opens a file
*/ */
{ {
struct ext2_inode parent_inode; EXT2_INODE parent_inode;
struct ext2_dir_entry entry; struct ext2_dir_entry entry;
char name[255]; char name[255];
ULONG current_inode = 2; ULONG current_inode = 2;
...@@ -279,28 +282,35 @@ NTSTATUS Ext2OpenFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject, ...@@ -279,28 +282,35 @@ NTSTATUS Ext2OpenFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject,
unicode_to_ansi(name,FileName); unicode_to_ansi(name,FileName);
DPRINT("name %s\n",name); DPRINT("name %s\n",name);
DPRINT("strtok %x\n",strtok);
current_segment = strtok(name,"\\"); current_segment = strtok(name,"\\");
DPRINT("current_segment %x\n", current_segment);
while (current_segment!=NULL) while (current_segment!=NULL)
{ {
Ext2ReadInode(DeviceExt, Ext2LoadInode(DeviceExt,
current_inode, current_inode,
&parent_inode); &parent_inode);
if (!Ext2ScanDir(DeviceExt,&parent_inode,current_segment,&entry, if (!Ext2ScanDir(DeviceExt,
parent_inode.inode,
current_segment,
&entry,
&StartIndex)) &StartIndex))
{ {
Ext2ReleaseInode(DeviceExt,
&parent_inode);
ExFreePool(Fcb); ExFreePool(Fcb);
return(STATUS_UNSUCCESSFUL); return(STATUS_UNSUCCESSFUL);
} }
current_inode = entry.inode; current_inode = entry.inode;
current_segment = strtok(NULL,"\\"); current_segment = strtok(NULL,"\\");
StartIndex = 0; StartIndex = 0;
Ext2ReleaseInode(DeviceExt,
&parent_inode);
} }
DPRINT("Found file\n"); DPRINT("Found file\n");
Ext2ReadInode(DeviceExt, Fcb->inode = current_inode;
current_inode, CcInitializeFileCache(FileObject, &Fcb->Bcb);
&Fcb->inode);
FileObject->FsContext = Fcb; FileObject->FsContext = Fcb;
return(STATUS_SUCCESS); return(STATUS_SUCCESS);
......
#include <ddk/ntifs.h>
BOOLEAN Ext2ReadSectors(IN PDEVICE_OBJECT pDeviceObject, BOOLEAN Ext2ReadSectors(IN PDEVICE_OBJECT pDeviceObject,
IN ULONG DiskSector, IN ULONG DiskSector,
IN ULONG SectorCount, IN ULONG SectorCount,
...@@ -214,8 +216,22 @@ typedef struct ...@@ -214,8 +216,22 @@ typedef struct
{ {
PDEVICE_OBJECT StorageDevice; PDEVICE_OBJECT StorageDevice;
struct ext2_super_block* superblock; struct ext2_super_block* superblock;
PFILE_OBJECT FileObject;
PBCB Bcb;
} DEVICE_EXTENSION, *PDEVICE_EXTENSION; } DEVICE_EXTENSION, *PDEVICE_EXTENSION;
typedef struct _EXT2_GROUP_DESC
{
ERESOURCE Lock;
struct ext2_group_desc* desc;
PCACHE_SEGMENT CacheSeg;
PVOID BaseAddress;
} EXT2_GROUP_DESC, *PEXT2_GROUP_DESC;
PEXT2_GROUP_DESC Ext2LoadGroup(PDEVICE_EXTENSION DeviceExt,
ULONG BlockGrp);
VOID Ext2ReleaseGroup(PDEVICE_EXTENSION DeviceExt,
PEXT2_GROUP_DESC GrpDesc);
VOID Ext2ReadInode(PDEVICE_EXTENSION DeviceExt, VOID Ext2ReadInode(PDEVICE_EXTENSION DeviceExt,
ULONG ino, ULONG ino,
...@@ -223,14 +239,23 @@ VOID Ext2ReadInode(PDEVICE_EXTENSION DeviceExt, ...@@ -223,14 +239,23 @@ VOID Ext2ReadInode(PDEVICE_EXTENSION DeviceExt,
struct ext2_group_desc* Ext2LoadGroupDesc(PDEVICE_EXTENSION DeviceExt, struct ext2_group_desc* Ext2LoadGroupDesc(PDEVICE_EXTENSION DeviceExt,
ULONG block_group); ULONG block_group);
typedef struct _EXT2_INODE
{
struct ext2_inode* inode;
PVOID BaseAddress;
PCACHE_SEGMENT CacheSeg;
} EXT2_INODE, *PEXT2_INODE;
typedef struct _EXT2_FCB typedef struct _EXT2_FCB
{ {
struct ext2_inode inode; ULONG inode;
EXT2_INODE i;
PBCB Bcb;
} EXT2_FCB, *PEXT2_FCB; } EXT2_FCB, *PEXT2_FCB;
ULONG Ext2BlockMap(PDEVICE_EXTENSION DeviceExt, ULONG Ext2BlockMap(PDEVICE_EXTENSION DeviceExt,
struct ext2_inode* inode, struct ext2_inode* inode,
ULONG offset); ULONG offset);
NTSTATUS Ext2OpenFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject, NTSTATUS Ext2OpenFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject,
PWSTR FileName); PWSTR FileName);
NTSTATUS Ext2ReadFile(PDEVICE_EXTENSION DeviceExt, NTSTATUS Ext2ReadFile(PDEVICE_EXTENSION DeviceExt,
...@@ -240,3 +265,24 @@ NTSTATUS Ext2ReadFile(PDEVICE_EXTENSION DeviceExt, ...@@ -240,3 +265,24 @@ NTSTATUS Ext2ReadFile(PDEVICE_EXTENSION DeviceExt,
LARGE_INTEGER Offset); LARGE_INTEGER Offset);
NTSTATUS Ext2Create(PDEVICE_OBJECT DeviceObject, PIRP Irp); NTSTATUS Ext2Create(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS Ext2DirectoryControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); NTSTATUS Ext2DirectoryControl(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS Ext2QueryQuota(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS Ext2SetQuota(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS Ext2SetSecurity(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS Ext2QuerySecurity(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS Ext2SetInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS Ext2QueryInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS Ext2Read(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS Ext2Write(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS Ext2Cleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS Ext2FlushBuffers(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS Ext2Shutdown(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS Ext2ReadPage(PDEVICE_EXTENSION DeviceExt,
PEXT2_FCB Fcb,
PVOID Buffer,
ULONG Offset);
VOID Ext2LoadInode(PDEVICE_EXTENSION DeviceExt,
ULONG ino,
PEXT2_INODE Inode);
VOID Ext2ReleaseInode(PDEVICE_EXTENSION DeviceExt,
PEXT2_INODE Inode);
...@@ -26,6 +26,7 @@ ULONG Ext2BlockMap(PDEVICE_EXTENSION DeviceExt, ...@@ -26,6 +26,7 @@ ULONG Ext2BlockMap(PDEVICE_EXTENSION DeviceExt,
{ {
ULONG block; ULONG block;
PULONG TempBuffer; PULONG TempBuffer;
BOOL b;
DPRINT("Ext2BlockMap(DeviceExt %x, inode %x, offset %d)\n", DPRINT("Ext2BlockMap(DeviceExt %x, inode %x, offset %d)\n",
DeviceExt,inode,offset); DeviceExt,inode,offset);
...@@ -40,14 +41,21 @@ ULONG Ext2BlockMap(PDEVICE_EXTENSION DeviceExt, ...@@ -40,14 +41,21 @@ ULONG Ext2BlockMap(PDEVICE_EXTENSION DeviceExt,
{ {
block = inode->i_block[EXT2_IND_BLOCK]; block = inode->i_block[EXT2_IND_BLOCK];
TempBuffer = ExAllocatePool(NonPagedPool, BLOCKSIZE); TempBuffer = ExAllocatePool(NonPagedPool, BLOCKSIZE);
Ext2ReadSectors(DeviceExt->StorageDevice, b = Ext2ReadSectors(DeviceExt->StorageDevice,
block, block,
1, 1,
TempBuffer); TempBuffer);
if (!b)
{
DbgPrint("ext2fs:%s:%d: Disk io failed\n", __FILE__, __LINE__);
return(0);
}
block = TempBuffer[offset]; block = TempBuffer[offset];
ExFreePool(TempBuffer); ExFreePool(TempBuffer);
return(block); return(block);
} }
offset = offset - addr_per_block;
DbgPrint("Failed at %s:%d\n",__FILE__,__LINE__); DbgPrint("Failed at %s:%d\n",__FILE__,__LINE__);
for(;;); for(;;);
} }
...@@ -12,8 +12,9 @@ ...@@ -12,8 +12,9 @@
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <string.h> #include <string.h>
#include <internal/string.h>
#define NDEBUG //#define NDEBUG
#include <internal/debug.h> #include <internal/debug.h>
#include "ext2fs.h" #include "ext2fs.h"
...@@ -45,8 +46,76 @@ struct ext2_group_desc* Ext2LoadGroupDesc(PDEVICE_EXTENSION DeviceExt, ...@@ -45,8 +46,76 @@ struct ext2_group_desc* Ext2LoadGroupDesc(PDEVICE_EXTENSION DeviceExt,
} }
#define INODES_PER_PAGE (PAGESIZE / sizeof(struct ext2_inode))
#define INODES_PER_BLOCK (BLOCKSIZE / sizeof(struct ext2_inode)) #define INODES_PER_BLOCK (BLOCKSIZE / sizeof(struct ext2_inode))
VOID Ext2LoadInode(PDEVICE_EXTENSION DeviceExt,
ULONG ino,
PEXT2_INODE Inode)
{
ULONG block_group;
struct ext2_group_desc* gdp;
ULONG offset;
ULONG dsec;
BOOLEAN Uptodate;
struct ext2_inode* ibuffer;
DPRINT("Ext2LoadInode(DeviceExt %x, ino %d, Inode %x)\n",
DeviceExt, ino, Inode);
block_group = (ino - 1) / DeviceExt->superblock->s_inodes_per_group;
DPRINT("block_group %d\n",block_group);
gdp = Ext2LoadGroupDesc(DeviceExt, block_group);
offset = (ino - 1) % DeviceExt->superblock->s_inodes_per_group;
DPRINT("offset %d\n", offset);
dsec = (gdp->bg_inode_table + (offset / INODES_PER_BLOCK)) * BLOCKSIZE;
DPRINT("dsec %d (dsec/BLOCKSIZE) %d PAGE_ROUND_DOWN(dsec) %d\n",
dsec, (dsec/BLOCKSIZE), PAGE_ROUND_DOWN(dsec));
CcRequestCachePage(DeviceExt->Bcb,
PAGE_ROUND_DOWN(dsec),
&Inode->BaseAddress,
&Uptodate,
&Inode->CacheSeg);
DPRINT("PAGE_ROUND_DOWN(dsec)/BLOCKSIZE %d\n",
PAGE_ROUND_DOWN(dsec)/BLOCKSIZE);
if (!Uptodate)
{
Ext2ReadSectors(DeviceExt->StorageDevice,
PAGE_ROUND_DOWN(dsec) / BLOCKSIZE,
4,
Inode->BaseAddress);
}
ibuffer = ((struct ext2_inode *)Inode->BaseAddress) +
(dsec - PAGE_ROUND_DOWN(dsec));
DPRINT("Inode->BaseAddress 0x%x ibuffer 0x%x\n",
Inode->BaseAddress, ibuffer);
Inode->inode = &ibuffer[offset % INODES_PER_PAGE];
DPRINT("inode->i_uid %d\n",Inode->inode->i_uid);
DPRINT("inode->i_links_count %d\n",Inode->inode->i_links_count);
DPRINT("inode->i_blocks %d\n",Inode->inode->i_blocks);
DPRINT("Ext2LoadInode() finished\n");
}
VOID Ext2ReleaseInode(PDEVICE_EXTENSION DeviceExt,
PEXT2_INODE Inode)
{
CcReleaseCachePage(DeviceExt->Bcb,
Inode->CacheSeg,
TRUE);
Inode->CacheSeg = NULL;
Inode->BaseAddress = NULL;
Inode->inode = NULL;
}
VOID Ext2ReadInode(PDEVICE_EXTENSION DeviceExt, VOID Ext2ReadInode(PDEVICE_EXTENSION DeviceExt,
ULONG ino, ULONG ino,
struct ext2_inode* inode) struct ext2_inode* inode)
...@@ -77,4 +146,5 @@ VOID Ext2ReadInode(PDEVICE_EXTENSION DeviceExt, ...@@ -77,4 +146,5 @@ VOID Ext2ReadInode(PDEVICE_EXTENSION DeviceExt,
DPRINT("inode->i_uid %d\n",inode->i_uid); DPRINT("inode->i_uid %d\n",inode->i_uid);
DPRINT("inode->i_links_count %d\n",inode->i_links_count); DPRINT("inode->i_links_count %d\n",inode->i_links_count);
DPRINT("inode->i_blocks %d\n",inode->i_blocks); DPRINT("inode->i_blocks %d\n",inode->i_blocks);
} }
# #
# #
# #
OBJECTS = super.o blockdev.o inode.o file.o dir.o rw.o \ OBJECTS = super.o blockdev.o inode.o file.o dir.o rw.o quota.o security.o \
../../../ntoskrnl/ntoskrnl.a attr.o ../../../ntoskrnl/ntoskrnl.a
all: ext2fs.sys all: ext2fs.sys
......
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: services/fs/ext2/quota.c
* PURPOSE: Quota support
* PROGRAMMER: David Welch (welch@mcmail.com)
* UPDATE HISTORY:
*/
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <wchar.h>
#include <internal/string.h>
//#define NDEBUG
#include <internal/debug.h>
#include "ext2fs.h"
/* FUNCTIONS ****************************************************************/
NTSTATUS Ext2QueryQuota(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
NTSTATUS Status;
Status = STATUS_NOT_IMPLEMENTED;
Irp->IoStatus.Status = Status;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return(Status);
}
NTSTATUS Ext2SetQuota(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
NTSTATUS Status;
Status = STATUS_NOT_IMPLEMENTED;
Irp->IoStatus.Status = Status;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return(Status);
}
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
/* INCLUDES *****************************************************************/ /* INCLUDES *****************************************************************/
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <string.h>
#define NDEBUG #define NDEBUG
#include <internal/debug.h> #include <internal/debug.h>
...@@ -18,77 +19,196 @@ ...@@ -18,77 +19,196 @@
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
NTSTATUS Ext2ReadPage(PDEVICE_EXTENSION DeviceExt,
PEXT2_FCB Fcb,
PVOID Buffer,
ULONG Offset)
{
ULONG block, i;
for (i=0; i<4; i++)
{
block = Ext2BlockMap(DeviceExt,
Fcb->i.inode,
Offset + i);
Ext2ReadSectors(DeviceExt->StorageDevice,
block,
1,
Buffer + (i*BLOCKSIZE));
}
return(STATUS_SUCCESS);
}
NTSTATUS Ext2ReadFile(PDEVICE_EXTENSION DeviceExt, NTSTATUS Ext2ReadFile(PDEVICE_EXTENSION DeviceExt,
PFILE_OBJECT FileObject, PFILE_OBJECT FileObject,
PVOID Buffer, PVOID Buffer,
ULONG Length, ULONG Length,
LARGE_INTEGER OffsetL) LARGE_INTEGER OffsetL)
/*
* FUNCTION: Reads data from a file
*/
{ {
PVOID BaseAddress;
BOOLEAN Uptodate = FALSE;
PCACHE_SEGMENT CacheSeg;
ULONG Offset = (ULONG)OffsetL.u.LowPart;
PEXT2_FCB Fcb; PEXT2_FCB Fcb;
PVOID TempBuffer; ULONG block, i, Delta;
ULONG Offset = OffsetL.u.LowPart;
ULONG block;
ULONG Delta;
ULONG i;
DPRINT("Ext2ReadFile(DeviceExt %x, FileObject %x, Buffer %x, Length %d, \n" DPRINT("Ext2ReadFile(DeviceExt %x, FileObject %x, Buffer %x, Length %d, \n"
"OffsetL %d)\n",DeviceExt,FileObject,Buffer,Length,(ULONG)OffsetL); "OffsetL %d)\n",DeviceExt,FileObject,Buffer,Length,(ULONG)OffsetL);
Fcb = (PEXT2_FCB)FileObject->FsContext; Fcb = (PEXT2_FCB)FileObject->FsContext;
TempBuffer = ExAllocatePool(NonPagedPool, BLOCKSIZE);
Ext2LoadInode(DeviceExt,
Fcb->inode,
&Fcb->i);
if (Offset >= Fcb->inode.i_size) if (Offset >= Fcb->i.inode->i_size)
{ {
ExFreePool(TempBuffer); DPRINT("Returning end of file\n");
return(STATUS_END_OF_FILE); return(STATUS_END_OF_FILE);
} }
if ((Offset + Length) > Fcb->inode.i_size) if ((Offset + Length) > Fcb->i.inode->i_size)
{ {
Length = Fcb->inode.i_size - Offset; Length = Fcb->i.inode->i_size - Offset;
} }
CHECKPOINT; Ext2ReleaseInode(DeviceExt,
if ((Offset % BLOCKSIZE) != 0) &Fcb->i);
if ((Offset % PAGESIZE) != 0)
{ {
block = Ext2BlockMap(DeviceExt, &Fcb->inode, Offset / BLOCKSIZE); Delta = min(PAGESIZE - (Offset % PAGESIZE),Length);
Delta = min(BLOCKSIZE - (Offset % BLOCKSIZE),Length); CcRequestCachePage(Fcb->Bcb,
Ext2ReadSectors(DeviceExt->StorageDevice, Offset,
block, &BaseAddress,
1, &Uptodate,
TempBuffer); &CacheSeg);
memcpy(Buffer, TempBuffer + (Offset % BLOCKSIZE), Delta); if (Uptodate == FALSE)
{
Ext2ReadPage(DeviceExt,
Fcb,
BaseAddress,
Offset / BLOCKSIZE);
}
memcpy(Buffer, BaseAddress + (Offset % PAGESIZE), Delta);
CcReleaseCachePage(Fcb->Bcb,
CacheSeg,
TRUE);
Length = Length - Delta; Length = Length - Delta;
Offset = Offset + Delta; Offset = Offset + Delta;
Buffer = Buffer + Delta; Buffer = Buffer + Delta;
} }
CHECKPOINT; CHECKPOINT;
for (i=0; i<(Length/BLOCKSIZE); i++) for (i=0; i<(Length/PAGESIZE); i++)
{ {
block = Ext2BlockMap(DeviceExt, &Fcb->inode, CcRequestCachePage(Fcb->Bcb,
(Offset / BLOCKSIZE)+i); Offset,
Ext2ReadSectors(DeviceExt->StorageDevice, &BaseAddress,
block, &Uptodate,
1, &CacheSeg);
Buffer); if (Uptodate == FALSE)
Length = Length - BLOCKSIZE; {
Offset = Offset + BLOCKSIZE; Ext2ReadPage(DeviceExt,
Buffer = Buffer + BLOCKSIZE; Fcb,
BaseAddress,
(Offset / BLOCKSIZE));
}
memcpy(Buffer, BaseAddress, PAGESIZE);
CcReleaseCachePage(Fcb->Bcb,
CacheSeg,
TRUE);
Length = Length - PAGESIZE;
Offset = Offset + PAGESIZE;
Buffer = Buffer + PAGESIZE;
} }
CHECKPOINT; CHECKPOINT;
if ((Length % BLOCKSIZE) != 0) if ((Length % PAGESIZE) != 0)
{ {
block = Ext2BlockMap(DeviceExt, &Fcb->inode, Offset / BLOCKSIZE); CcRequestCachePage(Fcb->Bcb,
Ext2ReadSectors(DeviceExt->StorageDevice, Offset,
block, &BaseAddress,
1, &Uptodate,
TempBuffer); &CacheSeg);
memcpy(Buffer,TempBuffer,Length); if (Uptodate == FALSE)
{
Ext2ReadPage(DeviceExt,
Fcb,
BaseAddress,
(Offset / BLOCKSIZE));
}
DPRINT("Copying %x to %x Length %d\n",BaseAddress,Buffer,Length);
memcpy(Buffer,BaseAddress,Length);
CcReleaseCachePage(Fcb->Bcb,
CacheSeg,
TRUE);
} }
CHECKPOINT;
ExFreePool(TempBuffer);
return(STATUS_SUCCESS); return(STATUS_SUCCESS);
} }
NTSTATUS Ext2Write(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
DPRINT("Ext2Write(DeviceObject %x Irp %x)\n",DeviceObject,Irp);
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
Irp->IoStatus.Information = 0;
return(STATUS_UNSUCCESSFUL);
}
NTSTATUS Ext2FlushBuffers(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
DPRINT("Ext2FlushBuffers(DeviceObject %x Irp %x)\n",DeviceObject,Irp);
Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
Irp->IoStatus.Information = 0;
return(STATUS_UNSUCCESSFUL);
}
NTSTATUS Ext2Shutdown(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
DPRINT("Ext2Shutdown(DeviceObject %x Irp %x)\n",DeviceObject,Irp);
Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
Irp->IoStatus.Information = 0;
return(STATUS_UNSUCCESSFUL);
}
NTSTATUS Ext2Cleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
DbgPrint("Ext2Cleanup(DeviceObject %x Irp %x)\n",DeviceObject,Irp);
Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
Irp->IoStatus.Information = 0;
DbgPrint("Ext2Cleanup() finished\n");
return(STATUS_UNSUCCESSFUL);
}
NTSTATUS Ext2Read(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
ULONG Length;
PVOID Buffer;
PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation(Irp);
PFILE_OBJECT FileObject = Stack->FileObject;
PDEVICE_EXTENSION DeviceExt = DeviceObject->DeviceExtension;
NTSTATUS Status;
DPRINT("Ext2Read(DeviceObject %x, FileObject %x, Irp %x)\n",
DeviceObject, FileObject, Irp);
Length = Stack->Parameters.Read.Length;
CHECKPOINT;
Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
CHECKPOINT;
CHECKPOINT;
Status = Ext2ReadFile(DeviceExt,FileObject,Buffer,Length,
Stack->Parameters.Read.ByteOffset);
Irp->IoStatus.Status = Status;
Irp->IoStatus.Information = Length;
IoCompleteRequest(Irp,IO_NO_INCREMENT);
return(Status);
}
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: services/fs/ext2/security.c
* PURPOSE: Security support
* PROGRAMMER: David Welch (welch@mcmail.com)
* UPDATE HISTORY:
*/
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <wchar.h>
#include <internal/string.h>
//#define NDEBUG
#include <internal/debug.h>
#include "ext2fs.h"
/* FUNCTIONS ****************************************************************/
NTSTATUS Ext2QuerySecurity(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
DPRINT("Ext2QuerySecurity(DeviceObject %x Irp %x)\n",DeviceObject,Irp);
Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
Irp->IoStatus.Information = 0;
return(STATUS_UNSUCCESSFUL);
}
NTSTATUS Ext2SetSecurity(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
DPRINT("Ext2SetSecurity(DeviceObject %x Irp %x)\n",DeviceObject,Irp);
Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
Irp->IoStatus.Information = 0;
return(STATUS_UNSUCCESSFUL);
}
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <wchar.h> #include <wchar.h>
#include <internal/string.h> #include <internal/string.h>
#define NDEBUG //#define NDEBUG
#include <internal/debug.h> #include <internal/debug.h>
#include "ext2fs.h" #include "ext2fs.h"
...@@ -30,55 +30,45 @@ NTSTATUS Ext2Close(PDEVICE_OBJECT DeviceObject, PIRP Irp) ...@@ -30,55 +30,45 @@ NTSTATUS Ext2Close(PDEVICE_OBJECT DeviceObject, PIRP Irp)
PFILE_OBJECT FileObject; PFILE_OBJECT FileObject;
PDEVICE_EXTENSION DeviceExtension; PDEVICE_EXTENSION DeviceExtension;
NTSTATUS Status; NTSTATUS Status;
PEXT2_FCB Fcb;
DPRINT("Ext2Close(DeviceObject %x, Irp %x)\n",DeviceObject,Irp); DbgPrint("Ext2Close(DeviceObject %x, Irp %x)\n",DeviceObject,Irp);
Stack = IoGetCurrentIrpStackLocation(Irp); Stack = IoGetCurrentIrpStackLocation(Irp);
FileObject = Stack->FileObject; FileObject = Stack->FileObject;
DeviceExtension = DeviceObject->DeviceExtension; DeviceExtension = DeviceObject->DeviceExtension;
Irp->IoStatus.Status = Status;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT); if (FileObject == DeviceExtension->FileObject)
return(Status); {
} Status = STATUS_SUCCESS;
NTSTATUS Ext2Write(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
DPRINT("FsdWrite(DeviceObject %x Irp %x)\n",DeviceObject,Irp);
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; Irp->IoStatus.Status = Status;
Irp->IoStatus.Information = 0; Irp->IoStatus.Information = 0;
return(STATUS_UNSUCCESSFUL);
} IoCompleteRequest(Irp, IO_NO_INCREMENT);
return(Status);
}
NTSTATUS Ext2Read(PDEVICE_OBJECT DeviceObject, PIRP Irp) Fcb = (PEXT2_FCB)FileObject->FsContext;
{ if (Fcb != NULL)
ULONG Length; {
PVOID Buffer; if (Fcb->Bcb != NULL)
LARGE_INTEGER Offset; {
PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation(Irp); CcReleaseFileCache(FileObject, Fcb->Bcb);
PFILE_OBJECT FileObject = Stack->FileObject; }
PDEVICE_EXTENSION DeviceExt = DeviceObject->DeviceExtension; ExFreePool(Fcb);
NTSTATUS Status; FileObject->FsContext = NULL;
}
DPRINT("FsdRead(DeviceObject %x, Irp %x)\n",DeviceObject,Irp);
Length = Stack->Parameters.Read.Length;
Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
Offset = Stack->Parameters.Read.ByteOffset;
Status = Ext2ReadFile(DeviceExt,FileObject,Buffer,Length,Offset); Status = STATUS_SUCCESS;
Irp->IoStatus.Status = Status; Irp->IoStatus.Status = Status;
Irp->IoStatus.Information = Length; Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp,IO_NO_INCREMENT);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return(Status); return(Status);
} }
NTSTATUS Ext2Mount(PDEVICE_OBJECT DeviceToMount) NTSTATUS Ext2Mount(PDEVICE_OBJECT DeviceToMount)
{ {
PDEVICE_OBJECT DeviceObject; PDEVICE_OBJECT DeviceObject;
...@@ -111,12 +101,19 @@ NTSTATUS Ext2Mount(PDEVICE_OBJECT DeviceToMount) ...@@ -111,12 +101,19 @@ NTSTATUS Ext2Mount(PDEVICE_OBJECT DeviceToMount)
0, 0,
FALSE, FALSE,
&DeviceObject); &DeviceObject);
DPRINT("DeviceObject %x\n",DeviceObject);
DeviceObject->Flags = DeviceObject->Flags | DO_DIRECT_IO; DeviceObject->Flags = DeviceObject->Flags | DO_DIRECT_IO;
DeviceExt = (PVOID)DeviceObject->DeviceExtension; DeviceExt = (PVOID)DeviceObject->DeviceExtension;
DPRINT("DeviceExt %x\n",DeviceExt);
DeviceExt->StorageDevice = IoAttachDeviceToDeviceStack(DeviceObject, DeviceExt->StorageDevice = IoAttachDeviceToDeviceStack(DeviceObject,
DeviceToMount); DeviceToMount);
DPRINT("DeviceExt->StorageDevice %x\n", DeviceExt->StorageDevice);
DeviceExt->FileObject = IoCreateStreamFileObject(NULL, DeviceObject);
DeviceExt->superblock = superblock; DeviceExt->superblock = superblock;
CcInitializeFileCache(DeviceExt->FileObject,
&DeviceExt->Bcb);
DPRINT("Ext2Mount() = STATUS_SUCCESS\n");
return(STATUS_SUCCESS); return(STATUS_SUCCESS);
} }
...@@ -177,13 +174,20 @@ NTSTATUS DriverEntry(PDRIVER_OBJECT _DriverObject, ...@@ -177,13 +174,20 @@ NTSTATUS DriverEntry(PDRIVER_OBJECT _DriverObject,
DriverObject->MajorFunction[IRP_MJ_WRITE] = Ext2Write; DriverObject->MajorFunction[IRP_MJ_WRITE] = Ext2Write;
DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] =
Ext2FileSystemControl; Ext2FileSystemControl;
DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL]= DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] =
Ext2DirectoryControl; Ext2DirectoryControl;
DriverObject->DriverUnload = NULL; DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] =
Ext2QueryInformation;
DriverObject->MajorFunction[IRP_MJ_SET_INFORMATION] = Ext2SetInformation;
DriverObject->MajorFunction[IRP_MJ_FLUSH_BUFFERS] = Ext2FlushBuffers;
DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = Ext2Shutdown;
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = Ext2Cleanup;
DriverObject->MajorFunction[IRP_MJ_QUERY_SECURITY] = Ext2QuerySecurity;
DriverObject->MajorFunction[IRP_MJ_SET_SECURITY] = Ext2SetSecurity;
DriverObject->MajorFunction[IRP_MJ_QUERY_QUOTA] = Ext2QueryQuota;
DriverObject->MajorFunction[IRP_MJ_SET_QUOTA] = Ext2SetQuota;
DPRINT("DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] %x\n", DriverObject->DriverUnload = NULL;
DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL]);
DPRINT("IRP_MJ_DIRECTORY_CONTROL %d\n",IRP_MJ_DIRECTORY_CONTROL);
IoRegisterFileSystem(DeviceObject); IoRegisterFileSystem(DeviceObject);
......
...@@ -1679,7 +1679,8 @@ NTSTATUS FsdFileSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) ...@@ -1679,7 +1679,8 @@ NTSTATUS FsdFileSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
PDEVICE_OBJECT DeviceToMount = Stack->Parameters.Mount.DeviceObject; PDEVICE_OBJECT DeviceToMount = Stack->Parameters.Mount.DeviceObject;
NTSTATUS Status; NTSTATUS Status;
DPRINT("VFAT FSC\n"); // DPRINT("VFAT FSC\n");
DbgPrint("VFAT FSC\n");
/* FIXME: should make sure that this is actually a mount request! */ /* FIXME: should make sure that this is actually a mount request! */
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать