Compare commits

...

876 Commits

Author SHA1 Message Date
The ReactOS Team
6caaf63c2c This commit was manufactured by cvs2svn to create tag 'krnl0015'.
svn path=/tags/krnl0015/; revision=940
2000-01-19 07:05:04 +00:00
Rex Jolliff
90e1f4cbf9 changes to support v15 release
svn path=/trunk/; revision=939
2000-01-19 07:05:04 +00:00
Eric Kohl
921363d647 Changed debug output to use INT 2D
svn path=/trunk/; revision=938
2000-01-18 12:04:45 +00:00
Eric Kohl
8234dea660 Changed debug output to use INT 2D
Ooops! This one was missing! Sorry!

svn path=/trunk/; revision=937
2000-01-18 11:04:53 +00:00
Eric Kohl
88cb154d19 Changed debug output to use INT 2D
svn path=/trunk/; revision=936
2000-01-17 21:02:50 +00:00
Phillip Susi
faac123528 fixed tab completion with long file names
svn path=/trunk/; revision=935
2000-01-17 02:17:50 +00:00
Emanuele Aliberti
e857e97df1 Some more stubs for NDIS.SYS.
svn path=/trunk/; revision=934
2000-01-16 18:32:34 +00:00
Emanuele Aliberti
d508a1f0bf Added two missing names.
svn path=/trunk/; revision=933
2000-01-16 18:31:48 +00:00
Eric Kohl
013fc117b8 Added missing features and functions
Cleaned confusing file naming

svn path=/trunk/; revision=932
2000-01-14 02:23:25 +00:00
Eric Kohl
3d1f2d98ba Added missing printf() functions
Changed format %w to %S and %W to %wZ

svn path=/trunk/; revision=931
2000-01-12 19:05:32 +00:00
Eric Kohl
de66c40007 Disabled debugging messages
svn path=/trunk/; revision=930
2000-01-11 17:33:44 +00:00
Eric Kohl
6cc53dd4b3 Fixed process parameters
Simplified current directory code
Added %C and %S formats to printf()
Changed %w to %S
Fixed compiler warnings

svn path=/trunk/; revision=929
2000-01-11 17:32:13 +00:00
Eric Kohl
fb7f4582cd Fixed ctype and Rtl functions
svn path=/trunk/; revision=928
2000-01-11 01:16:50 +00:00
Emanuele Aliberti
a11a76eaef Some more NTOSKRNL.FsRtl stubs.
svn path=/trunk/; revision=927
2000-01-10 22:46:38 +00:00
Eric Kohl
be132afdf2 Added DbgPrint()
Fixed some Rtl functions
Added missing printf() and wprintf() functions

svn path=/trunk/; revision=926
2000-01-10 20:34:41 +00:00
Eric Kohl
686387f8e0 Removed fixed screen size code
svn path=/trunk/; revision=925
2000-01-09 23:16:41 +00:00
Eric Kohl
492a608e06 Fixed hal display bug
svn path=/trunk/; revision=924
2000-01-09 21:39:07 +00:00
Emanuele Aliberti
fd411d8b8c New year in c/r string.
svn path=/trunk/; revision=923
2000-01-08 16:17:50 +00:00
Eric Kohl
6f3d53f751 Added reading screen sizes from crt controller
svn path=/trunk/; revision=922
2000-01-07 18:57:33 +00:00
Emanuele Aliberti
462fe323eb A few more return structures for NtQuerySystemInformation
svn path=/trunk/; revision=921
2000-01-06 13:17:48 +00:00
David Welch
4d8c6a710b Removed debug messages from queuing code (sorry)
Added __int64 datatype to files that use it
Hid bug in ide driver (or somewhere) for now

svn path=/trunk/; revision=920
2000-01-06 00:26:16 +00:00
David Welch
623093eaaa Implemented more security functions
Moved general security types into new header file
Implemented ThreadImpersonationToken info class
Bug fixes to queuing code

svn path=/trunk/; revision=919
2000-01-05 21:57:00 +00:00
Eric Kohl
453f513ed3 Fixed ctype table and functions.
svn path=/trunk/; revision=918
2000-01-05 19:42:56 +00:00
Eric Kohl
57919a833e Fixed ctype table.
svn path=/trunk/; revision=917
2000-01-05 17:49:00 +00:00
David Welch
e6b5c8bfc7 Disabled pragma statement that was causing problems
svn path=/trunk/; revision=916
2000-01-02 14:21:04 +00:00
Eric Kohl
974095c413 Added mbtowc(), mbstowcs(), wctomb() and wcstombs()
svn path=/trunk/; revision=914
1999-12-30 14:39:43 +00:00
David Welch
a8ca53d761 Added some additional csrss work
Some fixes to the queueing code
Some fixes to the lpc code
Fix to section code

svn path=/trunk/; revision=913
1999-12-30 01:51:42 +00:00
Eric Kohl
c54d897571 Added even more missing functions
svn path=/trunk/; revision=912
1999-12-30 01:33:47 +00:00
Eric Kohl
17afcb4dfd Added some missing debug, math and ctype functions
svn path=/trunk/; revision=911
1999-12-29 17:13:27 +00:00
Eric Kohl
2284e742b3 Fixed implementation of register io functions
Added luid functions

svn path=/trunk/; revision=910
1999-12-29 01:37:30 +00:00
Eric Kohl
c7580dacf3 Last update for millenium release
Fixed some minor bugs
Fixed window title

svn path=/trunk/; revision=909
1999-12-28 23:13:38 +00:00
Eric Kohl
9446011fc1 Minor update
svn path=/trunk/; revision=908
1999-12-28 16:25:21 +00:00
Emanuele Aliberti
586433918e Some more NDIS stubs.
svn path=/trunk/; revision=907
1999-12-27 22:27:39 +00:00
Eric Kohl
b9579544e7 Removed cmd target
svn path=/trunk/; revision=906
1999-12-27 15:07:00 +00:00
Eric Kohl
005106acbb Fixed some more STDCALL issues
svn path=/trunk/; revision=905
1999-12-27 15:06:13 +00:00
Emanuele Aliberti
38d1018911 Added (io/create.c) IoCreateFile stub.
svn path=/trunk/; revision=904
1999-12-26 20:21:03 +00:00
Emanuele Aliberti
ea5959a772 Some missing __stdcall declarations added in headers and in code.
svn path=/trunk/; revision=903
1999-12-26 17:22:19 +00:00
Emanuele Aliberti
6b50f46c2f Some old Fs/Po code added to the makefile
svn path=/trunk/; revision=902
1999-12-26 16:36:46 +00:00
David Welch
4d5643a96a Added some security functions
Changes to csrss console support
Fixed bug in gdt.c

svn path=/trunk/; revision=901
1999-12-26 15:50:53 +00:00
Eric Kohl
128cfc8af0 Fixed compiler warnings
svn path=/trunk/; revision=900
1999-12-24 17:20:54 +00:00
Eric Kohl
a7a23b4dc3 Added missing test
svn path=/trunk/; revision=899
1999-12-24 17:16:32 +00:00
David Welch
dbd051cad4 Corrected additional object manager issues pointed by Philip Susi
Began added console i/o code to csrss (not working yet)
Corrected long standing page fault bug (not zeroing allocated page)

svn path=/trunk/; revision=898
1999-12-22 14:48:30 +00:00
Phillip Susi
1667a4589a fixed typeo
svn path=/trunk/; revision=897
1999-12-20 21:30:13 +00:00
Eric Kohl
6a617736e9 Fixed a compiler warning
svn path=/trunk/; revision=896
1999-12-20 21:05:53 +00:00
Phillip Susi
d832a87f14 fixed missing dereference and cleaned up code in NtCreateEvent
svn path=/trunk/; revision=895
1999-12-20 20:49:27 +00:00
David Welch
13541861b1 Fixed problem with handles not being released
Changed page fault handling to take account of the error code
Changed handle table locking

svn path=/trunk/; revision=894
1999-12-20 02:14:40 +00:00
Phillip Susi
dfa5f04c63 merged better assert code back into main trunk
svn path=/trunk/; revision=893
1999-12-18 19:50:24 +00:00
David Welch
cc5dc64c30 Worked around compiler bug in NtDelayExecution
Added some page free checking
Reorganised thread code a bit

svn path=/trunk/; revision=892
1999-12-18 17:48:23 +00:00
Emanuele Aliberti
8abc09ec0d Versio info actually linked in *.sys modules
svn path=/trunk/; revision=891
1999-12-18 10:17:42 +00:00
Emanuele Aliberti
5b86e3a918 RtlNtStatusToDosError and RtlNtStatusToPsxErrno declared __stdcall
svn path=/trunk/; revision=890
1999-12-18 10:16:11 +00:00
Emanuele Aliberti
e5b9e13d59 Minor changes
svn path=/trunk/; revision=889
1999-12-18 10:15:11 +00:00
Phillip Susi
bfaef27782 Added tracking of running threads in a process, and termination of process when all threads terminate
svn path=/trunk/; revision=888
1999-12-18 07:33:53 +00:00
Phillip Susi
4e94397e24 Added list of threads in process
svn path=/trunk/; revision=887
1999-12-18 07:28:28 +00:00
Phillip Susi
683932b845 changed to use proper type for dispatcher header, instead of PVOID in WAIT_BLOCK
svn path=/trunk/; revision=886
1999-12-17 23:30:48 +00:00
Phillip Susi
4ce5c9d3b4 fixed WaitForMultipleObjects()'s handling of the WaitAll flag
svn path=/trunk/; revision=885
1999-12-17 23:24:27 +00:00
Phillip Susi
6b53b3acea Working and tested KeWaitForXXX
svn path=/trunk/; revision=884
1999-12-17 23:23:36 +00:00
Eric Kohl
81547d8842 Added missing .cvsignore file
svn path=/trunk/; revision=883
1999-12-16 23:09:34 +00:00
Eric Kohl
1b0b103796 Added a time conversion function and fixed a little bug
(fat stores only 2 second steps)

svn path=/trunk/; revision=882
1999-12-16 23:08:17 +00:00
Phillip Susi
98a6084104 found that list corruption bug. it was also resulting in a meory spray
svn path=/trunk/; revision=881
1999-12-16 22:59:03 +00:00
Phillip Susi
96aed594a2 fixed CreateEvent() with NULL name
svn path=/trunk/; revision=879
1999-12-16 17:48:43 +00:00
Phillip Susi
ca6a107ee2 fixed a few bugs in wait code
svn path=/trunk/; revision=878
1999-12-16 05:13:06 +00:00
Phillip Susi
414cd229d9 new event test app
svn path=/trunk/; revision=877
1999-12-16 05:12:12 +00:00
Eric Kohl
a09b668be6 Added missing .cvsignore file
svn path=/trunk/; revision=876
1999-12-16 00:15:19 +00:00
Phillip Susi
7f63532d94 fixed timeout on wait functions
svn path=/trunk/; revision=875
1999-12-15 06:48:10 +00:00
Eric Kohl
8bbcdc3d4a Fixed current directory handling
Added new prompt functions
Fixed dangling pointer bug in copy command

svn path=/trunk/; revision=874
1999-12-15 00:50:41 +00:00
Phillip Susi
43d5d0b2f0 used proper type pointer instead of PVOID
svn path=/trunk/; revision=873
1999-12-14 18:44:38 +00:00
Phillip Susi
a409988b36 missing initialization of Thread->Tcb.WaitBlockList
svn path=/trunk/; revision=872
1999-12-14 18:35:19 +00:00
Phillip Susi
33009b967e bug fix with file object's name being freed but the pointer not NULLed
svn path=/trunk/; revision=871
1999-12-14 18:32:38 +00:00
Phillip Susi
4c2f15bfb9 fixed runnable thread counters
svn path=/trunk/; revision=870
1999-12-14 00:54:29 +00:00
David Welch
c40b27bbc4 Forgot to remove obsolete file
svn path=/trunk/; revision=869
1999-12-13 23:07:49 +00:00
David Welch
ac7a3aa542 Reworked APC and waiting code, seems more stable now
KeWaitForMultipleObjects is broken, shouldn't be difficult to fix
Corrected bug in ntdll ldr which prevented VC applications being loaded
Added thread testing application
Tried to make thread termination reentrant
Improved stack frame dump

svn path=/trunk/; revision=868
1999-12-13 22:04:41 +00:00
Phillip Susi
90e6a2244e missing GetEnvironmentStrings export, was supposed to be aliased to GetEnvironmentStringsA for some reason, as NT's exports it, and ros's cmd.exe imports it.
svn path=/trunk/; revision=867
1999-12-12 07:59:41 +00:00
Phillip Susi
8c2f4d55e3 David forgot to take out a debugging line? Prevented process termination on user mode exception
svn path=/trunk/; revision=866
1999-12-12 06:09:29 +00:00
Phillip Susi
9a22766e36 new APC code ready for prime time
svn path=/trunk/; revision=865
1999-12-12 03:56:53 +00:00
Phillip Susi
53b1677997 new APC code ready for prime time
svn path=/trunk/; revision=864
1999-12-12 03:48:47 +00:00
David Welch
2cecd9846d Removed typo.
svn path=/trunk/; revision=863
1999-12-12 01:04:09 +00:00
David Welch
f822a2a9d9 Backed out Philip Susi's changes for further testing
Returned kernel to working state.
Made exception handling more tolerant

svn path=/trunk/; revision=862
1999-12-12 00:59:39 +00:00
Phillip Susi
a590b25e46 fixed thread dispatcher bug with spin lock
svn path=/trunk/; revision=861
1999-12-12 00:49:00 +00:00
Phillip Susi
5d2dc4de65 fixed bug caused by my APC code
svn path=/trunk/; revision=860
1999-12-12 00:44:39 +00:00
Eric Kohl
55fef42029 Added abs() and labs()
svn path=/trunk/; revision=859
1999-12-12 00:20:29 +00:00
Eric Kohl
0ce89e21d9 fixed a compiler warning
svn path=/trunk/; revision=858
1999-12-12 00:08:41 +00:00
David Welch
910f27a570 Put in updated version of bitops header
Corrected bug in loader with mapping sections with zero VirtualSize
Corrected bug in the vfat driver that accessed freed memory
General cleanup of the vfat driver

svn path=/trunk/; revision=857
1999-12-11 21:14:49 +00:00
Phillip Susi
14ac854378 fixed DPC and APC calling code
svn path=/trunk/; revision=856
1999-12-11 17:31:16 +00:00
Phillip Susi
e0e40991af thread priorities, and some APC work
svn path=/trunk/; revision=855
1999-12-11 17:26:43 +00:00
Phillip Susi
db262c9a74 reworked the APC code, they shold now be delivered properly when the IRQL falls below APC_LEVEL, and when there are more than one queued.
Added support for KeAddThreadTimeout() to time out
Fixed wait code to use the WaitStatus of the thread when it wakes up

svn path=/trunk/; revision=854
1999-12-11 17:25:27 +00:00
Phillip Susi
81310b4307 added DPC for timers to KTHREAD, and fixed ApcState
svn path=/trunk/; revision=853
1999-12-11 17:19:32 +00:00
Phillip Susi
77c8585f1c added initialization for APCs
svn path=/trunk/; revision=852
1999-12-11 06:40:08 +00:00
Phillip Susi
43f46ed4f8 at least it compiles now...
svn path=/trunk/; revision=851
1999-12-11 06:39:30 +00:00
Eric Kohl
66f738dbd1 cleanup
svn path=/trunk/; revision=850
1999-12-11 01:44:29 +00:00
Eric Kohl
45043db6ff Added waiting for port requests
svn path=/trunk/; revision=849
1999-12-11 01:42:44 +00:00
Phillip Susi
b14104f1e7 ooops... fix that..
svn path=/trunk/; revision=848
1999-12-10 22:25:18 +00:00
Phillip Susi
424d757107 added initial priorities to threads and processes
svn path=/trunk/; revision=847
1999-12-10 22:07:23 +00:00
Eric Kohl
a1c7df6990 Fixed command line code.
Fixed Rtl string functions.

svn path=/trunk/; revision=846
1999-12-10 17:49:21 +00:00
David Welch
c7b7c5b0b6 Modified LPC implementation to be closer to nt.
Did some initial work on support for paging
Switched some test application from using our special startup code
Correctly bug in DPC code (possible fix for "releasing unacquired spinlock" error")

svn path=/trunk/; revision=845
1999-12-10 17:04:37 +00:00
Phillip Susi
815a52debe fixed IoCompleteRequest() to give priority boost even when target thread != current thread
svn path=/trunk/; revision=844
1999-12-09 19:39:45 +00:00
Paolo Pantaleo
dbf662da37 4nt's CTRL-D and CRTL-K support
svn path=/trunk/; revision=843
1999-12-09 19:20:47 +00:00
Eric Kohl
5d99e9003a dll name comparison in LdrFindDll() must be case-insensitive
svn path=/trunk/; revision=842
1999-12-09 19:14:45 +00:00
Eric Kohl
ec235d7468 Fixed HalQueryRealTimeClock and HalSetRealTimeClock.
Thanks to Adam Polanski.

svn path=/trunk/; revision=841
1999-12-09 08:16:26 +00:00
Rex Jolliff
f09720f7d7 some more video code
svn path=/trunk/; revision=840
1999-12-09 02:45:06 +00:00
Paolo Pantaleo
258912bf48 fixed a stupid bug in history
minor chage to GetConsoleHandle

svn path=/trunk/; revision=839
1999-12-08 18:18:23 +00:00
Eric Kohl
9d84d82bd7 pointer to PEB becomes first parameter in call to NtProcessStartup
svn path=/trunk/; revision=838
1999-12-08 12:59:35 +00:00
Phillip Susi
904da6e474 disable interrupts first, then do work. Use HLT also instead of busy wait
svn path=/trunk/; revision=837
1999-12-08 06:34:25 +00:00
Paolo Pantaleo
915ff9328d history cleanup added
svn path=/trunk/; revision=836
1999-12-07 18:17:17 +00:00
Paolo Pantaleo
61c3984818 TAS searches in internal commands too
svn path=/trunk/; revision=835
1999-12-07 18:16:24 +00:00
Eric Kohl
4a02ce0c1e fixed typo
svn path=/trunk/; revision=834
1999-12-07 17:23:42 +00:00
Paolo Pantaleo
f30ade19b8 new history implementation, not complete yet...
svn path=/trunk/; revision=833
1999-12-06 19:26:49 +00:00
Phillip Susi
9530a7d656 fixed handling of enter with blank line, also by my good pal, jim4
svn path=/trunk/; revision=832
1999-12-06 06:53:24 +00:00
Phillip Susi
5716745a13 fixed for 25 line mode as it should be, and scrolling by my good pal, jim4
svn path=/trunk/; revision=831
1999-12-06 06:43:45 +00:00
Phillip Susi
680589c149 fixed default bochs log port
svn path=/trunk/; revision=830
1999-12-06 05:48:34 +00:00
Eric Kohl
2efd99afb2 removed outdated cmd
svn path=/trunk/; revision=829
1999-12-06 00:30:09 +00:00
Eric Kohl
b001203a86 - implemented process parameter block (PPB) code
- improved process environment block (PEB) code
- improved environment code

svn path=/trunk/; revision=828
1999-12-06 00:25:14 +00:00
Phillip Susi
09edfdc32f forgot to initialize Create member of OBJECT_TYPE for threads
svn path=/trunk/; revision=827
1999-12-05 23:23:50 +00:00
Phillip Susi
ae12418822 fixed sync problem: set dpc lock field before, rather than after droping the spin lock
svn path=/trunk/; revision=826
1999-12-05 19:26:11 +00:00
Phillip Susi
f9d4545552 fixed sync bug by elevating IRQL
svn path=/trunk/; revision=825
1999-12-05 08:30:10 +00:00
Emanuele Aliberti
bb25ff0f3a Minor changes.
svn path=/trunk/; revision=824
1999-12-04 21:11:00 +00:00
Emanuele Aliberti
4b70175e11 RtlNtStatusToPsxErrno stub added.
svn path=/trunk/; revision=823
1999-12-04 21:03:22 +00:00
Emanuele Aliberti
ba58b241e5 Added version resource to dd and fs.
svn path=/trunk/; revision=822
1999-12-04 20:58:45 +00:00
Eric Kohl
7c574c2d6e fixed compiler warnings
svn path=/trunk/; revision=821
1999-12-04 14:54:50 +00:00
Phillip Susi
47551b9846 ignore buildno.h
svn path=/trunk/; revision=819
1999-12-04 08:02:27 +00:00
Phillip Susi
d0c1e25256 fixed timers and a wait functions, and a few bugs
svn path=/trunk/; revision=818
1999-12-04 07:40:53 +00:00
Phillip Susi
d4c340c696 fixed ide.sys to run under bochs, disabled support for more than one controller to do it. Let me know of this breaks on real hardware.
svn path=/trunk/; revision=817
1999-12-04 07:38:16 +00:00
Brian Palmer
43014d0391 Fixed bug in LdrPEProcessModule() so that it correctly section sizes
svn path=/trunk/; revision=816
1999-12-04 04:59:38 +00:00
Paolo Pantaleo
e28f90e740 now c:\ do not crash cmd
svn path=/trunk/; revision=815
1999-12-03 18:50:00 +00:00
David Welch
ead0eeacdd Some bug fixes.
Corrected LPC implementation.

svn path=/trunk/; revision=814
1999-12-02 20:53:55 +00:00
Boudewijn Dekker
cf693462e6 .
svn path=/trunk/; revision=813
1999-12-01 22:31:45 +00:00
Boudewijn Dekker
67ad8387f3 fixed some prototypes by adding stdcall attribute
svn path=/trunk/; revision=812
1999-12-01 22:30:48 +00:00
Eric Kohl
eae47571c9 fixed little bug
svn path=/trunk/; revision=811
1999-12-01 17:34:55 +00:00
Eric Kohl
2ea8bb5aa4 minor improvements
svn path=/trunk/; revision=810
1999-12-01 15:22:49 +00:00
Eric Kohl
13436cd7f7 - added environment functions
- moved ntdll-only prototypes into ntdll header file

svn path=/trunk/; revision=809
1999-12-01 15:18:54 +00:00
Eric Kohl
3bee100dae Cleanup
svn path=/trunk/; revision=808
1999-12-01 15:10:42 +00:00
Eric Kohl
2eccd28b8f Fixed a typo
svn path=/trunk/; revision=807
1999-12-01 15:08:31 +00:00
Paolo Pantaleo
d2c016b5ab just fixed a stupid bug
svn path=/trunk/; revision=806
1999-11-29 18:25:05 +00:00
Emanuele Aliberti
b72dc46819 Almost complete skeleton for tdi.sys,
yet headers are still missing.

svn path=/trunk/; revision=805
1999-11-28 07:59:29 +00:00
Eric Kohl
e2e5efb9d7 fixed a typo
svn path=/trunk/; revision=804
1999-11-28 01:55:41 +00:00
Paolo Pantaleo
6d3a97eb5e type accepts more than one file specification
F3 working in command line history (for now simply the same as up arrow)

svn path=/trunk/; revision=803
1999-11-27 19:14:59 +00:00
Eric Kohl
0d630c9ee3 added atoi() and atol()
svn path=/trunk/; revision=802
1999-11-27 11:32:43 +00:00
Eric Kohl
8b829113cb - changed InitializeObjectAttributes() from a function to a macro
- fixed STDCALL more issues
- changed some RtlLargeIntegerXxx functions to macros

svn path=/trunk/; revision=801
1999-11-27 03:32:55 +00:00
Brian Palmer
c18e7f06ce *** empty log message ***
svn path=/trunk/; revision=800
1999-11-26 21:45:23 +00:00
Jason Filby
dfa8364302 *** empty log message ***
svn path=/trunk/; revision=799
1999-11-26 20:53:32 +00:00
Eric Kohl
ed3ca3d52c More runtime functions
svn path=/trunk/; revision=798
1999-11-25 23:45:30 +00:00
Eric Kohl
e77c8000db Fixed typo
svn path=/trunk/; revision=797
1999-11-25 23:37:02 +00:00
Eric Kohl
05a567fce3 More runtime functions
svn path=/trunk/; revision=796
1999-11-25 23:35:24 +00:00
David Welch
9b614b887d Corrected ntdll mapping bug
Implemented prototype lpc mechanism

svn path=/trunk/; revision=795
1999-11-25 10:47:58 +00:00
Emanuele Aliberti
1a0765f6c5 Some NdisXYZ stubs for NDIS.SYS.
svn path=/trunk/; revision=794
1999-11-24 23:11:17 +00:00
Emanuele Aliberti
ec4a27aeb7 Initial makefile for NDIS.SYS
svn path=/trunk/; revision=793
1999-11-24 23:06:24 +00:00
David Welch
b986ce1cac Began converting minix fsd to work with new caching mechanism
Implemented user-mode APCs (still some bugs)
Began implementing shared memory, still some locking issues

svn path=/trunk/; revision=792
1999-11-24 11:51:55 +00:00
Emanuele Aliberti
e510811de7 Some fixes in the TDI initial files.
svn path=/trunk/; revision=791
1999-11-21 23:48:14 +00:00
Rex Jolliff
a7e6e9c1f8 more win32k code
svn path=/trunk/; revision=790
1999-11-21 18:39:11 +00:00
Eric Kohl
64915d3ebe Added missing STDCALL.
svn path=/trunk/; revision=789
1999-11-20 21:59:39 +00:00
Eric Kohl
c8689122b1 Fixed typo.
svn path=/trunk/; revision=788
1999-11-20 21:53:53 +00:00
Eric Kohl
e0c1e02c47 Fixed compiler warning
svn path=/trunk/; revision=787
1999-11-20 21:51:19 +00:00
Eric Kohl
b09592bf32 Major update to Rtl string functions.
svn path=/trunk/; revision=786
1999-11-20 21:49:23 +00:00
Emanuele Aliberti
174adb3955 Some more stubs files for the TDI kernel module.
svn path=/trunk/; revision=785
1999-11-20 20:41:29 +00:00
Emanuele Aliberti
8a20ddc7d4 Initial files for the TCP/IP stack kernel module.
svn path=/trunk/; revision=784
1999-11-20 20:36:46 +00:00
Emanuele Aliberti
82a0c31208 Initial networking code layout.
svn path=/trunk/; revision=783
1999-11-20 10:21:18 +00:00
Rex Jolliff
d25098ba0c added ignore file
svn path=/trunk/; revision=782
1999-11-18 19:25:35 +00:00
Rex Jolliff
aba30a453f added some DDI functions to table
svn path=/trunk/; revision=781
1999-11-18 18:58:16 +00:00
Boudewijn Dekker
fde8b62215 added misc/res.c
svn path=/trunk/; revision=780
1999-11-17 21:33:44 +00:00
Boudewijn Dekker
e04faee634 fixed some bugs in LdrLoadDll
svn path=/trunk/; revision=779
1999-11-17 21:32:57 +00:00
Boudewijn Dekker
0d7b93783b no message
svn path=/trunk/; revision=778
1999-11-17 21:30:00 +00:00
Boudewijn Dekker
b361e13fab implemented LoadResource/FlushViewOfFile
svn path=/trunk/; revision=777
1999-11-17 21:28:08 +00:00
Boudewijn Dekker
44744d8d36 implemented LoadResource
svn path=/trunk/; revision=776
1999-11-17 21:21:08 +00:00
Boudewijn Dekker
614f99e406 implemented FlushViewOfFile in kernel32
svn path=/trunk/; revision=775
1999-11-17 21:20:15 +00:00
Rex Jolliff
6e605e712e fixed reference to abs
svn path=/trunk/; revision=774
1999-11-17 21:17:10 +00:00
Rex Jolliff
96d5e2c715 Added top level ignore list
svn path=/trunk/; revision=773
1999-11-17 20:54:05 +00:00
Rex Jolliff
6767fd7f43 Fixed BMI typedef
svn path=/trunk/; revision=772
1999-11-17 20:50:37 +00:00
Eric Kohl
85a3f3844c Started NLS support and improved Rtl string functions.
svn path=/trunk/; revision=771
1999-11-15 16:02:50 +00:00
Eric Kohl
c114003cb5 Added some RtlLargeInteger functions.
svn path=/trunk/; revision=770
1999-11-15 16:01:32 +00:00
Eric Kohl
c52cbf8517 Fixed warning.
svn path=/trunk/; revision=769
1999-11-15 15:53:31 +00:00
Boudewijn Dekker
abd233d61a Implemented LdrFindResource_U and LdrAccessResource
svn path=/trunk/; revision=768
1999-11-14 13:04:46 +00:00
David Welch
b0ff680e0e 1) Corrected bugs in ERESOURCE code
and added test
2) Moved some files which are only
architecture-dependant out of the hal
3) Corrected timer implementation (it
should now be possible to use them as dispatcher
objects)
4) Corrected stupid bug in dpc code
5) Made thread list locking more sensible
6) Altered system call handler to build a
proper context in preparation for implementing APCs
7) Rationalised the waiting code

svn path=/trunk/; revision=767
1999-11-12 12:01:17 +00:00
Rex Jolliff
1a8f8005ae fixed clean rule
svn path=/trunk/; revision=766
1999-11-12 00:16:51 +00:00
Rex Jolliff
5bc02dd95a Changed to support linux build
svn path=/trunk/; revision=765
1999-11-11 21:22:08 +00:00
Eric Kohl
44866ccf87 Fixed include bug with rosapps module.
svn path=/trunk/; revision=764
1999-11-09 18:17:10 +00:00
Eric Kohl
d431c0fa6d Fixed bug with gcc 2.95.2
svn path=/trunk/; revision=763
1999-11-09 18:15:16 +00:00
Eric Kohl
58b907b668 Added some RtlLargeInteger functions.
svn path=/trunk/; revision=762
1999-11-09 18:09:57 +00:00
Eric Kohl
761e03c5a1 Fixed memory functions.
svn path=/trunk/; revision=761
1999-11-09 18:07:50 +00:00
Eric Kohl
ea4204ce87 Changed to new HAL functions.
svn path=/trunk/; revision=760
1999-11-09 18:07:03 +00:00
Eric Kohl
eae6fb6efc Implemented ExInterlocked functions.
svn path=/trunk/; revision=759
1999-11-09 18:00:14 +00:00
Eric Kohl
157d5b3fa2 Added APC support to NtDeviceIoControlFile().
svn path=/trunk/; revision=758
1999-11-07 14:08:11 +00:00
Emanuele Aliberti
63665d54ed advapi32 ACE and ACL stubs.
svn path=/trunk/; revision=757
1999-11-07 08:04:55 +00:00
Emanuele Aliberti
eb2d1c2110 advapi32 compiles OK.
Build number auto-generated (see apps/buildno, include/reactos/version.h,
include/reactos/buildno.h).
include/internal/version.h moved in include/reactos.
Added default search paths for includes in .rc rule (rules.mak).

svn path=/trunk/; revision=756
1999-11-07 08:03:28 +00:00
Eric Kohl
dbbb7e41f0 Keep DEL quiet when called from a batch file.
svn path=/trunk/; revision=754
1999-11-06 00:53:33 +00:00
Eric Kohl
6758f479ef New Y command and some fixes.
svn path=/trunk/; revision=753
1999-11-05 20:41:17 +00:00
Eric Kohl
18a01fd10d Implemented 4nt compatible color command.
svn path=/trunk/; revision=752
1999-11-04 11:29:36 +00:00
Emanuele Aliberti
cfb22d72df Typo in the NTOSKRNL import library fixed
svn path=/trunk/; revision=751
1999-11-04 06:41:47 +00:00
David Welch
83c2d22a5e Improved scheduling code
Fixed win32k.sys entrypoint (otherwise it crashes on startup)
Included unix install script
Broke waiting for a thread to terminate (but will fix later)
Added spinlock debugging code
Improved InterlockXXXX functions
Added hooks for monitoring system calls and thread startup

svn path=/trunk/; revision=750
1999-11-02 08:55:45 +00:00
Emanuele Aliberti
96c9969a90 Various changes related to calling convention fixes
svn path=/trunk/; revision=749
1999-10-31 22:44:39 +00:00
Emanuele Aliberti
f0f8791763 W32kSetTextColor, W32GetDCState16 needed __stdcall; changed the subsystem field from windows to native
svn path=/trunk/; revision=748
1999-10-31 22:43:40 +00:00
Emanuele Aliberti
31c5b7839f RtlFillMemory, RtlMoveMemory, RtlZeroMemory needed __stdcall
svn path=/trunk/; revision=747
1999-10-31 22:41:49 +00:00
Emanuele Aliberti
dabbe50e39 LoadLibraryA, GetProcAddress, FreeLibrary, GetModuleHandleA, WriteFileEx needed __stdcall
svn path=/trunk/; revision=746
1999-10-31 22:41:15 +00:00
Emanuele Aliberti
68fbd54f2c KeDelayExecutionThread exported by ntoskrnl with correct calling convention (__stdcall)
svn path=/trunk/; revision=745
1999-10-30 21:24:37 +00:00
Rex Jolliff
766e6a262e added more KMGDI functions
svn path=/trunk/; revision=744
1999-10-29 01:58:20 +00:00
Rex Jolliff
c1795e9778 fixed problem with redefined status values
svn path=/trunk/; revision=743
1999-10-28 23:37:58 +00:00
Rex Jolliff
f886c2b9d6 added several new functions
svn path=/trunk/; revision=742
1999-10-28 23:37:14 +00:00
Rex Jolliff
7d45bbd5da needed for compile
svn path=/trunk/; revision=741
1999-10-28 23:35:34 +00:00
Rex Jolliff
8d87ab9d07 added fix for compile under linux
svn path=/trunk/; revision=740
1999-10-28 23:34:47 +00:00
Eric Kohl
95fcdd0943 Fixed batch mode bugs.
svn path=/trunk/; revision=739
1999-10-28 23:09:59 +00:00
Rex Jolliff
11d7e1e18c Fixed problems with vidport and vga loading
svn path=/trunk/; revision=738
1999-10-28 06:58:05 +00:00
Eric Kohl
863afe8930 Disabled prompting when in batch mode.
svn path=/trunk/; revision=737
1999-10-27 22:46:53 +00:00
Rex Jolliff
788e4dc053 Fix import problems in win32k.sys
svn path=/trunk/; revision=736
1999-10-27 05:49:58 +00:00
Emanuele Aliberti
125a62f79a An attempt to fix the ntdll not found bug.
svn path=/trunk/; revision=735
1999-10-26 19:47:06 +00:00
Rex Jolliff
99d62b4808 added check for bootloader config hive
svn path=/trunk/; revision=734
1999-10-26 04:52:39 +00:00
Rex Jolliff
3c1e76b027 Some small fixes to reported build problems
svn path=/trunk/; revision=733
1999-10-25 06:58:09 +00:00
Eric Kohl
2bd986927c Added some time related functions.
svn path=/trunk/; revision=732
1999-10-24 17:52:17 +00:00
Rex Jolliff
ad5e850736 Changes to get video drivers and win32k to load
svn path=/trunk/; revision=731
1999-10-24 17:07:57 +00:00
Rex Jolliff
6cc79a481e added some Eng funcs into build list
svn path=/trunk/; revision=730
1999-10-23 22:40:49 +00:00
Rex Jolliff
c0b2b118a0 Cleanup to make buildable
svn path=/trunk/; revision=729
1999-10-23 22:39:27 +00:00
Rex Jolliff
a53e883bb0 Added definitions for some eng funcs
svn path=/trunk/; revision=728
1999-10-23 22:38:26 +00:00
Rex Jolliff
bb0715f8e7 Added IOCTL codes for video drivers
svn path=/trunk/; revision=727
1999-10-23 22:37:11 +00:00
Rex Jolliff
bc08c68af9 Added vidport.sys to auto loaded drivers
svn path=/trunk/; revision=726
1999-10-23 18:58:40 +00:00
Rex Jolliff
28df2503d3 fixed handling of boot drivers
svn path=/trunk/; revision=725
1999-10-23 18:56:04 +00:00
Rex Jolliff
a5dd3430d6 fixed dist and floppy rule
svn path=/trunk/; revision=724
1999-10-23 18:33:38 +00:00
Eric Kohl
36f33622cc Fixed bugs and added DIRS command.
svn path=/trunk/; revision=723
1999-10-23 18:17:37 +00:00
Eric Kohl
583a7209da Added BOOT.BAT
svn path=/trunk/; revision=722
1999-10-23 18:15:39 +00:00
Eric Kohl
727671f12a Added Ctrl-C/Ctrl-Break handler.
svn path=/trunk/; revision=721
1999-10-22 20:35:02 +00:00
Eric Kohl
13e2e79e44 Added missing exports.
svn path=/trunk/; revision=720
1999-10-21 16:13:39 +00:00
Eric Kohl
0300e2a9d1 Fixed floppy and dist targets.
svn path=/trunk/; revision=719
1999-10-21 16:12:16 +00:00
Eric Kohl
ec16aa4c44 Improved debug output and
added hal READ_XXX and WRITE_XXX functions.

svn path=/trunk/; revision=718
1999-10-21 13:11:12 +00:00
Eric Kohl
e6f624f0e7 Improved debug output and
added hal READ_XXX and WRITE_XXX functions.

svn path=/trunk/; revision=717
1999-10-21 13:00:09 +00:00
Eric Kohl
7228dc135c Improved debug output and
added hal READ_XXX and WRITE_XXX functions.

svn path=/trunk/; revision=716
1999-10-21 11:13:38 +00:00
Eric Kohl
d2e85caa9e Improved debug output and
added hal READ_XXX and WRITE_XXX functions.

svn path=/trunk/; revision=715
1999-10-21 10:59:32 +00:00
Rex Jolliff
bff71dc524 Changed name to conform with kernel naming convention
svn path=/trunk/; revision=714
1999-10-20 23:09:26 +00:00
Rex Jolliff
a0570e7cbe added ignore files
svn path=/trunk/; revision=713
1999-10-20 23:08:58 +00:00
Boudewijn Dekker
ff9ce85a65 implemented some ldr functions
svn path=/trunk/; revision=712
1999-10-18 21:55:30 +00:00
Boudewijn Dekker
f3d9743503 implemented LdrUnloadDll
svn path=/trunk/; revision=711
1999-10-18 21:37:16 +00:00
Boudewijn Dekker
a66a6e5dba implemented LoadLibray and FreeLibrary
svn path=/trunk/; revision=710
1999-10-17 18:18:44 +00:00
Boudewijn Dekker
8690858184 implemented a reference count on LdrLoadDll
svn path=/trunk/; revision=709
1999-10-17 18:16:45 +00:00
Eric Kohl
9e4fec3838 Updated info about debugging.
svn path=/trunk/; revision=708
1999-10-16 21:10:23 +00:00
Eric Kohl
8001413b88 More exported functions.
svn path=/trunk/; revision=707
1999-10-16 21:09:12 +00:00
Eric Kohl
bae73138e8 Moved serial and bochs debug output.
svn path=/trunk/; revision=706
1999-10-16 21:08:39 +00:00
Eric Kohl
dad291cf6f Some fixes.
svn path=/trunk/; revision=705
1999-10-16 12:41:42 +00:00
Eric Kohl
22b26024cd More exported functions.
svn path=/trunk/; revision=704
1999-10-16 12:40:57 +00:00
Eric Kohl
3e6e6c12ee Added missing ntdll include.
svn path=/trunk/; revision=703
1999-10-16 12:39:44 +00:00
Eric Kohl
93a0fa88d2 Fixed NtCreatePort() prototype.
svn path=/trunk/; revision=702
1999-10-16 12:38:53 +00:00
Eric Kohl
9b2fc03fc7 Fixed $(NASM_CMD) bug.
svn path=/trunk/; revision=701
1999-10-16 12:36:47 +00:00
Eric Kohl
7975fc7fe7 Minor improvements.
svn path=/trunk/; revision=700
1999-10-16 12:35:10 +00:00
Eric Kohl
a23adc0492 Fixed hal display and initialization code.
svn path=/trunk/; revision=699
1999-10-16 00:17:40 +00:00
Eric Kohl
36e229b42f Fixed a typo.
svn path=/trunk/; revision=698
1999-10-15 15:26:34 +00:00
Eric Kohl
29812be566 Fixed hal display and initialization code.
svn path=/trunk/; revision=697
1999-10-15 15:21:39 +00:00
Eric Kohl
4551dfba1e Replaced calls to _printk() by calls to DbgPrint().
svn path=/trunk/; revision=696
1999-10-14 16:54:17 +00:00
Eric Kohl
babfe77ea9 PEB will be created in NtCreateProcess.
svn path=/trunk/; revision=695
1999-10-13 22:35:55 +00:00
Emanuele Aliberti
81a9f1c4b0 Little changes in the psxdll library.
svn path=/trunk/; revision=694
1999-10-12 21:19:40 +00:00
Boudewijn Dekker
74031c2379 implemented LoadLibrary and some Rtl stubs
svn path=/trunk/; revision=693
1999-10-12 19:45:01 +00:00
Eric Kohl
348ccdd39f Added REBOOT command.
svn path=/trunk/; revision=692
1999-10-11 20:51:07 +00:00
Eric Kohl
1d4d689bf2 Added new display and reboot code.
svn path=/trunk/; revision=691
1999-10-11 20:50:33 +00:00
Eric Kohl
8578ba8ac6 Minor fix to teb allocation.
svn path=/trunk/; revision=690
1999-10-11 20:43:10 +00:00
Eric Kohl
a77eef4a53 Fixed header inclusion order.
svn path=/trunk/; revision=689
1999-10-10 19:53:46 +00:00
Eric Kohl
648301897c Fixed header inclusion order.
svn path=/trunk/; revision=687
1999-10-07 23:46:27 +00:00
Emanuele Aliberti
2076e94020 I removed a pair of stubs for the OpenFileMapping functions
svn path=/trunk/; revision=686
1999-10-03 23:19:15 +00:00
Eric Kohl
c2829c9869 Minor fixes.
svn path=/trunk/; revision=685
1999-10-03 22:20:33 +00:00
Eric Kohl
49f51f37f3 Added activate command.
svn path=/trunk/; revision=684
1999-10-03 22:16:14 +00:00
Eric Kohl
1e637da493 Added echos, echoerr and echoserr commands.
svn path=/trunk/; revision=683
1999-10-03 22:15:33 +00:00
Eric Kohl
51cbed48ab No longer needed.
svn path=/trunk/; revision=682
1999-10-03 22:14:40 +00:00
Eric Kohl
e8abc51177 Minor fixes.
svn path=/trunk/; revision=681
1999-10-03 22:12:57 +00:00
Eric Kohl
29f5cf1341 Added floppy and dist targets.
svn path=/trunk/; revision=680
1999-10-03 22:12:24 +00:00
Eric Kohl
c33edc6cb7 Made notevil screen size aware.
svn path=/trunk/; revision=679
1999-10-03 22:10:15 +00:00
Boudewijn Dekker
1d786dd865 Miscellaneous implementation of kernel32 stubs.
Changed the implementation of ReadFileEx.

svn path=/trunk/; revision=678
1999-10-02 20:20:44 +00:00
Eric Kohl
3174c5069a Fixed typo.
svn path=/trunk/; revision=676
1999-09-29 23:19:32 +00:00
Eric Kohl
d63c23131c Fixed multiple STATUS_xxxx inclusions.
svn path=/trunk/; revision=675
1999-09-29 23:15:14 +00:00
Eric Kohl
56e30e8907 Minor updates and fixes.
svn path=/trunk/; revision=674
1999-09-27 22:15:44 +00:00
Eric Kohl
1241612f69 Added MORE command.
svn path=/trunk/; revision=673
1999-09-27 22:13:59 +00:00
Boudewijn Dekker
ddc9e680c9 Added support for critical sections.
svn path=/trunk/; revision=672
1999-09-27 20:58:46 +00:00
Boudewijn Dekker
15e29ff254 Small addition to token.c
svn path=/trunk/; revision=671
1999-09-25 06:25:51 +00:00
Eric Kohl
52498a577a Minor fixes.
svn path=/trunk/; revision=670
1999-09-24 22:05:25 +00:00
Eric Kohl
ee3dc0f0c1 Added window command.
svn path=/trunk/; revision=669
1999-09-24 22:03:11 +00:00
Emanuele Aliberti
58eedf7620 RtlReAllocHeap should be RtlReAllocateHeap
svn path=/trunk/; revision=668
1999-09-12 22:09:34 +00:00
Emanuele Aliberti
e6359887bb RtlReAllocHeap should be RtlReAllocateHeap.
svn path=/trunk/; revision=667
1999-09-12 21:59:40 +00:00
Emanuele Aliberti
cda1c38bae Some missing __stdcall added.
Some missing unicode functions stubs added.
RtlReAllocHeap should be RtlReAllocateHeap.

svn path=/trunk/; revision=666
1999-09-12 21:58:32 +00:00
Emanuele Aliberti
d82310b692 Skeleton for psxdll.dll
svn path=/trunk/; revision=665
1999-09-12 21:54:16 +00:00
Eric Kohl
45dd256ee3 Fixed typo.
svn path=/trunk/; revision=664
1999-09-12 20:58:29 +00:00
Eric Kohl
e0058203bb Fixed WaitForSingleObject() and WaitForMultipleObjects().
svn path=/trunk/; revision=663
1999-09-12 20:54:42 +00:00
Eric Kohl
3255097117 Stack is freed on failure.
svn path=/trunk/; revision=662
1999-09-12 20:49:06 +00:00
Eric Kohl
40f81ce970 Fixed some minor issues (NULL --> FALSE).
svn path=/trunk/; revision=661
1999-09-12 20:44:22 +00:00
Eric Kohl
bbcc7f9179 Fixed little bug ('cd d:' did't work, but 'cd D:').
svn path=/trunk/; revision=660
1999-09-12 20:41:56 +00:00
Eric Kohl
0c91339480 Added some more commands. Thanks to Dr. Faustus.
Some more cleanup.

svn path=/trunk/; revision=659
1999-09-12 18:23:31 +00:00
Eric Kohl
5249698af3 External TEE command.
svn path=/trunk/; revision=658
1999-09-12 18:20:47 +00:00
Eric Kohl
037d59aef7 Added master makefile with clean/dist/floppy targets.
svn path=/trunk/; revision=657
1999-09-12 18:18:09 +00:00
Eric Kohl
70f14aa73f Fixed typedef.
svn path=/trunk/; revision=656
1999-09-11 00:07:20 +00:00
Rex Jolliff
b779c01fb6 Changes to make win32k.sys compile
svn path=/trunk/; revision=655
1999-09-10 21:17:07 +00:00
Rex Jolliff
fe56845ebe Fixed function prototypes
svn path=/trunk/; revision=654
1999-09-10 21:16:36 +00:00
Rex Jolliff
70140f5ea7 Changed symbolic name for IDE devices
svn path=/trunk/; revision=653
1999-09-10 19:16:58 +00:00
Eric Kohl
fe27d316df Added creation of full user stack (including guard page).
svn path=/trunk/; revision=652
1999-09-10 15:50:30 +00:00
Eric Kohl
1fc6701c79 Implemented Nt/KeWaitForMultipleObjects (still buggy).
svn path=/trunk/; revision=651
1999-09-08 23:51:36 +00:00
Rex Jolliff
09d88da5e9 some minor coding on win32k
svn path=/trunk/; revision=650
1999-09-08 04:50:50 +00:00
Emanuele Aliberti
a06d619eca some symbols were not declared __stdcall
svn path=/trunk/; revision=649
1999-09-08 04:40:56 +00:00
Eric Kohl
242138f832 Fixed little bug.
svn path=/trunk/; revision=648
1999-09-07 20:41:47 +00:00
Emanuele Aliberti
af1ff6be3b More for the POSIX+ subsystem
svn path=/trunk/; revision=647
1999-09-07 17:12:39 +00:00
Eric Kohl
8c0b595a5e Thread improvements.
svn path=/trunk/; revision=646
1999-09-06 21:32:57 +00:00
Emanuele Aliberti
4280f4f60d stubs for HAL kernel debugger functions
svn path=/trunk/; revision=645
1999-09-05 20:54:57 +00:00
Eric Kohl
d5014c3bb3 Removed unused stuff.
svn path=/trunk/; revision=644
1999-09-05 12:40:20 +00:00
Eric Kohl
d81a116aba Run smss.exe instead of shell.exe.
svn path=/trunk/; revision=643
1999-09-05 12:39:45 +00:00
Eric Kohl
155d1ff5ae Removed smss from its old place
svn path=/trunk/; revision=642
1999-09-05 12:35:34 +00:00
Eric Kohl
fbccd722a1 Fixed little bug.
svn path=/trunk/; revision=641
1999-09-05 12:31:41 +00:00
Eric Kohl
648c68ff1a Moved smss to a better place.
svn path=/trunk/; revision=640
1999-09-05 12:29:50 +00:00
Eric Kohl
c92eafe2f1 Updated rules for subsys directory.
svn path=/trunk/; revision=639
1999-09-05 12:27:22 +00:00
Eric Kohl
b0e64d6cf7 Updated.
svn path=/trunk/; revision=638
1999-09-05 10:22:05 +00:00
Emanuele Aliberti
fa74a12186 added resource script with version information
svn path=/trunk/; revision=637
1999-09-04 20:50:34 +00:00
Eric Kohl
40bd704148 Implemented RtlCreateUserProcess() and RtlCreateUserThread().
svn path=/trunk/; revision=636
1999-09-04 18:38:29 +00:00
David Welch
4027ccab60 Correct keyboard bug with multiple readers
svn path=/trunk/; revision=634
1999-08-30 15:20:14 +00:00
Eric Kohl
ff511b446a Added MSGBOX and TIMER commands.
svn path=/trunk/; revision=633
1999-08-29 22:31:43 +00:00
David Welch
e31d342bc7 *** empty log message ***
svn path=/trunk/; revision=632
1999-08-29 13:45:08 +00:00
Emanuele Aliberti
7cf48757dc A top level header file for kernel and system stuff. At present simply includes ddk/ntddk.h.
svn path=/trunk/; revision=631
1999-08-29 07:02:52 +00:00
Emanuele Aliberti
07a2fbf7f7 Global ReactOS configuration file. Here we will put symbols for processor-, architecture-, and debugging-dependent conditional compilation.
svn path=/trunk/; revision=630
1999-08-29 07:01:32 +00:00
Emanuele Aliberti
fa3a5c2c71 some __stdcall fixes in ntoskrnl and ntdll
svn path=/trunk/; revision=629
1999-08-29 06:59:11 +00:00
Eric Kohl
5aaaad5c93 Added missing definition.
svn path=/trunk/; revision=628
1999-08-28 23:30:50 +00:00
Eric Kohl
7bcdd2ea10 Added CHOICE command and fixed a cursor bug.
svn path=/trunk/; revision=627
1999-08-22 21:46:50 +00:00
Eric Kohl
a35e54e5f8 Added CHOICE command and fixed a cursor bug.
svn path=/trunk/; revision=626
1999-08-21 22:06:03 +00:00
Eric Kohl
0b84d00506 Added CHOICE command and fixed a cursor bug.
svn path=/trunk/; revision=625
1999-08-21 21:54:30 +00:00
Boudewijn Dekker
c4385e9139 Small fixes
svn path=/trunk/; revision=624
1999-08-21 17:51:35 +00:00
Emanuele Aliberti
2c4de44226 Power management (Po) stubs.
svn path=/trunk/; revision=623
1999-08-20 16:31:17 +00:00
Emanuele Aliberti
1f636015ba NLS stubs and exported data.
svn path=/trunk/; revision=622
1999-08-20 16:30:16 +00:00
Emanuele Aliberti
e9703bfa98 FS stubs.
svn path=/trunk/; revision=621
1999-08-20 16:29:22 +00:00
Emanuele Aliberti
676e6609ce Kernel debugger stubs.
svn path=/trunk/; revision=620
1999-08-20 16:28:10 +00:00
Boudewijn Dekker
dbb9546d9d Small additions, not yet finished
svn path=/trunk/; revision=619
1999-08-20 10:12:53 +00:00
Boudewijn Dekker
007128eb66 Small additions, not yet finished
svn path=/trunk/; revision=618
1999-08-20 09:37:25 +00:00
Emanuele Aliberti
90129544e0 Fixed a bug in the parser.
svn path=/trunk/; revision=617
1999-08-20 05:53:04 +00:00
Eric Kohl
f72b0c8878 Fixed STDCALL bugs.
svn path=/trunk/; revision=616
1999-08-17 12:02:27 +00:00
Eric Kohl
36df88668d Fixed STDCALL bug.
svn path=/trunk/; revision=615
1999-08-15 00:36:59 +00:00
Rex Jolliff
9957d94c20 Various small changes for registry work
svn path=/trunk/; revision=614
1999-08-14 18:59:28 +00:00
Eric Kohl
2a466eda80 Partial Implementation of NtQuerySystemInformation and NtSetSystemInformation
svn path=/trunk/; revision=613
1999-08-11 23:29:26 +00:00
Emanuele Aliberti
6cb529270a Stubs for version.dll
svn path=/trunk/; revision=612
1999-08-11 19:56:48 +00:00
Emanuele Aliberti
cb7f83ac74 Some files for version.dll
svn path=/trunk/; revision=611
1999-08-10 20:21:32 +00:00
Rex Jolliff
9907c63794 Added STDCALL to Video functions
svn path=/trunk/; revision=610
1999-08-07 20:27:14 +00:00
Rex Jolliff
fc200ca733 Added export definition file and export library rule
svn path=/trunk/; revision=609
1999-08-06 17:27:45 +00:00
Jason Filby
bebdd316d5 *** empty log message ***
svn path=/trunk/; revision=608
1999-08-01 11:21:05 +00:00
Eric Kohl
e7cf9302fa Added more crt functions and fixed some.
svn path=/trunk/; revision=607
1999-07-29 21:25:04 +00:00
Emanuele Aliberti
69dc48c09f some work on fixing advapi32
svn path=/trunk/; revision=606
1999-07-26 20:46:40 +00:00
Eric Kohl
e3c471cf82 Added simple START command.
svn path=/trunk/; revision=605
1999-07-24 17:18:05 +00:00
Eric Kohl
0063a30376 Fixed a typo.
svn path=/trunk/; revision=604
1999-07-24 17:16:32 +00:00
Rex Jolliff
b9a38fb83d moved path functions into seperate file
svn path=/trunk/; revision=603
1999-07-23 20:21:06 +00:00
Rex Jolliff
1ff56406ca changes to support win32k
svn path=/trunk/; revision=602
1999-07-23 19:58:58 +00:00
Rex Jolliff
c69899317f finished win32k skeleton
svn path=/trunk/; revision=601
1999-07-23 19:57:18 +00:00
Rex Jolliff
b3995a1493 added a few pointer types
svn path=/trunk/; revision=600
1999-07-23 19:55:07 +00:00
Eric Kohl
3975f17012 Changes to compile advapi32.
svn path=/trunk/; revision=599
1999-07-22 21:36:37 +00:00
Rex Jolliff
3f261fab5d More changes to the win32k server
svn path=/trunk/; revision=598
1999-07-22 16:21:53 +00:00
Emanuele Aliberti
b6ae20fcd0 first bits for the POSIX+ client DLL
svn path=/trunk/; revision=597
1999-07-18 20:54:04 +00:00
Emanuele Aliberti
d2eea59593 original ntifs.h restored
svn path=/trunk/; revision=596
1999-07-18 07:53:27 +00:00
Emanuele Aliberti
6ac1592420 fixes
svn path=/trunk/; revision=595
1999-07-17 23:10:31 +00:00
Rex Jolliff
04f2911330 added dist rule
svn path=/trunk/; revision=593
1999-07-16 23:37:07 +00:00
Rex Jolliff
743df9ab84 fixed various build errors
svn path=/trunk/; revision=592
1999-07-13 01:08:47 +00:00
Rex Jolliff
e2a59404d8 added an ignore file
svn path=/trunk/; revision=591
1999-07-12 23:34:42 +00:00
Rex Jolliff
367fbb2a1f Added a service table registration function
svn path=/trunk/; revision=590
1999-07-12 23:32:30 +00:00
Rex Jolliff
932d4770ec more work on KMGDI subsystem
svn path=/trunk/; revision=589
1999-07-12 23:26:57 +00:00
Emanuele Aliberti
0584d3755f minor changes in the simple DEF-->EDF converter
svn path=/trunk/; revision=588
1999-07-12 21:02:06 +00:00
Emanuele Aliberti
221e27f1fa kernel32 missing stubs
svn path=/trunk/; revision=587
1999-07-12 21:01:06 +00:00
Boudewijn Dekker
581f2c7495 no message
svn path=/trunk/; revision=586
1999-07-11 14:19:14 +00:00
Rex Jolliff
6ef820374f put ifdef around defines
svn path=/trunk/; revision=585
1999-07-07 01:41:41 +00:00
Rex Jolliff
ce373b0c40 added pointer types for RECTL and POINTL
svn path=/trunk/; revision=584
1999-07-07 01:41:00 +00:00
Boudewijn Dekker
01034d9c59 no message
svn path=/trunk/; revision=583
1999-07-05 20:51:47 +00:00
Emanuele Aliberti
fad2f584e9 Bo's ntifs.h + ReactOS extensions (untested).
svn path=/trunk/; revision=582
1999-07-04 22:22:05 +00:00
Emanuele Aliberti
86b93a6ac8 A very simple application to create a named LPC port; application to connect to an existing LPC port updated.
svn path=/trunk/; revision=581
1999-07-04 22:04:31 +00:00
Emanuele Aliberti
6fcd126954 NtCreatePort and LPC_PORT_BASIC_INFORMATION partial definitions
svn path=/trunk/; revision=580
1999-07-04 22:00:31 +00:00
Boudewijn Dekker
2a01ea22a9 Initial commit. Ported some code from wine.
Not much working yet.

svn path=/trunk/; revision=579
1999-07-04 16:01:27 +00:00
Emanuele Aliberti
84d1d53870 Very simple tool to generate aliased *.def files from standard *.def files. May be used to have clean exports tables in DLLs and make ld link stdcall mangled symbols
svn path=/trunk/; revision=578
1999-07-04 11:14:15 +00:00
Rex Jolliff
5050cf437e Added brush scaffolding
svn path=/trunk/; revision=577
1999-07-02 02:33:59 +00:00
Rex Jolliff
9162781f47 more bitmap scaffolding
svn path=/trunk/; revision=576
1999-07-02 02:06:52 +00:00
Rex Jolliff
b63d64cc90 Bitmap scaffolding
svn path=/trunk/; revision=575
1999-07-02 00:54:01 +00:00
Rex Jolliff
858aaeac37 Moved service.h
svn path=/trunk/; revision=574
1999-06-30 22:28:34 +00:00
Eric Kohl
bd4786ea76 Fixed DeleteFileW().
svn path=/trunk/; revision=573
1999-06-27 23:08:31 +00:00
Eric Kohl
bcb831f3c9 Fixed RemoveDirectoryW().
svn path=/trunk/; revision=572
1999-06-27 23:08:07 +00:00
Eric Kohl
1bfb0f94d9 Added file and directory delete functionality (dummy).
svn path=/trunk/; revision=571
1999-06-27 23:06:50 +00:00
Eric Kohl
10f222cd92 Fixed typos.
svn path=/trunk/; revision=570
1999-06-27 13:02:20 +00:00
Eric Kohl
7f7c26ae4d Fixed irq level assertations (assert -> assert_irql).
svn path=/trunk/; revision=569
1999-06-27 13:01:23 +00:00
Emanuele Aliberti
56b4626f56 *** empty log message ***
svn path=/trunk/; revision=568
1999-06-27 07:15:16 +00:00
Emanuele Aliberti
b3f7f2d945 Clean up and more info about the LPC port handle.
svn path=/trunk/; revision=567
1999-06-27 07:11:25 +00:00
Eric Kohl
4d7dcc6886 Fixed application file name (absolute path) in command line.
svn path=/trunk/; revision=566
1999-06-26 18:24:38 +00:00
Eric Kohl
8ae06e50f1 Fixed typo in GetCommandLineA().
svn path=/trunk/; revision=565
1999-06-26 14:28:42 +00:00
Rex Jolliff
19a76ae9af consolidated makefiles and added floppy and dist rules.
svn path=/trunk/; revision=564
1999-06-25 04:36:03 +00:00
Emanuele Aliberti
15714a3ea7 Attempt to connect to a real LPC port
svn path=/trunk/; revision=563
1999-06-24 22:54:27 +00:00
Emanuele Aliberti
9ccf887c5a KeGetPreviousMode (useless)
svn path=/trunk/; revision=562
1999-06-24 22:40:06 +00:00
Boudewijn Dekker
62cdaf7f99 no message
svn path=/trunk/; revision=561
1999-06-24 21:59:41 +00:00
Emanuele Aliberti
fdb2041671 NtConnectPort partial interface
svn path=/trunk/; revision=560
1999-06-24 19:35:31 +00:00
Emanuele Aliberti
11cbd32ea6 Some more ideas for winlogon (it does not compile yet).
svn path=/trunk/; revision=559
1999-06-18 22:40:47 +00:00
Emanuele Aliberti
8d5b94094a NTOSKRNL.ZwXXX functions now call NTOSKRNL.NtXXX via int 0x2e.
svn path=/trunk/; revision=558
1999-06-18 22:11:21 +00:00
Emanuele Aliberti
3d0fe049f6 fixed my bug in ZwXXX stubs generation
svn path=/trunk/; revision=557
1999-06-17 18:09:27 +00:00
Emanuele Aliberti
1e589af8e1 genntdll enhanced to generate ntoskrnl Zw stubs (to be tested)
svn path=/trunk/; revision=556
1999-06-17 00:10:30 +00:00
Emanuele Aliberti
6409ce374c some ideas about LPC
svn path=/trunk/; revision=555
1999-06-15 23:00:39 +00:00
Rex Jolliff
11d31698d5 some additions to the GDI engine
svn path=/trunk/; revision=554
1999-06-15 02:27:24 +00:00
Rex Jolliff
e0c5a61982 untested implementation of the registry
svn path=/trunk/; revision=553
1999-06-14 07:37:55 +00:00
David Welch
d913de5c14 Fixed problem with dpc execution
svn path=/trunk/; revision=552
1999-06-10 20:59:19 +00:00
David Welch
5b3ccbfc02 Implemented ZwOpenProcess corrected
Implemented killing other threads (possible memory leaks)
Made a start on a proper implementation of APCs (based on NT Insider article)

svn path=/trunk/; revision=551
1999-06-09 15:50:16 +00:00
David Welch
f2a6a55325 Not needed anymore
svn path=/trunk/; revision=550
1999-06-09 15:48:56 +00:00
David Welch
4aa2c7952d Not been needed for ages
svn path=/trunk/; revision=549
1999-06-09 15:47:10 +00:00
David Welch
b54e7a6efa No longer need with rex's changes
svn path=/trunk/; revision=548
1999-06-09 15:46:06 +00:00
Emanuele Aliberti
8ae5eb02c7 Initial work for W32 server
svn path=/trunk/; revision=547
1999-06-08 22:50:59 +00:00
Emanuele Aliberti
34a9792f1e Updated to 0.0.14
svn path=/trunk/; revision=546
1999-06-08 22:47:39 +00:00
Emanuele Aliberti
44a536a421 Initial structure (won't compile)
svn path=/trunk/; revision=545
1999-06-08 22:45:53 +00:00
Emanuele Aliberti
c5e296fcf0 Updated to 0.0.14
RES_STR_FILE_VERSION eq RES_STR_PRODUCT_VERSION

svn path=/trunk/; revision=544
1999-06-08 22:37:30 +00:00
David Welch
c8cd1fe03c Added support for ZwOpenProcess
svn path=/trunk/; revision=543
1999-06-08 14:02:01 +00:00
Rex Jolliff
0a1f866c8f Added a few more functions for registry
svn path=/trunk/; revision=542
1999-06-08 07:11:29 +00:00
Rex Jolliff
a5e573f1b3 more hacking on the registry
svn path=/trunk/; revision=541
1999-06-08 04:34:48 +00:00
Rex Jolliff
06938a9103 more registry changes
svn path=/trunk/; revision=540
1999-06-07 15:14:23 +00:00
Emanuele Aliberti
b5118cc48f minor changes
svn path=/trunk/; revision=539
1999-06-06 20:35:26 +00:00
David Welch
31268dc661 Stub
svn path=/trunk/; revision=538
1999-06-06 16:40:10 +00:00
Emanuele Aliberti
9dc68f3b65 Context help functions stubs
svn path=/trunk/; revision=537
1999-06-06 15:34:09 +00:00
Emanuele Aliberti
1af4e48747 NtOpenProcess exported
svn path=/trunk/; revision=536
1999-06-06 15:31:58 +00:00
Emanuele Aliberti
154db698c9 start (to detach a new process) and kill commands added
svn path=/trunk/; revision=535
1999-06-06 15:29:46 +00:00
Boudewijn Dekker
f298282475 Added some user32 functions.
svn path=/trunk/; revision=534
1999-06-05 19:02:54 +00:00
Rex Jolliff
9083091f7b Added PE loader to LOADROS. Updated symbol search in Loader
svn path=/trunk/; revision=533
1999-06-04 23:59:35 +00:00
Rex Jolliff
c4ba9a330d some changes to registry code
svn path=/trunk/; revision=532
1999-06-03 15:07:49 +00:00
Boudewijn Dekker
46a0e6e16e Added stub for create token and delete object audit alarm.
svn path=/trunk/; revision=531
1999-05-31 18:53:33 +00:00
Boudewijn Dekker
f53177b2b2 Added prototype for create token.
svn path=/trunk/; revision=530
1999-05-31 18:50:11 +00:00
Emanuele Aliberti
380ae8a262 Session manager skeleton
svn path=/trunk/; revision=529
1999-05-30 20:40:18 +00:00
Rex Jolliff
28f788e6ed fixes for compile errors.
svn path=/trunk/; revision=528
1999-05-29 02:51:05 +00:00
David Welch
126768af64 Lots of changes to the kernel
svn path=/trunk/; revision=527
1999-05-29 00:15:17 +00:00
Rex Jolliff
0deeaa0d83 fixes for some compiler errors.
svn path=/trunk/; revision=526
1999-05-28 20:40:05 +00:00
Emanuele Aliberti
da7f2bf2b2 Little editing
svn path=/trunk/; revision=525
1999-05-28 19:49:46 +00:00
Rex Jolliff
6709ff7e24 added DDI version macro
svn path=/trunk/; revision=524
1999-05-28 18:46:23 +00:00
Rex Jolliff
d415ba8508 First hack at KMDLLs
svn path=/trunk/; revision=523
1999-05-28 18:24:27 +00:00
Rex Jolliff
9377d51b1a More code for win32k.sys
svn path=/trunk/; revision=522
1999-05-27 23:08:26 +00:00
Emanuele Aliberti
662c77c00c SetLastError() used in stubs
svn path=/trunk/; revision=521
1999-05-26 05:24:21 +00:00
Emanuele Aliberti
5169949e78 IMAGE_SUBSYSTEM_xxx
svn path=/trunk/; revision=520
1999-05-26 05:23:26 +00:00
Rex Jolliff
480d6d6388 More work on generic VGA driver
svn path=/trunk/; revision=519
1999-05-26 02:37:21 +00:00
Rex Jolliff
389b5fe480 More work on generic VGA driver skeleton
svn path=/trunk/; revision=518
1999-05-26 02:34:31 +00:00
Rex Jolliff
d89e0df163 changes to support VGA miniport driver
svn path=/trunk/; revision=517
1999-05-26 00:39:11 +00:00
Rex Jolliff
36a7c3cf0d Added a skeleton VGA miniport driver
svn path=/trunk/; revision=516
1999-05-26 00:35:26 +00:00
Eric Kohl
b887962d1d Fixed some compiler warnings.
svn path=/trunk/; revision=515
1999-05-25 19:16:29 +00:00
Rex Jolliff
5f710be5ef Added code to implement videoport driver
svn path=/trunk/; revision=514
1999-05-25 03:19:47 +00:00
Emanuele Aliberti
47ee1b5a90 gdi32.dll added
svn path=/trunk/; revision=513
1999-05-24 20:09:06 +00:00
Emanuele Aliberti
c9b6355479 stubs for most gdi32 functions
svn path=/trunk/; revision=512
1999-05-24 20:04:44 +00:00
Boudewijn Dekker
5c91ed98f2 no message
svn path=/trunk/; revision=511
1999-05-24 15:22:43 +00:00
Boudewijn Dekker
1cdff7f03d no message
svn path=/trunk/; revision=510
1999-05-24 15:14:14 +00:00
Boudewijn Dekker
d21b624ded no message
svn path=/trunk/; revision=509
1999-05-24 14:47:21 +00:00
Emanuele Aliberti
4b60f335f5 GDI32.DLL auxiliary files
svn path=/trunk/; revision=508
1999-05-23 07:41:33 +00:00
Rex Jolliff
c805537640 added stubs and build spec for win32k.sys
svn path=/trunk/; revision=507
1999-05-22 23:55:56 +00:00
Boudewijn Dekker
2b96374f2a no message
svn path=/trunk/; revision=506
1999-05-22 07:28:28 +00:00
Rex Jolliff
2854aac246 more work on the videoport driver.
svn path=/trunk/; revision=505
1999-05-22 07:25:30 +00:00
Rex Jolliff
ae32243b6a patches to get v14 to compile.
svn path=/trunk/; revision=503
1999-05-21 18:47:44 +00:00
Rex Jolliff
ed003aa199 bumped to version 14
svn path=/trunk/; revision=502
1999-05-21 18:21:10 +00:00
Rex Jolliff
ebf6630e2b Added skeleton video port driver
svn path=/trunk/; revision=501
1999-05-21 18:20:45 +00:00
Rex Jolliff
2a87426631 more additions to DDI interface
svn path=/trunk/; revision=500
1999-05-21 07:50:04 +00:00
Emanuele Aliberti
e30ffd7e27 fiber functions stubs
svn path=/trunk/; revision=499
1999-05-21 05:42:08 +00:00
Emanuele Aliberti
659762910c *** empty log message ***
svn path=/trunk/; revision=498
1999-05-21 05:25:12 +00:00
Rex Jolliff
cfe42a37eb More DDI stuff
svn path=/trunk/; revision=497
1999-05-21 02:34:38 +00:00
Eric Kohl
42dfa65049 Fixed bugs in batch file execution.
svn path=/trunk/; revision=496
1999-05-21 00:52:38 +00:00
Rex Jolliff
d22c45fab2 Added to DDI interface definition
svn path=/trunk/; revision=495
1999-05-21 00:02:39 +00:00
Emanuele Aliberti
f234e93d1e win32k.sys exports
svn path=/trunk/; revision=494
1999-05-20 17:26:02 +00:00
Rex Jolliff
905776a29b added GDI kernel mode graphics engine skeleton
svn path=/trunk/; revision=493
1999-05-20 01:31:05 +00:00
Rex Jolliff
56b16dbf01 added GDI-DDI interface header
svn path=/trunk/; revision=492
1999-05-20 01:30:01 +00:00
Eric Kohl
9ade7d9aaf Fixed typo.
svn path=/trunk/; revision=491
1999-05-19 18:02:11 +00:00
Eric Kohl
3bc13b6875 cleanup
svn path=/trunk/; revision=490
1999-05-19 18:00:17 +00:00
Eric Kohl
cf7d159791 Fixed CreateDirectoryExW.
svn path=/trunk/; revision=489
1999-05-19 17:57:57 +00:00
Eric Kohl
0495cfd8d4 several fixes
svn path=/trunk/; revision=488
1999-05-19 17:57:02 +00:00
Eric Kohl
77360caec8 warning fix
svn path=/trunk/; revision=487
1999-05-19 17:56:25 +00:00
Eric Kohl
64f28f26bd access fixes
svn path=/trunk/; revision=486
1999-05-19 17:55:44 +00:00
Emanuele Aliberti
e3876459ef rtlsec.{c,h} are in lib/ntdll/rtl/sec.{c,h}
svn path=/trunk/; revision=485
1999-05-19 16:52:08 +00:00
Emanuele Aliberti
72df55f2e2 more stubs
svn path=/trunk/; revision=484
1999-05-19 16:43:30 +00:00
Boudewijn Dekker
55b8b93555 Commit to implement all symbols initially
svn path=/trunk/; revision=483
1999-05-18 18:16:30 +00:00
Boudewijn Dekker
b06daa620f no message
svn path=/trunk/; revision=482
1999-05-18 18:04:30 +00:00
Emanuele Aliberti
6275e70165 Some more constants for common values to be used in .rc files.
svn path=/trunk/; revision=480
1999-05-17 05:23:50 +00:00
Eric Kohl
0344d1a114 Fixed SystemTimeToFileTime().
svn path=/trunk/; revision=479
1999-05-16 18:33:24 +00:00
Eric Kohl
7aaccee0e9 Added date/time output and fixed warnings.
svn path=/trunk/; revision=478
1999-05-16 18:31:00 +00:00
Emanuele Aliberti
b5d3b3bf2d $(RC)
svn path=/trunk/; revision=477
1999-05-16 17:35:42 +00:00
Emanuele Aliberti
5d7bcb07bd a rudimentary console regedit
svn path=/trunk/; revision=476
1999-05-16 17:23:22 +00:00
Emanuele Aliberti
9ef17eada6 A few system utilities that need fixing
svn path=/trunk/; revision=475
1999-05-16 07:27:35 +00:00
Emanuele Aliberti
b9bbf8287b ExitWindowsEx exported
svn path=/trunk/; revision=474
1999-05-16 07:21:45 +00:00
Eric Kohl
88df0b7726 Fixed typo.
svn path=/trunk/; revision=473
1999-05-15 22:44:38 +00:00
Eric Kohl
c6b0f56200 Fixed typo.
svn path=/trunk/; revision=472
1999-05-15 17:25:29 +00:00
Eric Kohl
0a70b0080a Improved time functions.
svn path=/trunk/; revision=471
1999-05-15 17:25:02 +00:00
Emanuele Aliberti
b2274fda0d USER32.ExitWindows removed (it's a macro!)
svn path=/trunk/; revision=470
1999-05-15 13:48:38 +00:00
Emanuele Aliberti
6ddcb50e38 naive USER32.ExitWindows
svn path=/trunk/; revision=469
1999-05-15 13:35:57 +00:00
Emanuele Aliberti
19c00dc04f *** empty log message ***
svn path=/trunk/; revision=468
1999-05-15 07:23:34 +00:00
Eric Kohl
acc9e8fbc3 Fixed bug in RtlTimeToTimeFields().
svn path=/trunk/; revision=467
1999-05-14 16:42:05 +00:00
Eric Kohl
3ed33156f2 Fixed another path bug.
svn path=/trunk/; revision=466
1999-05-14 13:32:13 +00:00
Eric Kohl
d2e0015ab7 Fixed overlapping buffer handling.
svn path=/trunk/; revision=465
1999-05-14 13:30:07 +00:00
Eric Kohl
4251bd8513 Fixed volume label reading.
svn path=/trunk/; revision=464
1999-05-13 18:02:24 +00:00
Eric Kohl
60f4a025ef Fixed includes.
svn path=/trunk/; revision=463
1999-05-13 14:54:14 +00:00
Eric Kohl
9bdf8fd314 Improved time functions.
svn path=/trunk/; revision=462
1999-05-13 14:52:35 +00:00
Eric Kohl
e1e75da515 Update to build cmd separately.
svn path=/trunk/; revision=461
1999-05-11 22:50:44 +00:00
Emanuele Aliberti
2711eadf8a Added DLLs user32 and fmifs.
svn path=/trunk/; revision=460
1999-05-11 21:39:54 +00:00
Emanuele Aliberti
2eb223d16f GNU GPL
svn path=/trunk/; revision=459
1999-05-11 21:33:57 +00:00
Emanuele Aliberti
7e62c34fdd File Manage{r|ment} IFS Utility
Do-nothing implementation for coming ReactOS sysutils.

svn path=/trunk/; revision=458
1999-05-11 21:19:41 +00:00
Emanuele Aliberti
603bb75198 stuctures, constants and prototypes used by fmifs.dll
svn path=/trunk/; revision=457
1999-05-11 21:16:01 +00:00
Eric Kohl
db37f2cecd Not needed any longer.
svn path=/trunk/; revision=456
1999-05-11 19:37:25 +00:00
Eric Kohl
76691783b3 Fixed LARGE_INTEGER hack.
svn path=/trunk/; revision=455
1999-05-11 19:32:15 +00:00
Eric Kohl
fc506149ce Not needed any longer.
svn path=/trunk/; revision=454
1999-05-11 16:09:02 +00:00
Eric Kohl
5edb029d51 Use crtdll instead of ntdll.
svn path=/trunk/; revision=453
1999-05-11 16:08:21 +00:00
Eric Kohl
acd3d263c1 Fixed clean target.
svn path=/trunk/; revision=452
1999-05-11 15:32:27 +00:00
Eric Kohl
a2e9c0c7a4 Fixed compiler warnings.
svn path=/trunk/; revision=451
1999-05-11 15:31:01 +00:00
Eric Kohl
d0fbe6c728 Export more functions.
svn path=/trunk/; revision=450
1999-05-11 15:29:04 +00:00
Eric Kohl
6bac8b1c92 Minor fixes.
svn path=/trunk/; revision=449
1999-05-11 15:28:34 +00:00
Eric Kohl
3f9e43cbf2 Added TerminateProcess().
svn path=/trunk/; revision=448
1999-05-11 15:28:11 +00:00
Eric Kohl
078d8a8502 Added stdlib directory to the clean target.
svn path=/trunk/; revision=447
1999-05-11 15:27:13 +00:00
Eric Kohl
d927063dd4 Not needed any longer.
svn path=/trunk/; revision=446
1999-05-11 12:40:59 +00:00
Eric Kohl
ffbc9d9c03 Update to build cmd separately.
svn path=/trunk/; revision=445
1999-05-11 12:40:11 +00:00
Eric Kohl
6a7adfd71f Update for global rules.mak file.
svn path=/trunk/; revision=444
1999-05-11 12:38:45 +00:00
Eric Kohl
e9ecf45119 Added process ids.
svn path=/trunk/; revision=443
1999-05-10 12:37:45 +00:00
Rex Jolliff
169894bcc5 a little work on the registry code
svn path=/trunk/; revision=442
1999-05-10 00:06:49 +00:00
Boudewijn Dekker
b9354028e0 fixed bug in scanf
svn path=/trunk/; revision=441
1999-05-09 14:01:59 +00:00
Boudewijn Dekker
0107a0743b no message
svn path=/trunk/; revision=440
1999-05-09 14:00:05 +00:00
Eric Kohl
901449bfe8 Fixed 'implicid declaration' warning.
svn path=/trunk/; revision=439
1999-05-08 18:10:33 +00:00
Eric Kohl
09b99f1097 Fixed KEY_EVENT_RECORD.
svn path=/trunk/; revision=438
1999-05-08 18:09:37 +00:00
Boudewijn Dekker
7f7d1d57b0 changed #include <windows32/defines.h> to
#include "../include/defines.h"

svn path=/trunk/; revision=437
1999-05-08 13:37:14 +00:00
Boudewijn Dekker
25cd7e1e5a changed #include <windows32/defines.h> to
#include "../../include/defines.h"

svn path=/trunk/; revision=436
1999-05-08 13:35:12 +00:00
Emanuele Aliberti
3cee782a23 user32.dll minimal implementation
svn path=/trunk/; revision=435
1999-05-08 07:09:31 +00:00
Rex Jolliff
ae4cb21e55 added a top level readme file.
svn path=/trunk/; revision=434
1999-05-07 20:18:25 +00:00
Eric Kohl
27cfdf8b3b Export some more functions.
svn path=/trunk/; revision=433
1999-05-07 20:10:45 +00:00
Eric Kohl
0064915ad7 Some more fixes.
svn path=/trunk/; revision=432
1999-05-07 20:09:54 +00:00
Eric Kohl
14e5e06271 Fixed typos and moved typedefs.
svn path=/trunk/; revision=431
1999-05-06 23:40:43 +00:00
Eric Kohl
781ba31ad3 Added GetDiskFreeSpaceEx().
svn path=/trunk/; revision=430
1999-05-06 20:06:42 +00:00
Eric Kohl
0072db2e5e Fixed GetDiskFreeSpace().
svn path=/trunk/; revision=429
1999-05-06 17:59:55 +00:00
Eric Kohl
70b2252a9d Fixed more bugs in GetFullPathName() and SetCurrentDirectory().
svn path=/trunk/; revision=428
1999-05-06 14:06:48 +00:00
Eric Kohl
bc291ce04e Fixed typos and compiler warnings.
svn path=/trunk/; revision=427
1999-05-05 21:05:00 +00:00
Eric Kohl
73d37669c4 Added volume serial number handling.
svn path=/trunk/; revision=426
1999-05-05 11:23:46 +00:00
Eric Kohl
d5f96518f2 Renamed wtolower() to towlower().
Renamed wtoupper() to towupper().
Added some runtime functions.

svn path=/trunk/; revision=425
1999-05-05 11:20:14 +00:00
Eric Kohl
490e4d94fc Fixed 'implicid declaration' warnings.
svn path=/trunk/; revision=424
1999-04-29 23:36:08 +00:00
Eric Kohl
ddd8467f99 Added missing features in GetFullPathName[A/W]().
svn path=/trunk/; revision=423
1999-04-29 23:32:27 +00:00
Eric Kohl
278a6c540b Fixed dependencies. Now ntdll.dll depends on ntdll.def too.
svn path=/trunk/; revision=422
1999-04-29 19:55:00 +00:00
Eric Kohl
241b23c24d Added aliases.
svn path=/trunk/; revision=421
1999-04-29 19:54:02 +00:00
Eric Kohl
c842409323 Added missing features in GetFullPathName[A/W]().
svn path=/trunk/; revision=420
1999-04-28 14:19:34 +00:00
Eric Kohl
e5bfd35667 Fixed the 'clean' rule.
svn path=/trunk/; revision=419
1999-04-27 14:51:27 +00:00
Eric Kohl
f661ec6b08 Cleaned up the 'clean' rule.
svn path=/trunk/; revision=418
1999-04-27 14:50:51 +00:00
Eric Kohl
27de25f464 Fixed compiler warning.
svn path=/trunk/; revision=417
1999-04-27 14:49:57 +00:00
Eric Kohl
e68d320afc Fixed LARGE_INTEGER handling
svn path=/trunk/; revision=416
1999-04-27 14:47:40 +00:00
Eric Kohl
56461438cb Fixed LARGE_INTEGER handling
svn path=/trunk/; revision=415
1999-04-27 14:15:56 +00:00
Boudewijn Dekker
cee2ad3925 no message
svn path=/trunk/; revision=414
1999-04-27 06:16:04 +00:00
Boudewijn Dekker
9f95b317f2 Fixed bug in modfl and in fread and fwrite and added
some permission checks in stdio.

svn path=/trunk/; revision=413
1999-04-27 06:15:27 +00:00
Emanuele Aliberti
2890508a82 version information
svn path=/trunk/; revision=412
1999-04-25 07:09:54 +00:00
Boudewijn Dekker
97c1f757f6 Fixed some bugs.
svn path=/trunk/; revision=411
1999-04-23 18:43:00 +00:00
Rex Jolliff
98a3f0d6f5 Updated boot disk builder and fixed CHECKPOINT macro in KERNEL32
svn path=/trunk/; revision=410
1999-04-23 16:20:31 +00:00
Eric Kohl
67d7e92025 fixed GetVolumeInformation()
svn path=/trunk/; revision=409
1999-04-23 11:54:47 +00:00
Eric Kohl
54378dbf2a fixed little bug in FindFirstFile()
svn path=/trunk/; revision=408
1999-04-23 11:51:00 +00:00
Emanuele Aliberti
321081bb62 version information to distinguish from MS
svn path=/trunk/; revision=407
1999-04-23 05:28:37 +00:00
Emanuele Aliberti
ad3c512ae2 added resource script with version information to distinguish from MS
svn path=/trunk/; revision=406
1999-04-23 05:27:49 +00:00
Emanuele Aliberti
3fe1c6d5f4 *.rc include
svn path=/trunk/; revision=405
1999-04-23 05:26:37 +00:00
Eric Kohl
36322cffcd fixed GetFileAttributes()
svn path=/trunk/; revision=404
1999-04-21 19:16:31 +00:00
Eric Kohl
73a193b7fe compatibility fixes
svn path=/trunk/; revision=403
1999-04-20 20:25:56 +00:00
Eric Kohl
94f82b0796 cleanup
svn path=/trunk/; revision=402
1999-04-19 18:44:36 +00:00
Eric Kohl
81b9b25bc7 fixed Beep()
svn path=/trunk/; revision=401
1999-04-19 18:43:54 +00:00
David Welch
db068d0cae Synched makefiles
svn path=/trunk/; revision=400
1999-04-18 21:13:11 +00:00
David Welch
dcd4ed3e62 Completely code to synchronize DbgPrint and console output (why was this
not tested?)

svn path=/trunk/; revision=399
1999-04-18 13:39:48 +00:00
David Welch
9adc8d3ca1 Fixed silly bug (sorry)
svn path=/trunk/; revision=398
1999-04-18 13:24:02 +00:00
David Welch
d2f7f11cfc Corrected bug which stopped(!) crtdll from compiling
svn path=/trunk/; revision=397
1999-04-18 12:13:55 +00:00
David Welch
4946832715 *** empty log message ***
svn path=/trunk/; revision=396
1999-04-18 09:11:27 +00:00
David Welch
5a3243d494 Several bug fixes
Added proper process cleanup
Added several programs for testing

svn path=/trunk/; revision=395
1999-04-18 08:56:23 +00:00
Boudewijn Dekker
6f801aae22 added quad.h and ieee.h
svn path=/trunk/; revision=394
1999-04-17 09:11:02 +00:00
Boudewijn Dekker
6becb71b7c Replaced old version of printf and added some long long and
long double support.

svn path=/trunk/; revision=393
1999-04-17 09:10:25 +00:00
Eric Kohl
a1418887c0 changes to build cmd again
svn path=/trunk/; revision=392
1999-04-16 17:26:10 +00:00
Eric Kohl
1644f93c49 dir workaround
svn path=/trunk/; revision=391
1999-04-16 17:25:39 +00:00
Eric Kohl
464c5c2187 changes to build cmd again
svn path=/trunk/; revision=390
1999-04-16 17:20:16 +00:00
Eric Kohl
eda973b1cc last bugfixes for cmd
svn path=/trunk/; revision=389
1999-04-16 00:16:18 +00:00
Eric Kohl
7e74c066a7 changes to build cmd again
svn path=/trunk/; revision=388
1999-04-15 17:40:56 +00:00
Emanuele Aliberti
64037e6939 complete but not aliased export table for advapi32.dll
svn path=/trunk/; revision=387
1999-04-15 05:46:09 +00:00
Eric Kohl
079a92a658 fixed cursor synchronization bug
svn path=/trunk/; revision=386
1999-04-15 02:02:13 +00:00
Eric Kohl
ff1e3c7b18 changed strupr() to _strupr()
svn path=/trunk/; revision=385
1999-04-14 23:52:13 +00:00
Eric Kohl
731f19e9b1 several changes to make cmd compile and link again
svn path=/trunk/; revision=384
1999-04-14 23:48:27 +00:00
Eric Kohl
ebb6fcbc30 added ver command
improved command line editing

svn path=/trunk/; revision=383
1999-04-14 23:45:48 +00:00
Eric Kohl
97c260445b fixed bug in FreeConsole()
svn path=/trunk/; revision=382
1999-04-14 23:43:56 +00:00
Eric Kohl
5d97b74881 fixed cursor synchroization bug
svn path=/trunk/; revision=381
1999-04-14 23:43:13 +00:00
Boudewijn Dekker
ed08466464 Added various files.
--> failed to pass test printing a simple string

svn path=/trunk/; revision=380
1999-04-14 21:27:02 +00:00
Boudewijn Dekker
b68aceef62 Added two header files for multi byte string functions
svn path=/trunk/; revision=379
1999-04-14 07:10:15 +00:00
David Welch
42965fae3b Fixed more compilation bugs (sorry)
svn path=/trunk/; revision=378
1999-04-14 03:39:11 +00:00
David Welch
600e81c60c Fixed silly compilation bug
svn path=/trunk/; revision=377
1999-04-14 02:31:11 +00:00
David Welch
0691de94b5 *** empty log message ***
svn path=/trunk/; revision=376
1999-04-14 00:58:52 +00:00
David Welch
d837d19fac *** empty log message ***
svn path=/trunk/; revision=375
1999-04-14 00:52:19 +00:00
Eric Kohl
eee72fe55d console update
svn path=/trunk/; revision=374
1999-04-11 20:59:24 +00:00
Eric Kohl
98d0da7e1c added .cvsignore file
svn path=/trunk/; revision=373
1999-04-10 14:48:38 +00:00
Eric Kohl
7c8b54eee0 fixed bugs and cleaned up (direct io is working now)
svn path=/trunk/; revision=372
1999-04-10 14:47:15 +00:00
David Welch
fd78805ffc Partially implemented PEB
Some bug fixes
Hacked crtdll to compile with a minimal set of functions

svn path=/trunk/; revision=371
1999-04-10 12:08:24 +00:00
Rex Jolliff
9221d5c854 fixing filenames
svn path=/trunk/; revision=370
1999-04-08 03:46:59 +00:00
David Welch
5503a0f0e4 Improved GDT managment
svn path=/trunk/; revision=369
1999-04-05 15:04:46 +00:00
Rex Jolliff
99fa281af1 fixed display of stack frames
svn path=/trunk/; revision=368
1999-04-04 00:22:33 +00:00
Rex Jolliff
29b9e3f0b4 Added a recursive clean rule and cleaned up a few loose ends
svn path=/trunk/; revision=367
1999-04-03 23:43:27 +00:00
Boudewijn Dekker
0c6333ed01 minor fixes
svn path=/trunk/; revision=366
1999-04-03 10:42:18 +00:00
Boudewijn Dekker
e8cbdde2a7 moved some header files from top level to crtdll directory
svn path=/trunk/; revision=365
1999-04-02 21:44:11 +00:00
The ReactOS Manager
de56bed16d to fix a problem
svn path=/trunk/; revision=364
1999-04-02 18:34:41 +00:00
The ReactOS Manager
5a25898d41 to fix a problem
svn path=/trunk/; revision=363
1999-04-02 18:21:44 +00:00
Rex Jolliff
fbe6ae7bc0 Setup CRTDLL config to build DLL
svn path=/trunk/; revision=362
1999-04-02 06:29:59 +00:00
Rex Jolliff
a3576ceb06 removed size_t from kernel specific includes.
svn path=/trunk/; revision=361
1999-04-02 02:34:40 +00:00
David Welch
63a3377143 Enhanced memory managment
Correct several bugs in the creation/termination of processes

svn path=/trunk/; revision=360
1999-04-01 12:39:43 +00:00
Rex Jolliff
240b550d9c Changes to be able to build system
svn path=/trunk/; revision=359
1999-04-01 05:22:18 +00:00
jean
839118b9b3 initialization of LastError
svn path=/trunk/; revision=358
1999-03-31 14:09:51 +00:00
jean
472aba6da2 correct bug in release of semaphore
svn path=/trunk/; revision=357
1999-03-31 13:57:22 +00:00
jean
d7acbe2251 correct bug in release of semaphore
svn path=/trunk/; revision=356
1999-03-31 13:38:13 +00:00
jean
3763d9c0dd report changes from dwelch in 1.5 (include <string.h>
svn path=/trunk/; revision=355
1999-03-31 13:26:40 +00:00
jean
3277301592 implement some functions
svn path=/trunk/; revision=354
1999-03-31 13:21:44 +00:00
David Welch
572d45daca Improved physical page managment
svn path=/trunk/; revision=353
1999-03-31 10:59:32 +00:00
Eric Kohl
e4bcefde7d Fixed bugs and improved del command.
svn path=/trunk/; revision=352
1999-03-30 22:06:36 +00:00
Eric Kohl
74b0d03ccc Fixed bug in DeviceIoContol().
svn path=/trunk/; revision=351
1999-03-30 22:05:06 +00:00
Eric Kohl
9e3fe0593a Changed beep to compile as sys driver.
svn path=/trunk/; revision=350
1999-03-30 21:59:12 +00:00
Eric Kohl
aa77254872 improved bluescreen driver
svn path=/trunk/; revision=349
1999-03-30 21:58:05 +00:00
David Welch
bbc8fd7b21 Began improvements to memory managment, changed method of
mapping page tables and directories to be more efficent. These
changes require you to update your version of loadros.com

svn path=/trunk/; revision=348
1999-03-30 12:55:31 +00:00
Rex Jolliff
dff0889c02 added GDI32 DLL skeleton
svn path=/trunk/; revision=347
1999-03-28 23:12:42 +00:00
Boudewijn Dekker
03f9e7b713 fixed some bugs to make nls functions compile
svn path=/trunk/; revision=346
1999-03-27 22:29:57 +00:00
David Welch
fbcc7fb423 Made process execution work again
svn path=/trunk/; revision=345
1999-03-26 10:48:45 +00:00
David Welch
140b387c62 Made user-mode execution of processes work again
svn path=/trunk/; revision=344
1999-03-26 10:37:03 +00:00
jean
867fa342e3 changed type for function ExIsResourceAcquiredSharedLite
svn path=/trunk/; revision=343
1999-03-25 14:13:05 +00:00
jean
db7bc7b4e8 modifiy ExIsResourceAcquiredxxx
svn path=/trunk/; revision=342
1999-03-25 14:10:14 +00:00
jean
e4981e3a09 work on semaphores.
svn path=/trunk/; revision=341
1999-03-25 13:53:45 +00:00
jean
42c50bfaa8 begin implement.
svn path=/trunk/; revision=340
1999-03-25 13:52:28 +00:00
David Welch
8688a2a272 Cleaned up code a bit
svn path=/trunk/; revision=339
1999-03-25 00:37:06 +00:00
David Welch
3f0a7424cb Changed kernel32 to compile as a dll
svn path=/trunk/; revision=338
1999-03-24 11:07:33 +00:00
Eric Kohl
00f2fc414e fixed drive reset bug!
svn path=/trunk/; revision=333
1999-03-23 21:23:50 +00:00
Boudewijn Dekker
4f928dad27 no message
svn path=/trunk/; revision=332
1999-03-22 21:01:37 +00:00
Boudewijn Dekker
150a9789e6 Added __set_errno to file.h
svn path=/trunk/; revision=331
1999-03-22 21:01:15 +00:00
Boudewijn Dekker
b3c424cd40 Changes and improved mingw32 compile
svn path=/trunk/; revision=330
1999-03-22 20:57:12 +00:00
Boudewijn Dekker
8bf8d53376 no message
svn path=/trunk/; revision=329
1999-03-22 20:48:08 +00:00
Boudewijn Dekker
5bd64e22e4 Converted cwait.c and system.c to lower case.
svn path=/trunk/; revision=328
1999-03-22 18:09:39 +00:00
Boudewijn Dekker
0dc103b08e Changed access.c and try to convert commit.c to lower case.
svn path=/trunk/; revision=327
1999-03-22 17:21:21 +00:00
Eric Kohl
108fcceee2 changes to make cmd compile (not link)
svn path=/trunk/; revision=326
1999-03-21 21:32:45 +00:00
Rex Jolliff
b172b0df42 added rule for cmd
svn path=/trunk/; revision=325
1999-03-20 20:47:25 +00:00
Rex Jolliff
9f7f2c0f72 Added Eric Kohl's port of freedos command
svn path=/trunk/; revision=324
1999-03-20 20:28:42 +00:00
Rex Jolliff
af3d943b02 cleanup after merge with mingw32
svn path=/trunk/; revision=323
1999-03-19 06:37:39 +00:00
Rex Jolliff
d704562082 Merged mingw32 branch into main trunk
svn path=/trunk/; revision=321
1999-03-19 05:55:55 +00:00
jean
bf4de1d7cd replaced call %eax with call *%eax.First syntax is not recognized
by all compilers.

svn path=/trunk/; revision=317
1999-03-16 13:35:26 +00:00
Boudewijn Dekker
f6a2bede37 no message
svn path=/trunk/; revision=307
1999-03-13 10:12:05 +00:00
Boudewijn Dekker
282bc306f8 Added logb from glibc math.h file
svn path=/trunk/; revision=306
1999-03-13 09:14:51 +00:00
Boudewijn Dekker
481a3a687c no message
svn path=/trunk/; revision=305
1999-03-13 09:03:35 +00:00
Boudewijn Dekker
48f92902c5 Added some nls functions
svn path=/trunk/; revision=304
1999-03-13 09:00:59 +00:00
Boudewijn Dekker
0c215b202d Changed .s files to .c files with gcc asm.
svn path=/trunk/; revision=301
1999-03-12 20:28:52 +00:00
Boudewijn Dekker
98071efc7e Changed .s files to .c files with gcc asm.
svn path=/trunk/; revision=300
1999-03-12 20:26:05 +00:00
jean
ad037179b4 generate napi.c instead of napi.asm
svn path=/trunk/; revision=299
1999-03-12 16:18:45 +00:00
jean
9d1624980f replaced by interlck.c
svn path=/trunk/; revision=298
1999-03-12 16:15:21 +00:00
jean
3276df883d created, replace interlck.asm
svn path=/trunk/; revision=297
1999-03-12 16:14:36 +00:00
jean
7994f333ab replaced by apchelp.c
svn path=/trunk/; revision=296
1999-03-12 16:08:15 +00:00
jean
49d35cfc27 created, replace apchelp.asm
svn path=/trunk/; revision=295
1999-03-12 16:07:32 +00:00
jean
a1c0b9b92a replaced by usercall.c
svn path=/trunk/; revision=294
1999-03-12 16:04:30 +00:00
jean
75a9d9fc5f replaced by irqhand.c
svn path=/trunk/; revision=293
1999-03-12 16:03:09 +00:00
jean
a0945c2aa2 created. replace usercall.asm
svn path=/trunk/; revision=292
1999-03-12 16:00:10 +00:00
jean
ee4c094831 created. replace irqhand.asm.
svn path=/trunk/; revision=291
1999-03-12 15:59:02 +00:00
Emanuele Aliberti
9ee6327262 stubs
svn path=/trunk/; revision=290
1999-03-12 06:29:00 +00:00
Rex Jolliff
24160311c0 more changes to compile under mingw32
svn path=/trunk/; revision=287
1999-03-10 07:18:38 +00:00
Rex Jolliff
275be13b58 Eric's beep driver and changes for same
svn path=/trunk/; revision=286
1999-03-10 06:39:59 +00:00
Rex Jolliff
3a2897ef52 Eric's beep driver and changes to support same
svn path=/trunk/; revision=285
1999-03-10 05:16:57 +00:00
Rex Jolliff
2e61a84b9d oops, put it in the wrong place
svn path=/trunk/; revision=284
1999-03-10 05:01:36 +00:00
Rex Jolliff
c00639bf8c Added the CRT lib for the kernel
svn path=/trunk/; revision=283
1999-03-09 07:15:46 +00:00
Boudewijn Dekker
09abfa6348 Various changes to crtdll.
svn path=/trunk/; revision=282
1999-03-07 14:15:23 +00:00
Boudewijn Dekker
01f4ff78c5 Various changes to crtdll, added some files to math and float
directory.

svn path=/trunk/; revision=281
1999-03-07 13:37:38 +00:00
Boudewijn Dekker
9fd228d402 Various changes to header files
svn path=/trunk/; revision=280
1999-03-07 13:35:11 +00:00
Rex Jolliff
1db33360e3 added config to generate NTDLL.DLL under mingw32
svn path=/trunk/; revision=279
1999-03-06 21:44:41 +00:00
Emanuele Aliberti
97a4cb23d5 stubs
svn path=/trunk/; revision=278
1999-03-06 10:57:02 +00:00
Boudewijn Dekker
eec445ded5 these files are defined in stdlib
svn path=/trunk/; revision=275
1999-02-27 16:59:01 +00:00
Boudewijn Dekker
5a9cee4031 made some small changes
svn path=/trunk/; revision=271
1999-02-25 22:53:40 +00:00
Boudewijn Dekker
b7b31cec92 added some header files
svn path=/trunk/; revision=270
1999-02-25 22:51:47 +00:00
Boudewijn Dekker
15df73e6b3 no message
svn path=/trunk/; revision=269
1999-02-25 21:36:26 +00:00
Boudewijn Dekker
d58a6ad5d6 added some wide character support
svn path=/trunk/; revision=268
1999-02-25 21:33:50 +00:00
Boudewijn Dekker
7946500988 no message
svn path=/trunk/; revision=267
1999-02-25 21:27:29 +00:00
Boudewijn Dekker
d9625dff78 implementation of debug assert
svn path=/trunk/; revision=266
1999-02-25 21:02:20 +00:00
Boudewijn Dekker
e66f3f0e7b Fixed some problems to make the mingw32 header files work with the
linux header files.

svn path=/trunk/; revision=265
1999-02-21 20:59:55 +00:00
Boudewijn Dekker
b57dd9d5b6 Fixed some bugs in header files
svn path=/trunk/; revision=264
1999-02-21 17:43:45 +00:00
Boudewijn Dekker
f929f4c00b changed header files from djgpp to mingw32
svn path=/trunk/; revision=263
1999-02-21 13:48:57 +00:00
Boudewijn Dekker
eef71ffb98 change exec and spawn to _exec and _spawn
svn path=/trunk/; revision=262
1999-02-21 13:43:05 +00:00
Boudewijn Dekker
87028edf14 changed some header file from djgpp to mingw32
svn path=/trunk/; revision=261
1999-02-21 13:33:27 +00:00
Boudewijn Dekker
38c0489092 Changed some header file from djgpp to mingw32
svn path=/trunk/; revision=260
1999-02-21 13:32:17 +00:00
Boudewijn Dekker
77ed4e360b Change some header file from djgpp to mingw32
svn path=/trunk/; revision=259
1999-02-21 13:29:57 +00:00
Boudewijn Dekker
37f381130a fixed bug in stdio.h
svn path=/trunk/; revision=258
1999-02-21 09:15:22 +00:00
Boudewijn Dekker
f6e36a9f86 implement use of _get_osfhandle
svn path=/trunk/; revision=257
1999-02-21 09:11:06 +00:00
Boudewijn Dekker
2c7fb0c72e fixed bug in unlink.c
svn path=/trunk/; revision=256
1999-02-21 09:02:18 +00:00
Boudewijn Dekker
4ad5db5d9c fixed bug in getch
svn path=/trunk/; revision=255
1999-02-21 08:58:57 +00:00
Boudewijn Dekker
95a2cd9225 Added some files
svn path=/trunk/; revision=254
1999-02-21 08:39:36 +00:00
Boudewijn Dekker
ddbc094b81 Added prototype for NtCreateToken
svn path=/trunk/; revision=253
1999-02-21 08:29:20 +00:00
Boudewijn Dekker
4e237f23ce Added prototype for ZwCreateToken
svn path=/trunk/; revision=252
1999-02-21 08:24:36 +00:00
Boudewijn Dekker
93e68a6285 changed io.h regarding prototypes starting with an underscore
svn path=/trunk/; revision=251
1999-02-20 18:40:58 +00:00
Boudewijn Dekker
17a714dfcd added some files and impl diff between fileno and handles
svn path=/trunk/; revision=250
1999-02-20 18:36:47 +00:00
Boudewijn Dekker
25f46657b5 Fixed bug in filetime to system time conversion.
svn path=/trunk/; revision=249
1999-02-20 09:11:46 +00:00
jean
e177bf992c revert change in IopCloseFile, because David Welch is sure we must send
IRP_MJ_CLEANUP

svn path=/trunk/; revision=248
1999-02-18 12:28:06 +00:00
jean
c3e2bc8f4d add date and time in dir.
svn path=/trunk/; revision=247
1999-02-16 12:48:15 +00:00
jean
bd305c8221 correct conversion from dos date and time to TIMEFIELDS.
svn path=/trunk/; revision=246
1999-02-16 12:47:30 +00:00
jean
b16dd07968 add time fields in Find Informations.
svn path=/trunk/; revision=245
1999-02-16 12:46:33 +00:00
jean
bc669554a9 correct bug
svn path=/trunk/; revision=244
1999-02-16 12:45:28 +00:00
jean
276842493c add time.o and memcpy.o
svn path=/trunk/; revision=243
1999-02-16 12:41:57 +00:00
jean
32835c2a47 removed stubs for memcpy,RtlTimeFieldsToTime,RtlTimeTotimeFields
svn path=/trunk/; revision=242
1999-02-16 12:40:05 +00:00
jean
edabb16494 copied from lib/crtdll/string/memcpy.c
svn path=/trunk/; revision=241
1999-02-16 12:38:46 +00:00
jean
d4164f1a07 copied from ntoskrnl/rtl/time.c
svn path=/trunk/; revision=240
1999-02-16 12:37:48 +00:00
Rex Jolliff
ace5da2d0d Added a clean rule
svn path=/trunk/; revision=239
1999-02-16 07:48:03 +00:00
Rex Jolliff
6752566cd2 missed this file
svn path=/trunk/; revision=238
1999-02-16 07:47:29 +00:00
jean
2c6653bf1c place hal/ddk.h after rtl.h, hal/ddk.h needs rtl.h for HalQueryRealTimeClock
svn path=/trunk/; revision=237
1999-02-15 11:40:28 +00:00
jean
6cbc9243c9 add HalQueryRealTimeClock
svn path=/trunk/; revision=236
1999-02-15 11:38:36 +00:00
jean
9c602cda2e add time.o (function HalQueryRealTimeClock)
svn path=/trunk/; revision=235
1999-02-15 11:36:21 +00:00
jean
fc52fb7648 function HalQueryRealTimeClock : partial implementation
svn path=/trunk/; revision=234
1999-02-15 11:35:01 +00:00
jean
621baeefa5 correct bug in CreateDirectory
svn path=/trunk/; revision=233
1999-02-15 11:33:06 +00:00
jean
9f5cc5a859 modify IopCloseFile : send IRP_MJ_CLOSE .
svn path=/trunk/; revision=232
1999-02-15 11:29:08 +00:00
jean
00ec608e15 add a buffer for each file opened
svn path=/trunk/; revision=231
1999-02-15 11:26:13 +00:00
jean
2f1849aae9 add a read buffer of one cluster for each file
svn path=/trunk/; revision=230
1999-02-15 11:25:23 +00:00
jean
36714219d9 initialize dates to current date
svn path=/trunk/; revision=229
1999-02-15 11:24:13 +00:00
Rex Jolliff
6e66d97592 Added check for ROSKRNL.EXE kernel import references
svn path=/trunk/; revision=228
1999-02-12 22:07:20 +00:00
jean
cadd577325 RtlNtStatusToDosError : return 0 if no error, 1 else.
svn path=/trunk/; revision=227
1999-02-11 12:42:18 +00:00
jean
d6995d6c9c correct bug in WriteFile : crash if Overlapped is null
svn path=/trunk/; revision=226
1999-02-11 12:40:02 +00:00
jean
638ba1c9e4 correct bug on CreateDirectory : crash if no template
correct call to ZwCreateFile

svn path=/trunk/; revision=225
1999-02-11 12:38:30 +00:00
jean
9e65542bad add defines for ByteOffset parameter
svn path=/trunk/; revision=224
1999-02-10 13:12:41 +00:00
jean
3315d25a64 change declaration of functions
svn path=/trunk/; revision=223
1999-02-10 13:04:16 +00:00
jean
a649212d32 correct bug in FindFile : support fragmented directories
suppress \ at end of filename

svn path=/trunk/; revision=222
1999-02-10 12:52:48 +00:00
jean
4b8117cedc completed write functions : write correct entries in directories
svn path=/trunk/; revision=221
1999-02-10 12:48:37 +00:00
jean
b9da76d7ef changes because of new version of function FindFile
svn path=/trunk/; revision=220
1999-02-10 12:46:59 +00:00
Rex Jolliff
0a828ed745 another test
svn path=/trunk/; revision=219
1999-02-09 06:54:53 +00:00
Rex Jolliff
a943c76484 a test
svn path=/trunk/; revision=218
1999-02-09 06:53:18 +00:00
David Welch
70f7c7269c Fixed bugs in lib/kernel32/file/curdir.c and
lib/kernel32/misc/console.c

svn path=/trunk/; revision=217
1999-02-07 00:37:29 +00:00
David Welch
02e70516ef Fixed bug in lib/kernel32/misc/console.c
svn path=/trunk/; revision=216
1999-02-06 18:39:40 +00:00
David Welch
e5dfcc9871 no message
svn path=/trunk/; revision=215
1999-02-06 18:34:14 +00:00
Rex Jolliff
f8492b9ae3 various changes
svn path=/trunk/; revision=214
1999-02-06 00:34:56 +00:00
Rex Jolliff
6bee27aa2a Fixed page fault due to timer. Problem with timeout still needs to be fixed.
svn path=/trunk/; revision=213
1999-02-06 00:33:33 +00:00
Rex Jolliff
dbad901d31 Fixed debug statement
svn path=/trunk/; revision=212
1999-02-06 00:29:31 +00:00
Rex Jolliff
e51b6b925d Forgot to bump version on last changes
svn path=/trunk/; revision=211
1999-02-05 19:39:35 +00:00
Rex Jolliff
f45b570cc3 Added symbolic stack dump
svn path=/trunk/; revision=210
1999-02-05 19:38:30 +00:00
Rex Jolliff
55d6c152b6 more changes from Boudewijn
svn path=/trunk/; revision=209
1999-02-05 19:36:21 +00:00
Rex Jolliff
3aed7d1da4 incorporating changes from Boudewijn
svn path=/trunk/; revision=208
1999-02-05 19:35:56 +00:00
Rex Jolliff
df27ab373b incorporated changes from Boudewijn
svn path=/trunk/; revision=207
1999-02-05 19:27:21 +00:00
Rex Jolliff
67c37a748e Incorporated changed from Boudewijn
svn path=/trunk/; revision=206
1999-02-05 19:24:10 +00:00
Rex Jolliff
d4195242ff incorporated changes from dekker
svn path=/trunk/; revision=205
1999-02-05 19:15:33 +00:00
Rex Jolliff
9bcc89126c a test
svn path=/trunk/; revision=204
1999-02-05 18:52:58 +00:00
Rex Jolliff
d7a481490e Renamed from uppercase
svn path=/trunk/; revision=203
1999-02-05 18:44:52 +00:00
Rex Jolliff
bfd196dfd9 changes to support new library modules
svn path=/trunk/; revision=202
1999-02-05 18:34:02 +00:00
Rex Jolliff
f4e6240546 added libgcc.a to link spec
svn path=/trunk/; revision=201
1999-02-05 18:24:00 +00:00
David Welch
5ba4cc87c5 Extensive changes to the objmgr
Some bug fixes

svn path=/trunk/; revision=200
1999-02-01 20:58:37 +00:00
David Welch
e999320cb5 Deleted these
svn path=/trunk/; revision=199
1999-02-01 20:52:55 +00:00
David Welch
88987510df Delete this (empty file)
svn path=/trunk/; revision=198
1999-02-01 20:52:08 +00:00
David Welch
5cb80487c2 Deleted these (shell now redundant)
svn path=/trunk/; revision=197
1999-02-01 20:51:28 +00:00
David Welch
3fcccd0b8c Removed some memory leaks
Moved from first-fit to best-fit for non-paged pool allocation
Fixed bug in console driver (wasn't completing irps)
Fixed bug in vfat fsd (didn't recognize paths of the form foo//bar)

svn path=/trunk/; revision=196
1999-01-29 14:33:04 +00:00
David Welch
a984daa5de no message
svn path=/trunk/; revision=195
1999-01-28 21:42:01 +00:00
David Welch
9a068f8b4b Removed memory leaks
Fixed bug in console driver (wasn't completing irp)

svn path=/trunk/; revision=194
1999-01-28 21:41:05 +00:00
David Welch
0bcca89137 no message
svn path=/trunk/; revision=193
1999-01-28 15:54:26 +00:00
Rex Jolliff
531f88e833 changed program loader to map image into section
svn path=/trunk/; revision=192
1999-01-25 23:06:30 +00:00
Rex Jolliff
a3232e28c6 changes to implement registry tags
svn path=/trunk/; revision=191
1999-01-22 00:28:31 +00:00
David Welch
1908a698e8 Fixed some bugs
svn path=/trunk/; revision=190
1999-01-20 19:02:05 +00:00
jean
97b7ce3ac3 prepare to reserve resource
svn path=/trunk/; revision=189
1999-01-20 13:07:12 +00:00
jean
f03f3933bc corrected bugs in long names, and write operations
add functionnalities to create operation

svn path=/trunk/; revision=188
1999-01-20 13:05:53 +00:00
jean
85e4809132 many bug fixes
svn path=/trunk/; revision=187
1999-01-20 13:00:35 +00:00
jean
e9b21d3c1d modify dir command : print altername name, size and long name
svn path=/trunk/; revision=186
1999-01-20 12:58:11 +00:00
jean
f9a230ad49 return both alternate and long filename
return file size

svn path=/trunk/; revision=185
1999-01-20 12:56:24 +00:00
jean
efa169ca61 remove STATUS_xxx values defined in ddk/status.h
add FILE_ATTRIBUTE_xxx values needed by vfat driver

svn path=/trunk/; revision=184
1999-01-20 12:53:14 +00:00
jean
8f3084dc6d define File disposition values as NT
add FILE_EXISTS

svn path=/trunk/; revision=183
1999-01-20 12:47:37 +00:00
jean
93afbbc9d6 define STATUS values as nt
add some values required by vfat driver

svn path=/trunk/; revision=182
1999-01-20 12:45:33 +00:00
Rex Jolliff
5998255e83 changed ObLookupObject to use Parse member if nonnull
svn path=/trunk/; revision=181
1999-01-20 00:19:46 +00:00
Rex Jolliff
a1fca3d3ae changed Parse member of object type
svn path=/trunk/; revision=180
1999-01-20 00:19:08 +00:00
Rex Jolliff
1e4904f8dd added for crtdll
svn path=/trunk/; revision=179
1999-01-17 17:57:38 +00:00
Rex Jolliff
ac9c590908 adding files for kernel32/crtdll
svn path=/trunk/; revision=178
1999-01-17 17:49:46 +00:00
Rex Jolliff
107f6406fc fixed a bug in K32 heap init
svn path=/trunk/; revision=177
1999-01-17 17:45:20 +00:00
David Welch
12ea84e3c9 Bug fixes
svn path=/trunk/; revision=176
1999-01-17 17:30:18 +00:00
David Welch
8551dc320b Removed obsolete documentation
svn path=/trunk/; revision=175
1999-01-17 17:18:35 +00:00
David Welch
512966336f Add new documentation
svn path=/trunk/; revision=174
1999-01-17 17:17:09 +00:00
David Welch
ed27871348 Updated TODO list
svn path=/trunk/; revision=173
1999-01-17 17:16:00 +00:00
David Welch
51f310e703 Fixed bug (please don't alter functions without debugging)
svn path=/trunk/; revision=172
1999-01-17 17:12:19 +00:00
David Welch
804bfa6fb9 Added this because the crtdll files seem to need it
svn path=/trunk/; revision=171
1999-01-16 21:16:38 +00:00
David Welch
c2059de8af Fixed several bugs
Commented out code that wouldn't compile in lib/crtdll
Began removed memory and file leaks

svn path=/trunk/; revision=170
1999-01-16 21:03:00 +00:00
Rex Jolliff
73d2af04d9 added to cover copyright requirements
svn path=/trunk/; revision=169
1999-01-16 17:30:25 +00:00
Rex Jolliff
d01f8c3180 Boudewjin's massive work on kernel32 and crtdll and a console driver.
svn path=/trunk/; revision=168
1999-01-16 02:11:45 +00:00
jean
6298d37c71 changes to make create directory functions active.
svn path=/trunk/; revision=167
1999-01-13 15:57:45 +00:00
jean
dd705acbd0 correct some bugs in WriteFile function
svn path=/trunk/; revision=166
1999-01-13 15:53:56 +00:00
jean
455be0fece transmit CreateOptions and CreateDisposition to Irp
svn path=/trunk/; revision=165
1999-01-13 15:49:07 +00:00
jean
2d3181f734 more completely implement write operations
svn path=/trunk/; revision=164
1999-01-13 15:46:52 +00:00
jean
2b59b2c1c2 add file dirwr.c
add entry to generate test executables

svn path=/trunk/; revision=163
1999-01-13 15:37:47 +00:00
jean
3c80407d9b write operations on directories
svn path=/trunk/; revision=162
1999-01-13 15:25:50 +00:00
jean
93b8081eed some bugfixes
work on write operations

svn path=/trunk/; revision=161
1999-01-13 15:21:34 +00:00
jean
a044d562b8 add more function's declarations
svn path=/trunk/; revision=160
1999-01-13 15:20:31 +00:00
jean
523aba9a89 cancel changes from david welch : write operations dangerous
remove allocations, use directly buffers

svn path=/trunk/; revision=159
1999-01-13 15:14:48 +00:00
Rex Jolliff
b0cbc91ce1 PE driver loader is complete.
svn path=/trunk/; revision=158
1999-01-13 03:00:06 +00:00
Rex Jolliff
dc7be08202 more work on loader
svn path=/trunk/; revision=157
1999-01-12 07:44:55 +00:00
Rex Jolliff
01e34a063a added for registry support
svn path=/trunk/; revision=156
1999-01-12 01:28:55 +00:00
Rex Jolliff
29ef6b5bac Wrote initial hack at ZwCreateKey and CmInitialize
svn path=/trunk/; revision=155
1999-01-07 01:38:57 +00:00
Rex Jolliff
4159ed2941 Modifed to add Registry specific object mgr types and functions
svn path=/trunk/; revision=154
1999-01-07 01:37:29 +00:00
jean
1e09a4813f redo changes in 1.9 from Rex.
correct bug on fragmented directories.

svn path=/trunk/; revision=153
1999-01-05 12:04:08 +00:00
David Welch
36902d624f Created bugs in wait and timer code
svn path=/trunk/; revision=152
1999-01-04 23:01:18 +00:00
jean
4850652d25 use of correct zones for arguments restartscan and singleentry
svn path=/trunk/; revision=151
1999-01-04 14:11:15 +00:00
jean
c92156be04 added function to defrag free list, because else pool take all memory
with free list.

svn path=/trunk/; revision=150
1999-01-04 12:35:24 +00:00
jean
17b6b4d72a correct bug in write operations
svn path=/trunk/; revision=149
1999-01-04 12:11:35 +00:00
jean
66658f3d1a many changes to :
support one FCB/file and one CCB/open
write on existing files
open of root directory

svn path=/trunk/; revision=148
1999-01-04 12:08:54 +00:00
jean
35f07df64f adaptation to new structs in vfat.h
svn path=/trunk/; revision=147
1999-01-04 12:02:38 +00:00
jean
06a593cc64 changes to support FCB and CCB better
svn path=/trunk/; revision=146
1999-01-04 11:59:25 +00:00
David Welch
20ef31f3cc Added directory listing support for the shell
Correctec bug that prevented listing the root directory in the vfat fsd
Corrected mistake where the SL_xxx constants were too long

svn path=/trunk/; revision=145
1999-01-03 16:18:19 +00:00
Rex Jolliff
2d14c3e110 Changes to support the COFF driver loader
svn path=/trunk/; revision=144
1999-01-01 22:33:38 +00:00
David Welch
02e3d7b08e *** empty log message ***
svn path=/trunk/; revision=143
1999-01-01 22:03:17 +00:00
David Welch
d55d012d33 Added ntdll functions
svn path=/trunk/; revision=142
1999-01-01 21:47:57 +00:00
David Welch
de8fc633f8 Beginnings of ext2fs driver
svn path=/trunk/; revision=141
1999-01-01 21:39:43 +00:00
Rex Jolliff
3244132cc7 Changes to support new VFAT functions and the loader
svn path=/trunk/; revision=140
1998-12-30 22:48:14 +00:00
Rex Jolliff
6ce4528a80 new file for driver from Jean
svn path=/trunk/; revision=139
1998-12-30 19:01:23 +00:00
Rex Jolliff
43fd2f2579 readme for the VFAT driver provided by jean
svn path=/trunk/; revision=138
1998-12-30 18:45:49 +00:00
Rex Jolliff
a984573ad4 more loader changes and new fixes to the VFAT driver from jean
svn path=/trunk/; revision=137
1998-12-30 18:43:27 +00:00
Rex Jolliff
6fd4505b6f more changes to support the loader
svn path=/trunk/; revision=136
1998-12-23 02:40:01 +00:00
David Welch
4209cfec73 Changed type of LONGLONG
svn path=/trunk/; revision=135
1998-12-22 20:41:40 +00:00
David Welch
e007300ee0 Fixed race in task-switching code
svn path=/trunk/; revision=134
1998-12-22 19:14:19 +00:00
David Welch
3ecc11334b Fixed race in task switching code
svn path=/trunk/; revision=133
1998-12-22 19:13:33 +00:00
David Welch
1628f7a89e Fixed a race in the task-switching code
svn path=/trunk/; revision=132
1998-12-22 19:11:47 +00:00
David Welch
b161ff0650 Fixed bug
svn path=/trunk/; revision=131
1998-12-21 15:48:21 +00:00
Rex Jolliff
6cd2bc16b8 Various changes to support the executable/driver loader
svn path=/trunk/; revision=130
1998-12-20 19:41:39 +00:00
David Welch
a9ce8c6379 *** empty log message ***
svn path=/trunk/; revision=129
1998-12-19 19:26:02 +00:00
David Welch
5d1ddcb775 Adding missing functions to ntdll
svn path=/trunk/; revision=128
1998-12-19 19:05:11 +00:00
David Welch
962e8486ea Put def file in its own directory
svn path=/trunk/; revision=127
1998-12-19 19:01:30 +00:00
David Welch
8f8c71dfb9 Minor bug fixes
svn path=/trunk/; revision=126
1998-12-19 18:56:57 +00:00
David Welch
e017266cd0 Corrected some bugs in the system libraries
svn path=/trunk/; revision=125
1998-12-19 18:49:28 +00:00
David Welch
316713be6b Small changes to include files
svn path=/trunk/; revision=124
1998-12-19 18:46:02 +00:00
David Welch
937e125ad7 Improved shell and removed symbol list
svn path=/trunk/; revision=123
1998-12-19 18:44:54 +00:00
David Welch
43c24d3654 Removed string functions from native system calls and removed binary from
repository

svn path=/trunk/; revision=122
1998-12-19 18:40:55 +00:00
David Welch
7e398d4e22 Cleaned up system libraries
svn path=/trunk/; revision=121
1998-12-19 17:48:53 +00:00
Rex Jolliff
0d71cd85bd more hacking on the loader
svn path=/trunk/; revision=120
1998-12-12 17:44:30 +00:00
David Welch
f5d7376e5a Additions to ntifs.h (just for reference)
svn path=/trunk/; revision=119
1998-12-12 17:01:34 +00:00
Rex Jolliff
570be7966c Implemented loader functions for COFF Drivers and BIN apps, and stubs for PE apps
svn path=/trunk/; revision=118
1998-12-12 00:24:12 +00:00
David Welch
6b8cb5c939 Added ChangeLog for better version information, io.h so it would compile
svn path=/trunk/; revision=117
1998-12-08 23:43:37 +00:00
David Welch
6eaf6180fd Corrected a memory leak in the read cleanup code
svn path=/trunk/; revision=116
1998-12-08 19:44:04 +00:00
David Welch
4bc75819a3 Corrected a number of bugs, including the keyboard one
svn path=/trunk/; revision=115
1998-12-08 16:51:47 +00:00
Rex Jolliff
8587170853 didnt want to delete these
svn path=/trunk/; revision=114
1998-12-08 04:31:41 +00:00
Rex Jolliff
683ed8c5a1 Added ZwQueryFileInformation
svn path=/trunk/; revision=113
1998-12-08 04:31:04 +00:00
Rex Jolliff
bc06faa8cd Fixed a bug introduced by a change in ZwAllocateVirtualMemory call
svn path=/trunk/; revision=112
1998-12-06 00:04:04 +00:00
Rex Jolliff
4bc8aa3713 more minor fixes
svn path=/trunk/; revision=111
1998-12-05 00:15:50 +00:00
Rex Jolliff
b097125d77 this file is machine generated
svn path=/trunk/; revision=110
1998-12-04 23:36:58 +00:00
Rex Jolliff
13e75fd710 cleanup to support incorporated changes
svn path=/trunk/; revision=109
1998-12-04 23:35:48 +00:00
Rex Jolliff
37af92952e Rolled in various changes from others
svn path=/trunk/; revision=108
1998-12-04 18:28:13 +00:00
Rex Jolliff
159ee3800d Added this file
svn path=/trunk/; revision=107
1998-12-03 04:49:07 +00:00
Rex Jolliff
82d21c903e Changed include/hal/io.h to halio.h with i386/io.h
svn path=/trunk/; revision=106
1998-11-29 19:39:40 +00:00
Rex Jolliff
b6187e2de7 added ext partition check macro
svn path=/trunk/; revision=105
1998-11-29 19:31:45 +00:00
Rex Jolliff
98d405409a bumped the DRQ timeout up due to user request
svn path=/trunk/; revision=104
1998-11-29 19:29:57 +00:00
Rex Jolliff
ce0b82afeb Used Ext partition detection macro and less intrusive register maps
svn path=/trunk/; revision=103
1998-11-29 19:28:18 +00:00
Rex Jolliff
fd5a21279e Continuing work in progress
svn path=/trunk/; revision=102
1998-11-29 19:25:39 +00:00
Rex Jolliff
e96765787f Thread should be restarted in passive level.
svn path=/trunk/; revision=101
1998-11-29 19:24:46 +00:00
Rex Jolliff
a06ebb79bb Changed include file spec
svn path=/trunk/; revision=100
1998-11-29 19:22:42 +00:00
Rex Jolliff
f075faafdf changed include file spec
svn path=/trunk/; revision=99
1998-11-29 19:15:37 +00:00
Rex Jolliff
043bc3b058 added support for CHECKED macro
svn path=/trunk/; revision=98
1998-11-29 19:11:10 +00:00
Rex Jolliff
a3a5ebb7c7 added CHECKED to defines
svn path=/trunk/; revision=97
1998-11-29 19:09:49 +00:00
Rex Jolliff
f93f98a522 added driver unloading to list
svn path=/trunk/; revision=96
1998-11-29 19:08:21 +00:00
David Welch
93263fa722 Updated version.h only, just a test really
svn path=/trunk/; revision=95
1998-11-28 23:07:08 +00:00
Rex Jolliff
d6830ac891 added more partition types including FAT32
svn path=/trunk/; revision=94
1998-11-13 08:06:13 +00:00
Rex Jolliff
1302d0fe3b used macro for winsize in place of hardcoded number
svn path=/trunk/; revision=93
1998-11-13 08:05:22 +00:00
Rex Jolliff
45a6e16434 fixed error in stub code
svn path=/trunk/; revision=92
1998-11-13 08:04:16 +00:00
Rex Jolliff
c89930f961 udpate
svn path=/trunk/; revision=91
1998-11-07 21:38:16 +00:00
Rex Jolliff
bc9bf59740 New release from Jason
svn path=/trunk/; revision=90
1998-11-07 20:30:33 +00:00
Rex Jolliff
a998ae77b0 Added unimplemented message to unimplemented functions
svn path=/trunk/; revision=89
1998-11-07 20:29:46 +00:00
Rex Jolliff
7499a5965d added unimplemented messages to all imimplemented functions
svn path=/trunk/; revision=88
1998-11-07 20:28:51 +00:00
Rex Jolliff
f530e60c76 Fixed calls to StartTimer
svn path=/trunk/; revision=87
1998-10-31 22:33:17 +00:00
Rex Jolliff
409861205e no change
svn path=/trunk/; revision=86
1998-10-31 22:32:13 +00:00
Rex Jolliff
33e768c8cd added descriptive text to exception dump
svn path=/trunk/; revision=85
1998-10-31 22:30:08 +00:00
Rex Jolliff
5dd16d52fe added cmd to gen syms
svn path=/trunk/; revision=84
1998-10-31 22:25:30 +00:00
Rex Jolliff
3c0b32b97a (Jason) various changes
svn path=/trunk/; revision=83
1998-10-31 15:54:07 +00:00
Rex Jolliff
b5be07756f (Jason) added sector count to blockdev interface
svn path=/trunk/; revision=82
1998-10-31 15:52:45 +00:00
Rex Jolliff
8134515a1a Used a different constant for number of poll retries
svn path=/trunk/; revision=81
1998-10-31 15:51:23 +00:00
Rex Jolliff
a3fbbaa42d added timer test routines
svn path=/trunk/; revision=80
1998-10-31 15:50:08 +00:00
Rex Jolliff
8b29e69d3d Verified correctness of epoch DOW
svn path=/trunk/; revision=79
1998-10-31 15:47:28 +00:00
Rex Jolliff
e3a11b68b8 Fixed timer constants and repitition code
svn path=/trunk/; revision=78
1998-10-31 15:46:36 +00:00
Rex Jolliff
09215f3126 Fixed large integer conv bug
svn path=/trunk/; revision=77
1998-10-31 15:44:22 +00:00
Rex Jolliff
e68e2e431a Added Fix for >255 sector read/write and first hack at timeout code
svn path=/trunk/; revision=76
1998-10-20 06:00:13 +00:00
Rex Jolliff
267b8c4e8c Fix from brian for broken function
svn path=/trunk/; revision=75
1998-10-20 05:58:53 +00:00
Rex Jolliff
dc5f3e0195 Fixed synchronous I/O bug in ZwWriteFile
svn path=/trunk/; revision=74
1998-10-20 05:56:26 +00:00
Rex Jolliff
74ff8524ad Added serial debugging support
svn path=/trunk/; revision=73
1998-10-20 05:54:29 +00:00
Rex Jolliff
37529daf35 Fixed a problem with buffered io IRPs
svn path=/trunk/; revision=72
1998-10-13 03:24:42 +00:00
Rex Jolliff
d0c8759887 Changed failure status report to print hex
svn path=/trunk/; revision=71
1998-10-12 21:05:58 +00:00
Rex Jolliff
8909f04b2c Fixed debugging messages and other minor changes
svn path=/trunk/; revision=70
1998-10-12 21:04:07 +00:00
Rex Jolliff
e1d692c393 Eliminated a compiler warning
svn path=/trunk/; revision=69
1998-10-12 21:02:34 +00:00
Rex Jolliff
1d9a6c728c changed static functions to standard naming convention
svn path=/trunk/; revision=68
1998-10-12 20:58:27 +00:00
Rex Jolliff
0805f2913e added include for debugging macros
svn path=/trunk/; revision=67
1998-10-12 20:54:51 +00:00
Rex Jolliff
135e1512ef UserEvent and UserIosb were not being set in IoBuildSynchronousFsdRequest
svn path=/trunk/; revision=66
1998-10-12 20:51:28 +00:00
Rex Jolliff
a7dd9bd3f9 added some comment markers in the status codes
svn path=/trunk/; revision=65
1998-10-12 20:50:33 +00:00
Rex Jolliff
6144b903c3 chagned to support local build
svn path=/trunk/; revision=64
1998-10-12 20:40:20 +00:00
Rex Jolliff
3afc66723c more chages to bring up to krnl0012
svn path=/trunk/; revision=62
1998-10-05 14:31:06 +00:00
Rex Jolliff
537bf0fdf6 This commit was generated by cvs2svn to compensate for changes in r58,
which included commits to RCS files with non-trunk default branches.

svn path=/trunk/; revision=59
1998-10-05 04:55:45 +00:00
Rex Jolliff
c38258c97a Initial revision
svn path=/trunk/; revision=56
1998-10-05 04:55:44 +00:00
Rex Jolliff
3f988bd286 brings code in line with release 12
svn path=/trunk/; revision=55
1998-10-05 04:50:07 +00:00
Rex Jolliff
ee81c811cd This commit was generated by cvs2svn to compensate for changes in r52,
which included commits to RCS files with non-trunk default branches.

svn path=/trunk/; revision=53
1998-10-05 04:01:30 +00:00
Rex Jolliff
645218d5c8 Initial revision
svn path=/trunk/; revision=50
1998-10-05 04:00:59 +00:00
Rex Jolliff
5c0fb0f108 general bug fix changes
svn path=/trunk/; revision=49
1998-10-05 03:39:36 +00:00
Rex Jolliff
22ebf085eb First release of the IDE driver
svn path=/trunk/; revision=48
1998-09-20 02:22:48 +00:00
Rex Jolliff
cb0fe70650 Page overlapping MDLs have been fixed
svn path=/trunk/; revision=47
1998-09-20 02:21:36 +00:00
Rex Jolliff
9a55f0f7ed this fixes the problem with NASM invocation in make
svn path=/trunk/; revision=46
1998-09-20 02:19:42 +00:00
Rex Jolliff
7967ac94a2 fixes and changes to support IDE driver
svn path=/trunk/; revision=45
1998-09-15 14:31:18 +00:00
Rex Jolliff
4bbc8ea6ef added pool validation to checkpoint/dprint macro
svn path=/trunk/; revision=44
1998-09-15 14:18:47 +00:00
Rex Jolliff
099d789b13 array definition had incorrect length
svn path=/trunk/; revision=43
1998-09-15 14:17:32 +00:00
Rex Jolliff
6bdaf42c26 cleanup of import
svn path=/trunk/; revision=42
1998-09-13 16:32:10 +00:00
Rex Jolliff
40473b6aba This commit was generated by cvs2svn to compensate for changes in r39,
which included commits to RCS files with non-trunk default branches.

svn path=/trunk/; revision=40
1998-09-13 15:55:55 +00:00
Rex Jolliff
ffc37c2cfd Initial revision
svn path=/trunk/; revision=37
1998-09-13 15:55:36 +00:00
Rex Jolliff
e8652909ce changes to support debugging of ide driver
svn path=/trunk/; revision=36
1998-09-13 02:37:20 +00:00
Rex Jolliff
153b0ad928 ZwReadFile was using Write member of Irp union.
ZwReadFile now returns correct status

svn path=/trunk/; revision=35
1998-09-13 01:17:05 +00:00
Rex Jolliff
ca01965c67 added code to initialize CurrentIrp in DeviceObject.
svn path=/trunk/; revision=34
1998-09-13 01:13:48 +00:00
Rex Jolliff
b903d86810 no specific problems fixed
svn path=/trunk/; revision=33
1998-09-09 02:34:38 +00:00
Rex Jolliff
809b4b1eab This commit was generated by cvs2svn to compensate for changes in r30,
which included commits to RCS files with non-trunk default branches.

svn path=/trunk/; revision=31
1998-09-05 17:34:23 +00:00
Rex Jolliff
bb9cc48934 Initial revision
svn path=/trunk/; revision=28
1998-09-05 17:33:57 +00:00
Rex Jolliff
f29364e917 *** empty log message ***
svn path=/trunk/; revision=27
1998-09-05 17:18:00 +00:00
Rex Jolliff
38389db926 reorganized it a little
svn path=/trunk/; revision=26
1998-09-03 01:47:13 +00:00
Rex Jolliff
50b41bfae6 it is not useful for this to be in the archive
svn path=/trunk/; revision=25
1998-09-03 01:46:19 +00:00
Rex Jolliff
b40b785ec0 Implementation of most of the LargeInt functions
svn path=/trunk/; revision=24
1998-09-03 01:43:54 +00:00
Rex Jolliff
35cc27eee0 This commit was generated by cvs2svn to compensate for changes in r21,
which included commits to RCS files with non-trunk default branches.

svn path=/trunk/; revision=22
1998-08-28 23:24:42 +00:00
Rex Jolliff
bbddb2c838 Initial revision
svn path=/trunk/; revision=19
1998-08-28 23:24:25 +00:00
Rex Jolliff
b4be455beb Release Cleanup
svn path=/trunk/; revision=18
1998-08-25 05:06:39 +00:00
Rex Jolliff
2fe2a748af Release cleanup
svn path=/trunk/; revision=17
1998-08-25 04:59:57 +00:00
Rex Jolliff
4ef8280497 Release cleanup
svn path=/trunk/; revision=16
1998-08-25 04:53:56 +00:00
Rex Jolliff
1189c35dd7 Release cleanup
svn path=/trunk/; revision=15
1998-08-25 04:48:36 +00:00
Rex Jolliff
9cef58c15d Release cleanup
svn path=/trunk/; revision=14
1998-08-25 04:41:53 +00:00
Rex Jolliff
cdafa11dc1 new release cleanup
svn path=/trunk/; revision=13
1998-08-25 04:37:43 +00:00
Rex Jolliff
b5efc5cfc5 This commit was generated by cvs2svn to compensate for changes in r10,
which included commits to RCS files with non-trunk default branches.

svn path=/trunk/; revision=11
1998-08-25 04:27:41 +00:00
1646 changed files with 245097 additions and 29719 deletions

2
reactos/.cvsignore Normal file
View File

@@ -0,0 +1,2 @@
dist
errors

14
reactos/CREDITS Normal file
View File

@@ -0,0 +1,14 @@
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)
Brian Palmer (brianp@sginet.com)
Phillip Susi (phreak@iag.net)
Paolo Pantaleo (paolopan@freemail.it)

12
reactos/ChangeLog Normal file
View File

@@ -0,0 +1,12 @@
9/6/99: Implemented ZwOpenProcess
Partially implemented killing other threads (possible memory
leaks)
Made a start on a proper implemention of APCs (based on
article in NT insider)
8/12/98: Corrected bug in shell (Read two keypresses and assumed they
where the key going up and down respectively)
Corrected race in dpc handling
Took out cleanup sections in ZwReadFile (now handled by the APC)
Disabled broken code in kernel32

31
reactos/INSTALL Normal file
View File

@@ -0,0 +1,31 @@
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. 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\system32
Copy subsys/smss/smss.exe to C:\reactos\system32
Copy services/dd/keyboard/keyboard.sys to C:\reactos\system32\drivers
Copy services/dd/blue/blue.sys to C:\reactos\system32\drivers
Copy lib/ntdll/ntdll.dll to C:\reactos\system32
Copy lib/kernel32/kernel32.dll to C:\reactos\system32
Copy lib/crtdll/crtdll.dll to C:\reactos\system32
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'.

280
reactos/Makefile Normal file
View File

@@ -0,0 +1,280 @@
#
# Global makefile
#
#
# Select your host
#
#HOST = mingw32-linux
#HOST = djgpp-msdos
#HOST = mingw32-windows
include rules.mak
#
# Required to run the system
#
COMPONENTS = iface_native ntoskrnl
DLLS = ntdll kernel32 crtdll advapi32 fmifs gdi32
#DLLS = mingw32 user32
SUBSYS = smss win32k
#SUBSYS = csrss
#
# Select the server(s) you want to build
#
SERVERS = win32
# SERVERS = posix linux os2
#
# Select the loader(s) you want to build
#
LOADERS = dos
# LOADERS = boot
#
# Select the device drivers and filesystems you want
#
DEVICE_DRIVERS = blue ide keyboard null parallel serial
# DEVICE_DRIVERS = beep event floppy ide_test mouse sound test test1
FS_DRIVERS = vfat
# FS_DRIVERS = minix ext2 template
KERNEL_SERVICES = $(DEVICE_DRIVERS) $(FS_DRIVERS)
APPS = args hello shell test cat bench apc shm lpc thread event
all: buildno $(COMPONENTS) $(DLLS) $(SUBSYS) $(LOADERS) $(KERNEL_SERVICES) $(APPS)
.PHONY: all
clean: buildno_clean $(COMPONENTS:%=%_clean) $(DLLS:%=%_clean) $(LOADERS:%=%_clean) \
$(KERNEL_SERVICES:%=%_clean) $(SUBSYS:%=%_clean) $(APPS:%=%_clean)
.PHONY: clean
floppy: make_floppy_dirs autoexec_floppy $(COMPONENTS:%=%_floppy) \
$(DLLS:%=%_floppy) $(LOADERS:%=%_floppy) \
$(KERNEL_SERVICES:%=%_floppy) $(SUBSYS:%=%_floppy) \
$(APPS:%=%_floppy)
dist: clean_dist_dir make_dist_dirs $(COMPONENTS:%=%_dist) $(DLLS:%=%_dist) \
$(LOADERS:%=%_dist) $(KERNEL_SERVICES:%=%_dist) $(SUBSYS:%=%_dist) \
$(APPS:%=%_dist)
#
# Build number generator
#
buildno: include/reactos/version.h
make -C apps/buildno
buildno_clean:
make -C apps/buildno clean
buildno_floppy:
buildno_dist:
.PHONY: buildno buildno_clean buildno_floppy buildno_dist
#
# Applications
#
$(APPS): %:
make -C apps/$*
$(APPS:%=%_clean): %_clean:
make -C apps/$* clean
$(APPS:%=%_floppy): %_floppy:
make -C apps/$* floppy
$(APPS:%=%_dist): %_dist:
make -C apps/$* dist
.PHONY: $(APPS) $(APPS:%=%_clean) $(APPS:%=%_floppy) $(APPS:%=%_dist)
#
# Interfaces
#
iface_native:
make -C iface/native
iface_native_clean:
make -C iface/native clean
iface_native_floppy:
iface_native_dist:
.PHONY: iface_native iface_native_clean iface_native_floppy \
iface_native_dist
#
# Device driver rules
#
$(DEVICE_DRIVERS): %:
make -C services/dd/$*
$(DEVICE_DRIVERS:%=%_clean): %_clean:
make -C services/dd/$* clean
$(DEVICE_DRIVERS:%=%_floppy): %_floppy:
make -C services/dd/$* floppy
$(DEVICE_DRIVERS:%=%_dist): %_dist:
make -C services/dd/$* dist
.PHONY: $(DEVICE_DRIVERS) $(DEVICE_DRIVERS:%=%_clean) \
$(DEVICE_DRIVERS:%=%_floppy) $(DEVICE_DRIVERS:%=%_dist)
$(FS_DRIVERS): %:
make -C services/fs/$*
$(FS_DRIVERS:%=%_clean): %_clean:
make -C services/fs/$* clean
$(FS_DRIVERS:%=%_floppy): %_floppy:
make -C services/fs/$* floppy
$(FS_DRIVERS:%=%_dist): %_dist:
make -C services/fs/$* dist
.PHONY: $(FS_DRIVERS) $(FS_DRIVERS:%=%_clean) $(FS_DRIVERS:%=%_floppy) \
$(FS_DRIVERS:%=%_dist)
#
# Kernel loaders
#
$(LOADERS): %:
make -C loaders/$*
$(LOADERS:%=%_clean): %_clean:
make -C loaders/$* clean
$(LOADERS:%=%_floppy): %_floppy:
make -C loaders/$* floppy
$(LOADERS:%=%_dist): %_dist:
make -C loaders/$* dist
.PHONY: $(LOADERS) $(LOADERS:%=%_clean) $(LOADERS:%=%_floppy) \
$(LOADERS:%=%_dist)
#
# Required system components
#
ntoskrnl:
make -C ntoskrnl
ntoskrnl_clean:
make -C ntoskrnl clean
ntoskrnl_floppy:
make -C ntoskrnl floppy
ntoskrnl_dist:
make -C ntoskrnl dist
.PHONY: ntoskrnl ntoskrnl_clean ntoskrnl_floppy ntoskrnl_dist
#
# Required DLLs
#
$(DLLS): %:
make -C lib/$*
$(DLLS:%=%_clean): %_clean:
make -C lib/$* clean
$(DLLS:%=%_floppy): %_floppy:
make -C lib/$* floppy
$(DLLS:%=%_dist): %_dist:
make -C lib/$* dist
.PHONY: $(DLLS) $(DLLS:%=%_clean) $(DLLS:%=%_floppy) $(DLLS:%=%_dist)
#
# Kernel Subsystems
#
$(SUBSYS): %:
make -C subsys/$*
$(SUBSYS:%=%_clean): %_clean:
make -C subsys/$* clean
$(SUBSYS:%=%_floppy): %_floppy:
make -C subsys/$* floppy
$(SUBSYS:%=%_dist): %_dist:
make -C subsys/$* dist
.PHONY: $(SUBSYS) $(SUBSYS:%=%_clean) $(SUBSYS:%=%_floppy) \
$(SUBSYS:%=%_dist)
#
# Make an install floppy
#
install: all
./install.sh /mnt/hda1
make_floppy_dirs:
ifeq ($(DOSCLI),yes)
mkdir $(FLOPPY_DIR)\dlls
mkdir $(FLOPPY_DIR)\apps
mkdir $(FLOPPY_DIR)\drivers
mkdir $(FLOPPY_DIR)\subsys
else
mkdir $(FLOPPY_DIR)/dlls $(FLOPPY_DIR)/apps $(FLOPPY_DIR)/drivers
mkdir $(FLOPPY_DIR)/subsys
endif
.PHONY: make_floppy_dirs
autoexec_floppy: $(FLOPPY_DIR)/autoexec.bat
$(FLOPPY_DIR)/autoexec.bat: bootflop.bat
ifeq ($(DOSCLI),yes)
$(CP) bootflop.bat $(FLOPPY_DIR)\autoexec.bat
else
$(CP) bootflop.bat $(FLOPPY_DIR)/autoexec.bat
endif
#
# Make a distribution saveset
#
clean_dist_dir:
ifeq ($(DOSCLI),yes)
- $(RM) $(DIST_DIR)\dlls\*.dll
- $(RM) $(DIST_DIR)\apps\*.exe
- $(RM) $(DIST_DIR)\drivers\*.sys
- $(RM) $(DIST_DIR)\subsys\*.exe
- $(RMDIR) $(DIST_DIR)\dlls
- $(RMDIR) $(DIST_DIR)\apps
- $(RMDIR) $(DIST_DIR)\drivers
- $(RMDIR) $(DIST_DIR)\subsys
- $(RMDIR) $(DIST_DIR)
else
$(RM) -r $(DIST_DIR)
endif
make_dist_dirs:
ifeq ($(DOSCLI),yes)
mkdir $(DIST_DIR)
mkdir $(DIST_DIR)\dlls
mkdir $(DIST_DIR)\apps
mkdir $(DIST_DIR)\drivers
mkdir $(DIST_DIR)\dlls
mkdir $(DIST_DIR)\subsys
else
mkdir $(DIST_DIR) $(DIST_DIR)/dlls $(DIST_DIR)/apps $(DIST_DIR)/drivers
mkdir $(DIST_DIR)/subsys
endif
.PHONY: clean_dist_dir make_dist_dirs

15
reactos/NEWS Normal file
View File

@@ -0,0 +1,15 @@
0.0.14: Converted to PE format
All system libraries are now dlls
0.0.13: Mostly bugfixes (I think)
0.0.12: Added support for multiple processes (not really tested)
System calls
kernel32 now compiles (only as a static library)
Fixed invalid tss bug (hopefully)
Added section support
Added some of the ZwxxxVirtual calls
Added prototype caching functions (only the Minix fsd actually
uses them)
Added handle access and type checking
Prototype APC implementation (no support for user APCs)

24
reactos/README Normal file
View File

@@ -0,0 +1,24 @@
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.reactos.com/
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

View File

@@ -0,0 +1,33 @@
#include <windows.h>
extern int main(int args, char* argv[], char* environ[]);
static unsigned int _argc = 0;
static char** _argv = NULL;
static char** _environ = NULL;
int mainCRTStartup(PWSTR args)
{
int nRet;
// SetUnhandledExceptionFilter(NULL);
// _fpreset();
// __GetMainArgs(&_argc, &_argv, &_environ, 0);
nRet = main(_argc, _argv, _environ);
// _cexit();
ExitProcess(nRet);
}
int WinMainCRTStartup()
{
return mainCRTStartup(NULL);
}
void __main(void)
{
}

View File

@@ -0,0 +1,97 @@
#include <ddk/ntddk.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
HANDLE OutputHandle;
HANDLE InputHandle;
void debug_printf(char* fmt, ...)
{
va_list args;
char buffer[255];
va_start(args,fmt);
vsprintf(buffer,fmt,args);
WriteConsoleA(OutputHandle, buffer, strlen(buffer), NULL, NULL);
va_end(args);
}
VOID STDCALL ApcRoutine(PVOID Context,
PIO_STATUS_BLOCK IoStatus,
ULONG Reserved)
{
printf("(apc.exe) ApcRoutine(Context %x)\n", Context);
}
void main(int argc, char* argv[])
{
int i;
NTSTATUS Status;
HANDLE FileHandle;
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING FileName;
IO_STATUS_BLOCK IoStatus;
CHAR Buffer[256];
HANDLE EventHandle;
AllocConsole();
InputHandle = GetStdHandle(STD_INPUT_HANDLE);
OutputHandle = GetStdHandle(STD_OUTPUT_HANDLE);
printf("APC test program\n");
EventHandle = CreateEventW(NULL,
FALSE,
FALSE,
NULL);
if (EventHandle == INVALID_HANDLE_VALUE)
{
printf("Failed to create event\n");
return;
}
printf("Opening file\n");
RtlInitUnicodeString(&FileName,
L"\\C:\\a.txt");
InitializeObjectAttributes(&ObjectAttributes,
&FileName,
0,
NULL,
NULL);
printf("Creating file\n");
FileHandle = CreateFileW(L"C:\\a.txt",
FILE_GENERIC_READ | FILE_GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
FILE_FLAG_OVERLAPPED,
NULL);
if (FileHandle == INVALID_HANDLE_VALUE)
{
printf("Open failed\n");
return;
}
printf("Reading file\n");
Status = ZwReadFile(FileHandle,
NULL,
ApcRoutine,
0xdeadbeef,
&IoStatus,
Buffer,
256,
NULL,
NULL);
if (!NT_SUCCESS(Status))
{
printf("Read failed\n");
}
printf("Waiting\n");
WaitForSingleObjectEx(EventHandle, INFINITE, TRUE);
printf("Returned from wait\n");
ZwClose(FileHandle);
printf("Program finished\n");
for(;;);
}

View File

@@ -0,0 +1,44 @@
#
#
#
OBJECTS= ../common/crt0.o apc.o
PROGS= apc.exe
BASE_CFLAGS = -I../../include
LIBS = ../../lib/crtdll/crtdll.a ../../lib/kernel32/kernel32.a \
../../lib/ntdll/ntdll.a
all: $(PROGS)
.phony: all
clean:
- $(RM) apc.o
- $(RM) apc.exe
- $(RM) apc.sym
.phony: clean
floppy: $(PROGS:%=$(FLOPPY_DIR)/apps/%)
$(PROGS:%=$(FLOPPY_DIR)/apps/%): $(FLOPPY_DIR)/apps/%: %
ifeq ($(DOSCLI),yes)
$(CP) $* $(FLOPPY_DIR)\apps\$*
else
$(CP) $* $(FLOPPY_DIR)/apps/$*
endif
dist: $(PROGS:%=../../$(DIST_DIR)/apps/%)
$(PROGS:%=../../$(DIST_DIR)/apps/%): ../../$(DIST_DIR)/apps/%: %
ifeq ($(DOSCLI),yes)
$(CP) $* ..\..\$(DIST_DIR)\apps\$*
else
$(CP) $* ../../$(DIST_DIR)/apps/$*
endif
apc.exe: $(OBJECTS) $(LIBS)
$(LD) $(OBJECTS) $(LIBS) -o apc.exe
$(NM) --numeric-sort apc.exe > apc.sym
include ../../rules.mak

View File

@@ -0,0 +1,39 @@
#include <ddk/ntddk.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
HANDLE OutputHandle;
HANDLE InputHandle;
void debug_printf(char* fmt, ...)
{
va_list args;
char buffer[255];
va_start(args,fmt);
vsprintf(buffer,fmt,args);
WriteConsoleA(OutputHandle, buffer, strlen(buffer), NULL, NULL);
va_end(args);
}
int main(int argc, char* argv[])
{
int i;
AllocConsole();
InputHandle = GetStdHandle(STD_INPUT_HANDLE);
OutputHandle = GetStdHandle(STD_OUTPUT_HANDLE);
printf("GetCommandLineA() %s\n",GetCommandLineA());
debug_printf("GetCommandLineA() %s\n",GetCommandLineA());
debug_printf("argc %d\n", argc);
for (i=0; i<argc; i++)
{
debug_printf("Argv[%d]: %x\n",i,argv[i]);
debug_printf("Argv[%d]: '%s'\n",i,argv[i]);
}
return 0;
}

View File

@@ -0,0 +1,42 @@
#
#
#
OBJECTS= args.o
PROGS= args.exe
BASE_CFLAGS = -I../../include
all: $(PROGS)
.phony: all
clean:
- $(RM) args.o
- $(RM) args.exe
- $(RM) args.sym
.phony: clean
floppy: $(PROGS:%=$(FLOPPY_DIR)/apps/%)
$(PROGS:%=$(FLOPPY_DIR)/apps/%): $(FLOPPY_DIR)/apps/%: %
ifeq ($(DOSCLI),yes)
$(CP) $* $(FLOPPY_DIR)\apps\$*
else
$(CP) $* $(FLOPPY_DIR)/apps/$*
endif
dist: $(PROGS:%=../../$(DIST_DIR)/apps/%)
$(PROGS:%=../../$(DIST_DIR)/apps/%): ../../$(DIST_DIR)/apps/%: %
ifeq ($(DOSCLI),yes)
$(CP) $* ..\..\$(DIST_DIR)\apps\$*
else
$(CP) $* ../../$(DIST_DIR)/apps/$*
endif
args.exe: $(OBJECTS)
$(CC) $(OBJECTS) -o args.exe
$(NM) --numeric-sort args.exe > args.sym
include ../../rules.mak

View File

@@ -0,0 +1,8 @@
/*
*
*/
int main(int argc, char* argv[])
{
}

View File

@@ -0,0 +1,82 @@
#include <stdio.h>
#include <windows.h>
#define NR_THREADS (0x1)
DWORD WINAPI
thread_main1(LPVOID param)
{
printf("Thread 1 running (Counter %lu)\n", (DWORD)param);
return 0;
}
DWORD WINAPI
thread_main2(LPVOID param)
{
printf("Thread 2 running (Counter %lu)\n", (DWORD)param);
return 0;
}
int main (void)
{
HANDLE hThread;
DWORD i=0;
DWORD id;
#if 1
printf("Creating %d threads...\n",NR_THREADS*2);
for (i=0;i<NR_THREADS;i++)
{
CreateThread(NULL,
0,
thread_main1,
(LPVOID)i,
0,
&id);
/* CreateThread(NULL,
0,
thread_main2,
(LPVOID)i,
0,
&id);*/
}
printf("All threads created...\n");
/*
* Waiting for threads is not implemented yet.
* If you want to see all threads running, uncomment the
* call to SuspendThread(). The test application will
* freeze after all threads are created.
*/
/* SuspendThread (GetCurrentThread()); */
#else
printf("Creating thread...\n");
hThread = CreateThread(NULL,
0,
thread_main1,
(LPVOID)i,
0,
&id);
printf("Thread created. Waiting for termination...\n");
WaitForSingleObject (hThread,
-1);
CloseHandle (hThread);
printf("Thread terminated...\n");
#endif
return 0;
}

View File

@@ -0,0 +1,41 @@
#
#
#
PROGS = bench-thread
all: $(PROGS:%=%.exe)
.phony: all
clean: $(PROGS:%=%_clean)
$(PROGS:%=%_clean): %_clean:
- $(RM) $*.o
- $(RM) $*.exe
- $(RM) $*.sym
.phony: clean
floppy: # $(PROGS:%=$(FLOPPY_DIR)/apps/%.exe)
$(PROGS:%=$(FLOPPY_DIR)/apps/%.exe): $(FLOPPY_DIR)/apps/%.exe: %.exe
ifeq ($(DOSCLI),yes)
$(CP) $*.exe $(FLOPPY_DIR)\apps\$*.exe
else
$(CP) $*.exe $(FLOPPY_DIR)/apps/$*.exe
endif
dist: $(PROGS:%=../../$(DIST_DIR)/apps/%.exe)
$(PROGS:%=../../$(DIST_DIR)/apps/%.exe): ../../$(DIST_DIR)/apps/%.exe: %.exe
ifeq ($(DOSCLI),yes)
$(CP) $*.exe ..\..\$(DIST_DIR)\apps\$*.exe
else
$(CP) $*.exe ../../$(DIST_DIR)/apps/$*.exe
endif
bench-thread.exe: bench-thread.c
$(CC) $(CFLAGS) bench-thread.c -lkernel32 -o bench-thread.exe
$(NM) --numeric-sort bench-thread.exe > bench-thread.sym
include ../../rules.mak

View File

@@ -0,0 +1,33 @@
#include <windows.h>
#include <stdio.h>
HANDLE events[2];
DWORD WINAPI thread( LPVOID crap )
{
SetEvent( events[0] );
if( crap )
SetEvent( events[1] );
return 1;
}
int main()
{
DWORD id, Status;
printf( "Creating events\n" );
events[0] = CreateEvent( 0, TRUE, FALSE, 0 );
events[1] = CreateEvent( 0, TRUE, FALSE, 0 );
printf( "Created events\n" );
CreateThread( 0, 0, thread, 0, 0, &id );
printf( "WaitForSingleObject %s\n", ( WaitForSingleObject( events[0], INFINITE ) == WAIT_OBJECT_0 ? "worked" : "failed" ) );
ResetEvent( events[0] );
CreateThread( 0, 0, thread, 0, 0, &id );
printf( "WaitForMultipleObjects with waitall = FALSE %s\n", ( WaitForMultipleObjects( 2, events, FALSE, INFINITE ) == WAIT_OBJECT_0 ? "worked" : "failed" ) );
ResetEvent( events[0] );
CreateThread( 0, 0, thread, (void *)1, 0, &id );
Status = WaitForMultipleObjects( 2, events, TRUE, INFINITE );
printf( "WaitForMultipleObjects with waitall = TRUE %s\n", ( Status == WAIT_OBJECT_0 || Status == WAIT_OBJECT_0 + 1 ? "worked" : "failed" ) );
ResetEvent( events[0] );
printf( "WaitForSingleObject with timeout %s\n", ( WaitForSingleObject( events[0], 100 ) == WAIT_TIMEOUT ? "worked" : "failed" ) );
return 0;
}

View File

@@ -0,0 +1,41 @@
#
#
#
PROGS = event
all: $(PROGS:%=%.exe)
.phony: all
clean: $(PROGS:%=%_clean)
$(PROGS:%=%_clean): %_clean:
- $(RM) $*.o
- $(RM) $*.exe
- $(RM) $*.sym
.phony: clean
floppy: # $(PROGS:%=$(FLOPPY_DIR)/apps/%.exe)
$(PROGS:%=$(FLOPPY_DIR)/apps/%.exe): $(FLOPPY_DIR)/apps/%.exe: %.exe
ifeq ($(DOSCLI),yes)
$(CP) $*.exe $(FLOPPY_DIR)\apps\$*.exe
else
$(CP) $*.exe $(FLOPPY_DIR)/apps/$*.exe
endif
dist: $(PROGS:%=../../$(DIST_DIR)/apps/%.exe)
$(PROGS:%=../../$(DIST_DIR)/apps/%.exe): ../../$(DIST_DIR)/apps/%.exe: %.exe
ifeq ($(DOSCLI),yes)
$(CP) $*.exe ..\..\$(DIST_DIR)\apps\$*.exe
else
$(CP) $*.exe ../../$(DIST_DIR)/apps/$*.exe
endif
event.exe: event.c
$(CC) $(CFLAGS) event.c -lkernel32 -o event.exe
$(NM) --numeric-sort event.exe > event.sym
include ../../rules.mak

View File

@@ -0,0 +1,8 @@
#include <stdio.h>
int main(int argc, char* argv[])
{
printf("Hello world\n");
return(0);
}

View File

@@ -0,0 +1,39 @@
#
#
#
OBJECTS = hello.o
PROGS = hello.exe
LIBS =
CLEAN_FILES = hello.o hello.exe
all: hello.exe
clean: $(CLEAN_FILES:%=%_clean)
$(CLEAN_FILES:%=%_clean): %_clean:
- $(RM) $*
.phony: clean $(CLEAN_FILES:%=%_clean)
floppy: $(PROGS:%=$(FLOPPY_DIR)/apps/%)
$(PROGS:%=$(FLOPPY_DIR)/apps/%): $(FLOPPY_DIR)/apps/%: %
ifeq ($(DOSCLI),yes)
$(CP) $* $(FLOPPY_DIR)\apps\$*
else
$(CP) $* $(FLOPPY_DIR)/apps/$*
endif
dist: $(PROGS:%=../../$(DIST_DIR)/apps/%)
$(PROGS:%=../../$(DIST_DIR)/apps/%): ../../$(DIST_DIR)/apps/%: %
ifeq ($(DOSCLI),yes)
$(CP) $* ..\..\$(DIST_DIR)\apps\$*
else
$(CP) $* ../../$(DIST_DIR)/apps/$*
endif
hello.exe: $(OBJECTS)
$(CC) $(OBJECTS) -o hello.exe
include ../../rules.mak

View File

@@ -0,0 +1,205 @@
/* $Id: conport.c,v 1.5 1999/07/17 23:10:12 ea Exp $
*
* reactos/apps/lpc/conport.c
*
* To be run in a real WNT 4.0 system with
* "\SmApiPort" as argument. Do not try to
* connect to "\Windows\ApiPort" since that
* reboots immeditely.
*
* Use Russinovich' HandleEx to verify
* conport.exe owns two unnamed LPC ports:
* the one created by kernel32.dll connecting
* to csrss.exe, and one connected to here.
*
* 19990627 (Emanuele Aliberti)
* Initial implementation.
* 19990704 (EA)
* Dump object's attributes moved in dumpinfo.c.
*/
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#define PROTO_LPC
#include <ddk/ntddk.h>
#include "dumpinfo.h"
#define LPC_CONNECT_FLAG1 0x00000001
#define LPC_CONNECT_FLAG2 0x00000010
#define LPC_CONNECT_FLAG3 0x00000100
#define LPC_CONNECT_FLAG4 0x00001000
#define LPC_CONNECT_FLAG5 0x00010000
NTSTATUS
(STDCALL * ConnectPort)(
OUT PHANDLE PortHandle,
IN PUNICODE_STRING PortName,
IN POBJECT_ATTRIBUTES ObjectAttributes,
IN DWORD Unknown3,
IN DWORD Unknown4,
IN DWORD Unknown5,
IN DWORD Unknown6,
IN ULONG Flags
);
NTSTATUS
(STDCALL * QueryObject)(
IN HANDLE ObjectHandle,
IN CINT ObjectInformationClass,
OUT PVOID ObjectInformation,
IN ULONG Length,
OUT PULONG ResultLength
);
NTSTATUS
(STDCALL * YieldExecution)(VOID);
#define BUF_SIZE 1024
#define MAXARG 1000000
VOID
TryConnectPort(char *port_name)
{
DWORD Status = 0;
HANDLE Port = 0;
int i;
UNICODE_STRING PortName;
OBJECT_ATTRIBUTES ObjectAttributes;
WORD Name [BUF_SIZE] = {0};
int dwx = 0;
char * port_name_save = port_name;
/*
* Convert the port's name to Unicode.
*/
for (
PortName.Length = 0;
( *port_name
&& (PortName.Length < BUF_SIZE)
);
)
{
Name[PortName.Length++] = (WORD) *port_name++;
}
Name[PortName.Length] = 0;
PortName.Length = PortName.Length * sizeof (WORD);
PortName.MaximumLength = PortName.Length + sizeof (WORD);
PortName.Buffer = (PWSTR) Name;
/*
* Prepare the port object attributes.
*/
ObjectAttributes.Length =
sizeof (OBJECT_ATTRIBUTES);
ObjectAttributes.RootDirectory =
NULL;
ObjectAttributes.ObjectName =
NULL /*& PortName */;
ObjectAttributes.Attributes =
OBJ_CASE_INSENSITIVE;
ObjectAttributes.SecurityDescriptor =
NULL;
ObjectAttributes.SecurityQualityOfService =
NULL;
/*
* Try to issue a connection request.
*/
Port = 0;
Status = ConnectPort(
& Port,
& PortName,
& ObjectAttributes,
0,
0,
0,
0,
LPC_CONNECT_FLAG5
);
if (Status == STATUS_SUCCESS)
{
DumpInfo(
Name,
Status,
"connected",
Port
);
/* Hot waiting */
for (dwx=0; dwx<MAXARG; ++dwx)
{
YieldExecution();
}
if (FALSE == CloseHandle(Port))
{
printf(
"Could not close the port handle %08X.\n",
Port
);
}
return;
}
printf(
"Connection to port \"%s\" failed (Status = %08X).\n",
port_name_save,
Status
);
}
main( int argc, char * argv[] )
{
HINSTANCE ntdll;
if (argc != 2)
{
printf("WNT LPC Port Connector\n");
printf("Usage: %s [port_name]\n",argv[0]);
exit(EXIT_FAILURE);
}
printf("LoadLibrary(NTDLL)\n");
ntdll = LoadLibrary("NTDLL");
if (ntdll == NULL)
{
printf("Could not load NTDLL\n");
return EXIT_FAILURE;
}
printf("GetProcAddress(NTDLL.NtConnectPort)\n");
ConnectPort = (VOID*) GetProcAddress(
ntdll,
"NtConnectPort"
);
if (ConnectPort == NULL)
{
FreeLibrary(ntdll);
printf("Could not find NTDLL.NtConnectPort\n");
return EXIT_FAILURE;
}
printf("GetProcAddress(NTDLL.NtQueryObject)\n");
QueryObject = (VOID*) GetProcAddress(
ntdll,
"NtQueryObject"
);
if (QueryObject == NULL)
{
FreeLibrary(ntdll);
printf("Could not find NTDLL.NtQueryObject\n");
return EXIT_FAILURE;
}
printf("GetProcAddress(NTDLL.NtYieldExecution)\n");
YieldExecution = (VOID*) GetProcAddress(
ntdll,
"NtYieldExecution"
);
if (YieldExecution == NULL)
{
FreeLibrary(ntdll);
printf("Could not find NTDLL.NtYieldExecution\n");
return EXIT_FAILURE;
}
printf("TryConnectPort(%s)\n",argv[1]);
TryConnectPort(argv[1]);
printf("Done\n");
return EXIT_SUCCESS;
}
/* EOF */

View File

@@ -0,0 +1,192 @@
/* $Id: creport.c,v 1.2 1999/07/17 23:10:12 ea Exp $
*
* reactos/apps/lpc/creport.c
*
* To be run in a real WNT 4.0 system to
* create an LPC named port.
*
* Use Russinovich' HandleEx to verify
* creport.exe owns the named LPC port
* you asked to create.
*/
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#define PROTO_LPC
#include <ddk/ntddk.h>
#include "dumpinfo.h"
#define LPC_CONNECT_FLAG1 0x00000001
#define LPC_CONNECT_FLAG2 0x00000010
#define LPC_CONNECT_FLAG3 0x00000100
#define LPC_CONNECT_FLAG4 0x00001000
#define LPC_CONNECT_FLAG5 0x00010000
NTSTATUS
(STDCALL * CreatePort)(
/*OUT PHANDLE PortHandle,*/
PVOID Buffer,
IN POBJECT_ATTRIBUTES PortAttributes OPTIONAL,
IN ACCESS_MASK DesiredAccess,
IN DWORD Unknown3,
IN ULONG Flags
);
NTSTATUS
(STDCALL * QueryObject)(
IN HANDLE ObjectHandle,
IN CINT ObjectInformationClass,
OUT PVOID ObjectInformation,
IN ULONG Length,
OUT PULONG ResultLength
);
NTSTATUS
(STDCALL * YieldExecution)(VOID);
#define BUF_SIZE 1024
#define MAXARG 5000000
VOID
TryCreatePort(char *port_name)
{
DWORD Status = 0;
HANDLE Port = 0;
int i;
UNICODE_STRING PortName;
OBJECT_ATTRIBUTES ObjectAttributes;
WORD Name [BUF_SIZE] = {0};
int dwx = 0;
char * port_name_save = port_name;
/*
* Convert the port's name to Unicode.
*/
for (
PortName.Length = 0;
( *port_name
&& (PortName.Length < BUF_SIZE)
);
)
{
Name[PortName.Length++] = (WORD) *port_name++;
}
Name[PortName.Length] = 0;
PortName.Length = PortName.Length * sizeof (WORD);
PortName.MaximumLength = PortName.Length + sizeof (WORD);
PortName.Buffer = (PWSTR) Name;
/*
* Prepare the port object attributes.
*/
ObjectAttributes.Length =
sizeof (OBJECT_ATTRIBUTES);
ObjectAttributes.RootDirectory =
NULL;
ObjectAttributes.ObjectName =
& PortName;
ObjectAttributes.Attributes =
0; //OBJ_CASE_INSENSITIVE --> STATUS_INVALID_PARAMETER ==> case sensitive!;
ObjectAttributes.SecurityDescriptor =
NULL;
ObjectAttributes.SecurityQualityOfService =
NULL;
/*
* Try to issue a connection request.
*/
Port = 0;
Status = CreatePort(
& Port,
& ObjectAttributes,
0, /* ACCESS_MASK? */
0, /* Unknown3 */
LPC_CONNECT_FLAG5
);
if (Status == STATUS_SUCCESS)
{
DumpInfo(
Name,
Status,
"created",
Port
);
/* Hot waiting */
for (dwx=0; dwx<MAXARG; ++dwx)
{
YieldExecution();
}
if (FALSE == CloseHandle(Port))
{
printf(
"Could not close the port handle %08X.\n",
Port
);
}
return;
}
printf(
"Creating port \"%s\" failed (Status = %08X).\n",
port_name_save,
Status
);
}
main( int argc, char * argv[] )
{
HINSTANCE ntdll;
if (argc != 2)
{
printf("WNT LPC Port Creator\n");
printf("Usage: %s [port_name]\n",argv[0]);
exit(EXIT_FAILURE);
}
printf("LoadLibrary(NTDLL)\n");
ntdll = LoadLibrary("NTDLL");
if (ntdll == NULL)
{
printf("Could not load NTDLL\n");
return EXIT_FAILURE;
}
printf("GetProcAddress(NTDLL.NtCreatePort)\n");
CreatePort = (VOID*) GetProcAddress(
ntdll,
"NtCreatePort"
);
if (CreatePort == NULL)
{
FreeLibrary(ntdll);
printf("Could not find NTDLL.NtCreatePort\n");
return EXIT_FAILURE;
}
printf("GetProcAddress(NTDLL.NtQueryObject)\n");
QueryObject = (VOID*) GetProcAddress(
ntdll,
"NtQueryObject"
);
if (QueryObject == NULL)
{
FreeLibrary(ntdll);
printf("Could not find NTDLL.NtQueryObject\n");
return EXIT_FAILURE;
}
printf("GetProcAddress(NTDLL.NtYieldExecution)\n");
YieldExecution = (VOID*) GetProcAddress(
ntdll,
"NtYieldExecution"
);
if (YieldExecution == NULL)
{
FreeLibrary(ntdll);
printf("Could not find NTDLL.NtYieldExecution\n");
return EXIT_FAILURE;
}
printf("TryCreatePort(%s)\n",argv[1]);
TryCreatePort(argv[1]);
printf("Done\n");
return EXIT_SUCCESS;
}
/* EOF */

View File

@@ -0,0 +1,239 @@
/* $Id: dumpinfo.c,v 1.2 1999/07/17 23:10:12 ea Exp $
*
* reactos/apps/lpc/dumpinfo.c
*
* ReactOS Operating System
*
* Dump a kernel object's attributes by its handle.
*
* 19990627 (Emanuele Aliberti)
* Initial implementation.
* 19990704 (EA)
* Added code to find the basic information buffer size
* for the LPC port object.
* 19990710 (EA)
*
*/
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <ddk/ntddk.h>
#define BUF_SIZE 1024
#define MAX_BASIC_INFO_SIZE 512
extern
NTSTATUS
(STDCALL * QueryObject)(
IN HANDLE ObjectHandle,
IN CINT ObjectInformationClass,
OUT PVOID ObjectInformation,
IN ULONG Length,
OUT PULONG ResultLength
);
extern
NTSTATUS
(STDCALL * QueryInformationPort)(
IN HANDLE PortHandle,
IN CINT PortInformationClass, /* guess */
OUT PVOID PortInformation, /* guess */
IN ULONG PortInformationLength, /* guess */
OUT PULONG ReturnLength /* guess */
);
/*
static
VOID
DumpBuffer(
char *Name,
BYTE *buffer,
ULONG size
)
{
register ULONG i = 0;
printf("%s [%d] = ",Name,size);
for ( i = 0;
i != size;
++i
)
{
printf("%02X",buffer[i]);
}
printf("\n");
}
*/
VOID
DumpInfo (
LPCWSTR Name,
NTSTATUS Status,
LPCWSTR Comment,
HANDLE Port
)
{
BYTE ObjectInformation [BUF_SIZE] = {0};
ULONG ResultLength;
wprintf(
L"Port \"%s\" %s:\n",
Name,
Comment
);
printf("\tStatus = %08X\n",Status);
printf("\tPort = %08X\n\n",Port);
/*
* Query object information.
*/
printf("Basic Information:\n");
Status = QueryObject(
Port,
ObjectBasicInformation,
ObjectInformation,
sizeof (LPC_PORT_BASIC_INFORMATION),
& ResultLength
);
if (Status == STATUS_SUCCESS)
{
PLPC_PORT_BASIC_INFORMATION i;
i = (PLPC_PORT_BASIC_INFORMATION) ObjectInformation;
printf( "\tUnknown01 = 0x%08X\n", i->Unknown0 );
printf( "\tUnknown02 = 0x%08X\n", i->Unknown1 );
printf( "\tUnknown03 = 0x%08X\n", i->Unknown2 );
printf( "\tUnknown04 = 0x%08X\n", i->Unknown3 );
printf( "\tUnknown05 = 0x%08X\n", i->Unknown4 );
printf( "\tUnknown06 = 0x%08X\n", i->Unknown5 );
printf( "\tUnknown07 = 0x%08X\n", i->Unknown6 );
printf( "\tUnknown08 = 0x%08X\n", i->Unknown7 );
printf( "\tUnknown09 = 0x%08X\n", i->Unknown8 );
printf( "\tUnknown10 = 0x%08X\n", i->Unknown9 );
printf( "\tUnknown11 = 0x%08X\n", i->Unknown10 );
printf( "\tUnknown12 = 0x%08X\n", i->Unknown11 );
printf( "\tUnknown13 = 0x%08X\n", i->Unknown12 );
printf( "\tUnknown14 = 0x%08X\n", i->Unknown13 );
}
else
{
printf("\tStatus = %08X\n",Status);
}
printf("Type Information:\n");
Status = QueryObject(
Port,
ObjectTypeInformation,
ObjectInformation,
sizeof ObjectInformation,
& ResultLength
);
if (Status == STATUS_SUCCESS)
{
OBJECT_TYPE_INFORMATION * i;
i = (OBJECT_TYPE_INFORMATION *) ObjectInformation;
wprintf(
L"\tName: \"%s\"\n",
(i->Name.Length ? i->Name.Buffer : L"")
);
/*
FIXME: why this always raise an access violation exception?
wprintf(
L"\tType: \"%s\"\n",
(i->Type.Length ? i->Type.Buffer : L"")
);
/**/
printf(
"\tTotal Handles: %d\n",
i->TotalHandles
);
printf(
"\tReference Count: %d\n",
i->ReferenceCount
);
}
else
{
printf("\tStatus = %08X\n",Status);
}
printf("Name Information:\n");
Status = QueryObject(
Port,
ObjectNameInformation,
ObjectInformation,
sizeof ObjectInformation,
& ResultLength
);
if (Status == STATUS_SUCCESS)
{
OBJECT_NAME_INFORMATION * i;
i = (OBJECT_NAME_INFORMATION *) ObjectInformation;
wprintf(
L"\tName: \"%s\"\n",
(i->Name.Length ? i->Name.Buffer : L"")
);
}
else
{
printf("\tStatus = %08X\n",Status);
}
printf("Data Information:\n");
Status = QueryObject(
Port,
ObjectDataInformation,
ObjectInformation,
sizeof ObjectInformation,
& ResultLength
);
if (Status == STATUS_SUCCESS)
{
OBJECT_DATA_INFORMATION * i;
i = (OBJECT_DATA_INFORMATION *) ObjectInformation;
printf(
"\tInherit Handle: %s\n",
(i->bInheritHandle ? "TRUE" : "FALSE")
);
printf(
"\tProtect from Close: %s\n",
(i->bProtectFromClose ? "TRUE" : "FALSE")
);
}
else
{
printf("\tStatus = %08X\n",Status);
}
//---
printf("Port Information:\n");
/* Status = QueryInformationPort(
Port,
1, /* info class * /
ObjectInformation,
sizeof ObjectInformation,
& ResultLength
);
if (Status == STATUS_SUCCESS)
{
DWORD * i = ObjectInformation;
int j = 0;
while (j < ResultLength / sizeof (DWORD))
{
printf("\t%08X\n",i[j]);
++j;
}
}
else
{
printf("\tStatus = %08X\n",Status);
}
*/
}
/* EOF */

View File

@@ -0,0 +1,8 @@
VOID
DumpInfo (
LPCWSTR Name,
NTSTATUS Status,
LPCWSTR Comment,
HANDLE Port
);

View File

@@ -0,0 +1,62 @@
#include <ddk/ntddk.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
HANDLE OutputHandle;
HANDLE InputHandle;
void debug_printf(char* fmt, ...)
{
va_list args;
char buffer[255];
va_start(args,fmt);
vsprintf(buffer,fmt,args);
WriteConsoleA(OutputHandle, buffer, strlen(buffer), NULL, NULL);
va_end(args);
}
void main(int argc, char* argv[])
{
UNICODE_STRING PortName;
NTSTATUS Status;
HANDLE PortHandle;
LPCMESSAGE Request;
ULONG ConnectInfoLength;
printf("(lpcclt.exe) Lpc client\n");
RtlInitUnicodeString(&PortName, L"\\TestPort");
printf("(lpcclt.exe) Connecting to port\n");
ConnectInfoLength = 0;
Status = NtConnectPort(&PortHandle,
&PortName,
NULL,
0,
0,
0,
NULL,
&ConnectInfoLength);
if (!NT_SUCCESS(Status))
{
printf("(lpcclt.exe) Failed to connect\n");
return;
}
strcpy(Request.MessageData, GetCommandLineA());
Request.ActualMessageLength = strlen(Request.MessageData);
Request.TotalMessageLength = sizeof(LPCMESSAGE);
printf("(lpcclt.exe) Sending message\n");
Status = NtRequestPort(PortHandle, &Request);
if (!NT_SUCCESS(Status))
{
printf("(lpcclt.exe) Failed to send request\n");
return;
}
printf("(lpcclt.exe) Succeeded\n");
}

View File

@@ -0,0 +1,98 @@
#include <ddk/ntddk.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
HANDLE OutputHandle;
HANDLE InputHandle;
void debug_printf(char* fmt, ...)
{
va_list args;
char buffer[255];
va_start(args,fmt);
vsprintf(buffer,fmt,args);
WriteConsoleA(OutputHandle, buffer, strlen(buffer), NULL, NULL);
va_end(args);
}
void main(int argc, char* argv[])
{
UNICODE_STRING PortName;
OBJECT_ATTRIBUTES ObjectAttributes;
NTSTATUS Status;
HANDLE NamedPortHandle;
HANDLE PortHandle;
LPCMESSAGE ConnectMsg;
printf("(lpcsrv.exe) Lpc test server\n");
RtlInitUnicodeString(&PortName, L"\\TestPort");
InitializeObjectAttributes(&ObjectAttributes,
&PortName,
0,
NULL,
NULL);
printf("(lpcsrv.exe) Creating port\n");
Status = NtCreatePort(&NamedPortHandle,
&ObjectAttributes,
0,
0,
0);
if (!NT_SUCCESS(Status))
{
printf("(lpcsrv.exe) Failed to create port\n");
return;
}
printf("(lpcsrv.exe) Listening for connections\n");
Status = NtListenPort(NamedPortHandle,
&ConnectMsg);
if (!NT_SUCCESS(Status))
{
printf("(lpcsrv.exe) Failed to listen for connections\n");
return;
}
printf("(lpcsrv.exe) Accepting connections\n");
Status = NtAcceptConnectPort(&PortHandle,
NamedPortHandle,
NULL,
1,
0,
NULL);
if (!NT_SUCCESS(Status))
{
printf("(lpcsrv.exe) Failed to accept connection\n");
return;
}
printf("(lpcsrv.exe) Completing connection\n");
Status = NtCompleteConnectPort(PortHandle);
if (!NT_SUCCESS(Status))
{
printf("(lpcsrv.exe) Failed to complete connection\n");
return;
}
for(;;)
{
LPCMESSAGE Request;
Status = NtReplyWaitReceivePort(PortHandle,
0,
NULL,
&Request);
if (!NT_SUCCESS(Status))
{
printf("(lpcsrv.exe) Failed to receive request\n");
return;
}
printf("(lpcsrv.exe) Message contents are <%s>\n", Request.MessageData);
}
}

View File

@@ -0,0 +1,51 @@
#
#
#
SRV_OBJECTS= ../common/crt0.o lpcsrv.o
CLT_OBJECTS= ../common/crt0.o lpcclt.o
PROGS= lpcsrv.exe lpcclt.exe
BASE_CFLAGS = -I../../include
LIBS = ../../lib/crtdll/crtdll.a ../../lib/kernel32/kernel32.a \
../../lib/ntdll/ntdll.a
all: $(PROGS)
.phony: all
clean:
- $(RM) lpcsrv.o
- $(RM) lpcsrv.exe
- $(RM) lpcsrv.sym
.phony: clean
floppy: $(PROGS:%=$(FLOPPY_DIR)/apps/%)
$(PROGS:%=$(FLOPPY_DIR)/apps/%): $(FLOPPY_DIR)/apps/%: %
ifeq ($(DOSCLI),yes)
$(CP) $* $(FLOPPY_DIR)\apps\$*
else
$(CP) $* $(FLOPPY_DIR)/apps/$*
endif
dist: $(PROGS:%=../../$(DIST_DIR)/apps/%)
$(PROGS:%=../../$(DIST_DIR)/apps/%): ../../$(DIST_DIR)/apps/%: %
ifeq ($(DOSCLI),yes)
$(CP) $* ..\..\$(DIST_DIR)\apps\$*
else
$(CP) $* ../../$(DIST_DIR)/apps/$*
endif
lpcsrv.exe: $(SRV_OBJECTS) $(LIBS)
$(LD) $(SRV_OBJECTS) $(LIBS) -o lpcsrv.exe
$(NM) --numeric-sort lpcsrv.exe > lpcsrv.sym
lpcclt.exe: $(CLT_OBJECTS) $(LIBS)
$(LD) $(CLT_OBJECTS) $(LIBS) -o lpcclt.exe
$(NM) --numeric-sort lpcclt.exe > lpcclt.sym
include ../../rules.mak

View File

@@ -0,0 +1,51 @@
#
#
#
SRV_OBJECTS= ../common/crt0.o shmsrv.o
CLT_OBJECTS= ../common/crt0.o shmclt.o
PROGS= shmsrv.exe shmclt.exe
BASE_CFLAGS = -I../../include
LIBS = ../../lib/crtdll/crtdll.a ../../lib/kernel32/kernel32.a \
../../lib/ntdll/ntdll.a
all: $(PROGS)
.phony: all
clean:
- $(RM) *.o
- $(RM) *.exe
- $(RM) *.sym
.phony: clean
floppy: $(PROGS:%=$(FLOPPY_DIR)/apps/%)
$(PROGS:%=$(FLOPPY_DIR)/apps/%): $(FLOPPY_DIR)/apps/%: %
ifeq ($(DOSCLI),yes)
$(CP) $* $(FLOPPY_DIR)\apps\$*
else
$(CP) $* $(FLOPPY_DIR)/apps/$*
endif
dist: $(PROGS:%=../../$(DIST_DIR)/apps/%)
$(PROGS:%=../../$(DIST_DIR)/apps/%): ../../$(DIST_DIR)/apps/%: %
ifeq ($(DOSCLI),yes)
$(CP) $* ..\..\$(DIST_DIR)\apps\$*
else
$(CP) $* ../../$(DIST_DIR)/apps/$*
endif
shmsrv.exe: $(SRV_OBJECTS) $(LIBS)
$(LD) $(SRV_OBJECTS) $(LIBS) -o shmsrv.exe
$(NM) --numeric-sort shmsrv.exe > shmsrv.sym
shmclt.exe: $(CLT_OBJECTS) $(LIBS)
$(LD) $(CLT_OBJECTS) $(LIBS) -o shmclt.exe
$(NM) --numeric-sort shmsrv.exe > shmclt.sym
include ../../rules.mak

View File

@@ -0,0 +1,60 @@
#include <ddk/ntddk.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
HANDLE OutputHandle;
HANDLE InputHandle;
void debug_printf(char* fmt, ...)
{
va_list args;
char buffer[255];
va_start(args,fmt);
vsprintf(buffer,fmt,args);
WriteConsoleA(OutputHandle, buffer, strlen(buffer), NULL, NULL);
va_end(args);
}
int
main(int argc, char* argv[])
{
HANDLE Section;
PVOID BaseAddress;
char buffer[256];
printf("Shm test server\n");
Section = OpenFileMappingW (
// PAGE_EXECUTE_READWRITE, invalid parameter
FILE_MAP_WRITE,
FALSE,
L"TestSection"
);
if (Section == NULL)
{
printf("Failed to open section (err=%d)", GetLastError());
return 1;
}
BaseAddress = MapViewOfFile(Section,
FILE_MAP_ALL_ACCESS,
0,
0,
8192);
if (BaseAddress == NULL)
{
printf("Failed to map section (err=%d)\n", GetLastError());
return 1;
}
printf("BaseAddress %x\n", (UINT) BaseAddress);
printf("Copying from section\n");
strcpy(buffer, BaseAddress);
printf("Copyed <%s>\n", buffer);
// for(;;);
return 0;
}

View File

@@ -0,0 +1,52 @@
/* $Id: shmsrv.c,v 1.3 1999/12/30 01:51:36 dwelch Exp $
*
* FILE : reactos/apps/shm/shmsrv.c
* AUTHOR: David Welch
*/
#include <ddk/ntddk.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
int main(int argc, char* argv[])
{
HANDLE Section;
PVOID BaseAddress;
printf("Shm test server\n");
Section = CreateFileMappingW (
(HANDLE) 0xFFFFFFFF,
NULL,
PAGE_READWRITE,
0,
8192,
L"TestSection"
);
if (Section == NULL)
{
printf("Failed to create section (err=%d)", GetLastError());
return 1;
}
printf("Mapping view of section\n");
BaseAddress = MapViewOfFile(Section,
FILE_MAP_ALL_ACCESS,
0,
0,
8192);
printf("BaseAddress %x\n", (UINT) BaseAddress);
if (BaseAddress == NULL)
{
printf("Failed to map section\n");
}
printf("Copying to section\n");
printf("Copying %s\n", GetCommandLineA());
strcpy(BaseAddress, GetCommandLineA());
for(;;);
return 0;
}

View File

@@ -0,0 +1,11 @@
#include <stdio.h>
int
main (void)
{
int i;
puts ("This should print \"wow = I\" for I from 0 to 39 inclusive.");
for (i = 0; i < 40; i++)
printf ("%s = %d\n", "wow", i);
return 0;
}

View File

@@ -0,0 +1,53 @@
#include <stdio.h>
#include <string.h>
int
main (void)
{
FILE *f;
int i;
const char filename[] = "/tmp/bug3.test";
f = fopen(filename, "w+");
for (i=0; i<9000; i++)
putc ('x', f);
fseek (f, 8180L, 0);
fwrite ("Where does this text go?", 1, 24, f);
fflush (f);
rewind (f);
for (i=0; i<9000; i++)
{
int j;
if ((j = getc(f)) != 'x')
{
if (i != 8180)
{
printf ("Test FAILED!");
return 1;
}
else
{
char buf[25];
buf[0] = j;
fread (buf + 1, 1, 23, f);
buf[24] = '\0';
if (strcmp (buf, "Where does this text go?") != 0)
{
printf ("%s\nTest FAILED!\n", buf);
return 1;
}
i += 23;
}
}
}
fclose(f);
remove(filename);
puts ("Test succeeded.");
return 0;
}

View File

@@ -0,0 +1,74 @@
#
#
#
PROGS= test-stdio tst-printf tstdiomisc bug2 bug3 \
temptest test-fseek test_rdwr
all: $(PROGS:%=%.exe)
.phony: all
$(PROGS:%=%_clean): %_clean:
- $(RM) $*.o
- $(RM) $*.exe
- $(RM) $*.sym
clean: $(PROGS:%=%_clean)
.phony: clean
floppy: # $(PROGS:%=$(FLOPPY_DIR)/apps/%.exe)
$(PROGS:%=$(FLOPPY_DIR)/apps/%.exe): $(FLOPPY_DIR)/apps/%.exe: %.exe
ifeq ($(DOSCLI),yes)
$(CP) $*.exe $(FLOPPY_DIR)\apps\$*.exe
else
$(CP) $*.exe $(FLOPPY_DIR)/apps/$*.exe
endif
dist: $(PROGS:%=../../$(DIST_DIR)/apps/%.exe)
$(PROGS:%=../../$(DIST_DIR)/apps/%.exe): ../../$(DIST_DIR)/apps/%.exe: %.exe
ifeq ($(DOSCLI),yes)
$(CP) $*.exe ..\..\$(DIST_DIR)\apps\$*.exe
else
$(CP) $*.exe ../../$(DIST_DIR)/apps/$*.exe
endif
bug2.exe: bug2.c
$(CC) bug2.c -lkernel32 -o bug2.exe
$(NM) --numeric-sort bug2.exe > bug2.sym
bug3.exe: bug3.c
$(CC) bug3.c -lkernel32 -o bug3.exe
$(NM) --numeric-sort bug3.exe > bug3.sym
temptest.exe: temptest.c
$(CC) temptest.c -lkernel32 -o temptest.exe
$(NM) --numeric-sort temptest.exe > temptest.sym
test-fseek.exe: test-fseek.c
$(CC) test-fseek.c -lkernel32 -o test-fseek.exe
$(NM) --numeric-sort test-fseek.exe > test-fseek.sym
test-fwrite.exe: test-fwrite.c
$(CC) test-fwrite.c -lkernel32 -o test-fwrite.exe
$(NM) --numeric-sort test-fwrite.exe > test-fwrite.sym
test_rdwr.exe: test_rdwr.c
$(CC) test_rdwr.c -lkernel32 -o test_rdwr.exe
$(NM) --numeric-sort test_rdwr.exe > test_rdwr.sym
test-stdio.exe: test-stdio.c
$(CC) test-stdio.c -lkernel32 -o test-stdio.exe
$(NM) --numeric-sort test-stdio.exe > test-stdio.sym
tst-printf.exe: tst-printf.c
$(CC) tst-printf.c -lkernel32 -o tst-printf.exe
$(NM) --numeric-sort tst-printf.exe > tst-printf.sym
tstdiomisc.exe: tstdiomisc.c
$(CC) tstdiomisc.c -lkernel32 -o tstdiomisc.exe
$(NM) --numeric-sort tstdiomisc.exe > tstdiomisc.sym
include ../../rules.mak

View File

@@ -0,0 +1,27 @@
#include <stdio.h>
#include <string.h>
char *files[500];
int
main (int argc, char *argv[])
{
FILE *fp;
int i;
for (i = 0; i < 500; i++) {
files[i] = tempnam (NULL, "file");
if (files[i] == NULL) {
printf ("tempnam failed\n");
exit (1);
}
printf ("file: %s\n", files[i]);
fp = fopen (files[i], "w");
fclose (fp);
}
for (i = 0; i < 500; i++)
remove (files[i]);
exit (0);
}

View File

@@ -0,0 +1,85 @@
/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <stdio.h>
#define TESTFILE "/tmp/test.dat"
int
main (void)
{
FILE *fp;
int i, j;
puts ("\nFile seek test");
fp = fopen (TESTFILE, "w");
if (fp == NULL)
{
perror (TESTFILE);
return 1;
}
for (i = 0; i < 256; i++)
putc (i, fp);
if (freopen (TESTFILE, "r", fp) != fp)
{
perror ("Cannot open file for reading");
return 1;
}
for (i = 1; i <= 255; i++)
{
printf ("%3d\n", i);
fseek (fp, (long) -i, SEEK_END);
if ((j = getc (fp)) != 256 - i)
{
printf ("SEEK_END failed %d\n", j);
break;
}
if (fseek (fp, (long) i, SEEK_SET))
{
puts ("Cannot SEEK_SET");
break;
}
if ((j = getc (fp)) != i)
{
printf ("SEEK_SET failed %d\n", j);
break;
}
if (fseek (fp, (long) i, SEEK_SET))
{
puts ("Cannot SEEK_SET");
break;
}
if (fseek (fp, (long) (i >= 128 ? -128 : 128), SEEK_CUR))
{
puts ("Cannot SEEK_CUR");
break;
}
if ((j = getc (fp)) != (i >= 128 ? i - 128 : i + 128))
{
printf ("SEEK_CUR failed %d\n", j);
break;
}
}
fclose (fp);
remove (TESTFILE);
puts ((i > 255) ? "Test succeeded." : "Test FAILED!");
return (i > 255) ? 0 : 1;
}

View File

@@ -0,0 +1,68 @@
#include <stdio.h>
#include <string.h>
int
main (int argc, char *argv[])
{
FILE *f = tmpfile ();
char obuf[99999], ibuf[sizeof obuf];
char *line;
size_t linesz;
if (! f)
{
perror ("tmpfile");
return 1;
}
if (fputs ("line\n", f) == EOF)
{
perror ("fputs");
return 1;
}
memset (obuf, 'z', sizeof obuf);
memset (ibuf, 'y', sizeof ibuf);
if (fwrite (obuf, sizeof obuf, 1, f) != 1)
{
perror ("fwrite");
return 1;
}
rewind (f);
line = NULL;
linesz = 0;
if (getline (&line, &linesz, f) != 5)
{
perror ("getline");
return 1;
}
if (strcmp (line, "line\n"))
{
puts ("Lines differ. Test FAILED!");
return 1;
}
if (fread (ibuf, sizeof ibuf, 1, f) != 1)
{
perror ("fread");
return 1;
}
if (memcmp (ibuf, obuf, sizeof ibuf))
{
puts ("Buffers differ. Test FAILED!");
return 1;
}
asprintf (&line, "\
GDB is free software and you are welcome to distribute copies of it\n\
under certain conditions; type \"show copying\" to see the conditions.\n\
There is absolutely no warranty for GDB; type \"show warranty\" for details.\n\
");
puts ("Test succeeded.");
return 0;
}

View File

@@ -0,0 +1,55 @@
#include <stdio.h>
#include <string.h>
int main()
{
char msg1[] = "testing _write\n";
char msg2[] = "testing putchar.";
char msg3[] = "testing printf.";
char tmpbuf[255];
FILE* f1;
write(1, msg1, strlen(msg1));
write(1, msg2, strlen(msg2));
putchar('o'); putchar('k'); putchar('\n');
write(1, msg3, strlen(msg3));
printf("ok\n");
printf("Testing fopen\n");
f1 = fopen("tmp.txt","w+b");
if (f1 == NULL)
{
printf("fopen failed\n");
return(1);
}
printf("Testing fwrite\n");
if (fwrite(msg1, 1, strlen(msg1)+1, f1) != (strlen(msg1)+1))
{
printf("fwrite failed\n");
return(1);
}
printf("Testing fread\n");
fseek(f1, 0, SEEK_SET);
if (fread(tmpbuf, 1, strlen(msg1)+1, f1) != (strlen(msg1)+1))
{
printf("fread failed\n");
return(1);
}
if (strcmp(tmpbuf,msg1) != 0)
{
printf("fread failed, data corrupt\n");
return(1);
}
printf("Testing fclose\n");
if (fclose(f1) != 0)
{
printf("fclose failed\n");
return(1);
}
return(0);
}

View File

@@ -0,0 +1,129 @@
/* Copyright (C) 1991, 1992, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int
main (int argc, char **argv)
{
static const char hello[] = "Hello, world.\n";
static const char replace[] = "Hewwo, world.\n";
static const size_t replace_from = 2, replace_to = 4;
char filename[FILENAME_MAX];
char *name = strrchr (*argv, '/');
char buf[BUFSIZ];
FILE *f;
int lose = 0;
if (name != NULL)
++name;
else
name = *argv;
(void) sprintf (filename, "/tmp/%s.test", name);
f = fopen (filename, "w+");
if (f == NULL)
{
perror (filename);
exit (1);
}
(void) fputs (hello, f);
rewind (f);
(void) fgets (buf, sizeof (buf), f);
rewind (f);
(void) fputs (buf, f);
rewind (f);
{
size_t i;
for (i = 0; i < replace_from; ++i)
{
int c = getc (f);
if (c == EOF)
{
printf ("EOF at %Zu.\n", i);
lose = 1;
break;
}
else if (c != hello[i])
{
printf ("Got '%c' instead of '%c' at %Zu.\n",
(unsigned char) c, hello[i], i);
lose = 1;
break;
}
}
}
{
long int where = ftell (f);
if (where == (long int) replace_from)
{
register size_t i;
for (i = replace_from; i < replace_to; ++i)
if (putc(replace[i], f) == EOF)
{
printf ("putc('%c') got %s at %Zu.\n",
replace[i], strerror (errno), i);
lose = 1;
break;
}
}
else if (where == -1L)
{
printf ("ftell got %s (should be at %Zu).\n",
strerror (errno), replace_from);
lose = 1;
}
else
{
printf ("ftell returns %lu; should be %Zu.\n", where, replace_from);
lose = 1;
}
}
if (!lose)
{
rewind (f);
if (fgets (buf, sizeof (buf), f) == NULL)
{
printf ("fgets got %s.\n", strerror(errno));
lose = 1;
}
else if (strcmp (buf, replace))
{
printf ("Read \"%s\" instead of \"%s\".\n", buf, replace);
lose = 1;
}
}
if (lose)
printf ("Test FAILED! Losing file is \"%s\".\n", filename);
else
{
(void) remove (filename);
puts ("Test succeeded.");
}
exit (lose ? EXIT_FAILURE : EXIT_SUCCESS);
}

View File

@@ -0,0 +1,311 @@
/* Copyright (C) 1991, 92, 93, 95, 96, 97, 98 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifdef BSD
#include </usr/include/stdio.h>
#define EXIT_SUCCESS 0
#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#endif
#include <float.h>
void rfg1 (void);
void rfg2 (void);
void
fmtchk (const char *fmt)
{
(void) fputs(fmt, stdout);
(void) printf(":\t`");
(void) printf(fmt, 0x12);
(void) printf("'\n");
}
void
fmtst1chk (const char *fmt)
{
(void) fputs(fmt, stdout);
(void) printf(":\t`");
(void) printf(fmt, 4, 0x12);
(void) printf("'\n");
}
void
fmtst2chk (const char *fmt)
{
(void) fputs(fmt, stdout);
(void) printf(":\t`");
(void) printf(fmt, 4, 4, 0x12);
(void) printf("'\n");
}
/* This page is covered by the following copyright: */
/* (C) Copyright C E Chew
*
* Feel free to copy, use and distribute this software provided:
*
* 1. you do not pretend that you wrote it
* 2. you leave this copyright notice intact.
*/
/*
* Extracted from exercise.c for glibc-1.05 bug report by Bruce Evans.
*/
#define DEC -123
#define INT 255
#define UNS (~0)
/* Formatted Output Test
*
* This exercises the output formatting code.
*/
void
fp_test (void)
{
int i, j, k, l;
char buf[7];
char *prefix = buf;
char tp[20];
puts("\nFormatted output test");
printf("prefix 6d 6o 6x 6X 6u\n");
strcpy(prefix, "%");
for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
for (k = 0; k < 2; k++) {
for (l = 0; l < 2; l++) {
strcpy(prefix, "%");
if (i == 0) strcat(prefix, "-");
if (j == 0) strcat(prefix, "+");
if (k == 0) strcat(prefix, "#");
if (l == 0) strcat(prefix, "0");
printf("%5s |", prefix);
strcpy(tp, prefix);
strcat(tp, "6d |");
printf(tp, DEC);
strcpy(tp, prefix);
strcat(tp, "6o |");
printf(tp, INT);
strcpy(tp, prefix);
strcat(tp, "6x |");
printf(tp, INT);
strcpy(tp, prefix);
strcat(tp, "6X |");
printf(tp, INT);
strcpy(tp, prefix);
strcat(tp, "6u |");
printf(tp, UNS);
printf("\n");
}
}
}
}
printf("%10s\n", (char *) NULL);
printf("%-10s\n", (char *) NULL);
}
int
main (int argc, char *argv[])
{
static char shortstr[] = "Hi, Z.";
static char longstr[] = "Good morning, Doctor Chandra. This is Hal. \
I am ready for my first lesson today.";
fmtchk("%.4x");
fmtchk("%04x");
fmtchk("%4.4x");
fmtchk("%04.4x");
fmtchk("%4.3x");
fmtchk("%04.3x");
fmtst1chk("%.*x");
fmtst1chk("%0*x");
fmtst2chk("%*.*x");
fmtst2chk("%0*.*x");
#ifndef BSD
printf("bad format:\t\"%b\"\n");
printf("nil pointer (padded):\t\"%10p\"\n", (void *) NULL);
#endif
printf("decimal negative:\t\"%d\"\n", -2345);
printf("octal negative:\t\"%o\"\n", -2345);
printf("hex negative:\t\"%x\"\n", -2345);
printf("long decimal number:\t\"%ld\"\n", -123456L);
printf("long octal negative:\t\"%lo\"\n", -2345L);
printf("long unsigned decimal number:\t\"%lu\"\n", -123456L);
printf("zero-padded LDN:\t\"%010ld\"\n", -123456L);
printf("left-adjusted ZLDN:\t\"%-010ld\"\n", -123456);
printf("space-padded LDN:\t\"%10ld\"\n", -123456L);
printf("left-adjusted SLDN:\t\"%-10ld\"\n", -123456L);
printf("zero-padded string:\t\"%010s\"\n", shortstr);
printf("left-adjusted Z string:\t\"%-010s\"\n", shortstr);
printf("space-padded string:\t\"%10s\"\n", shortstr);
printf("left-adjusted S string:\t\"%-10s\"\n", shortstr);
printf("null string:\t\"%s\"\n", (char *)NULL);
printf("limited string:\t\"%.22s\"\n", longstr);
printf("e-style >= 1:\t\"%e\"\n", 12.34);
printf("e-style >= .1:\t\"%e\"\n", 0.1234);
printf("e-style < .1:\t\"%e\"\n", 0.001234);
printf("e-style big:\t\"%.60e\"\n", 1e20);
printf ("e-style == .1:\t\"%e\"\n", 0.1);
printf("f-style >= 1:\t\"%f\"\n", 12.34);
printf("f-style >= .1:\t\"%f\"\n", 0.1234);
printf("f-style < .1:\t\"%f\"\n", 0.001234);
printf("g-style >= 1:\t\"%g\"\n", 12.34);
printf("g-style >= .1:\t\"%g\"\n", 0.1234);
printf("g-style < .1:\t\"%g\"\n", 0.001234);
printf("g-style big:\t\"%.60g\"\n", 1e20);
printf (" %6.5f\n", .099999999860301614);
printf (" %6.5f\n", .1);
printf ("x%5.4fx\n", .5);
printf ("%#03x\n", 1);
{
double d = FLT_MIN;
int niter = 17;
while (niter-- != 0)
printf ("%.17e\n", d / 2);
fflush (stdout);
}
printf ("%15.5e\n", 4.9406564584124654e-324);
#define FORMAT "|%12.4f|%12.4e|%12.4g|\n"
printf (FORMAT, 0.0, 0.0, 0.0);
printf (FORMAT, 1.0, 1.0, 1.0);
printf (FORMAT, -1.0, -1.0, -1.0);
printf (FORMAT, 100.0, 100.0, 100.0);
printf (FORMAT, 1000.0, 1000.0, 1000.0);
printf (FORMAT, 10000.0, 10000.0, 10000.0);
printf (FORMAT, 12345.0, 12345.0, 12345.0);
printf (FORMAT, 100000.0, 100000.0, 100000.0);
printf (FORMAT, 123456.0, 123456.0, 123456.0);
#undef FORMAT
{
char buf[20];
printf ("sprintf (\"%%30s\", \"foo\") == %d, \"%.*s\"\n",
sprintf (buf, "%30s", "foo"), sizeof (buf), buf);
}
fp_test ();
printf ("%e should be 1.234568e+06\n", 1234567.8);
printf ("%f should be 1234567.800000\n", 1234567.8);
printf ("%g should be 1.23457e+06\n", 1234567.8);
printf ("%g should be 123.456\n", 123.456);
printf ("%g should be 1e+06\n", 1000000.0);
printf ("%g should be 10\n", 10.0);
printf ("%g should be 0.02\n", 0.02);
{
double x=1.0;
printf("%.17f\n",(1.0/x/10.0+1.0)*x-x);
}
puts ("--- Should be no further output. ---");
rfg1 ();
rfg2 ();
{
char buf[200];
int result;
sprintf(buf,"%*s%*s%*s",-1,"one",-20,"two",-30,"three");
result = strcmp (buf,
"onetwo three ");
puts (result != 0 ? "Test failed!" : "Test ok.");
return result != 0;
}
}
void
rfg1 (void)
{
char buf[100];
sprintf (buf, "%5.s", "xyz");
if (strcmp (buf, " ") != 0)
printf ("got: '%s', expected: '%s'\n", buf, " ");
sprintf (buf, "%5.f", 33.3);
if (strcmp (buf, " 33") != 0)
printf ("got: '%s', expected: '%s'\n", buf, " 33");
sprintf (buf, "%8.e", 33.3e7);
if (strcmp (buf, " 3e+08") != 0)
printf ("got: '%s', expected: '%s'\n", buf, " 3e+08");
sprintf (buf, "%8.E", 33.3e7);
if (strcmp (buf, " 3E+08") != 0)
printf ("got: '%s', expected: '%s'\n", buf, " 3E+08");
sprintf (buf, "%.g", 33.3);
if (strcmp (buf, "3e+01") != 0)
printf ("got: '%s', expected: '%s'\n", buf, "3e+01");
sprintf (buf, "%.G", 33.3);
if (strcmp (buf, "3E+01") != 0)
printf ("got: '%s', expected: '%s'\n", buf, "3E+01");
}
void
rfg2 (void)
{
int prec;
char buf[100];
prec = 0;
sprintf (buf, "%.*g", prec, 3.3);
if (strcmp (buf, "3") != 0)
printf ("got: '%s', expected: '%s'\n", buf, "3");
prec = 0;
sprintf (buf, "%.*G", prec, 3.3);
if (strcmp (buf, "3") != 0)
printf ("got: '%s', expected: '%s'\n", buf, "3");
prec = 0;
sprintf (buf, "%7.*G", prec, 3.33);
if (strcmp (buf, " 3") != 0)
printf ("got: '%s', expected: '%s'\n", buf, " 3");
prec = 3;
sprintf (buf, "%04.*o", prec, 33);
if (strcmp (buf, " 041") != 0)
printf ("got: '%s', expected: '%s'\n", buf, " 041");
prec = 7;
sprintf (buf, "%09.*u", prec, 33);
if (strcmp (buf, " 0000033") != 0)
printf ("got: '%s', expected: '%s'\n", buf, " 0000033");
prec = 3;
sprintf (buf, "%04.*x", prec, 33);
if (strcmp (buf, " 021") != 0)
printf ("got: '%s', expected: '%s'\n", buf, " 021");
prec = 3;
sprintf (buf, "%04.*X", prec, 33);
if (strcmp (buf, " 021") != 0)
printf ("got: '%s', expected: '%s'\n", buf, " 021");
}

View File

@@ -0,0 +1,56 @@
#include <stdio.h>
int
t1 (void)
{
int n = -1;
sscanf ("abc ", "abc %n", &n);
printf ("t1: count=%d\n", n);
return n != 5;
}
int
t2 (void)
{
int result = 0;
int n;
long N;
int retval;
#define SCAN(INPUT, FORMAT, VAR, EXP_RES, EXP_VAL) \
VAR = -1; \
retval = sscanf (INPUT, FORMAT, &VAR); \
printf ("sscanf (\"%s\", \"%s\", &x) => %d, x = %ld\n", \
INPUT, FORMAT, retval, (long int) VAR); \
result |= retval != EXP_RES || VAR != EXP_VAL
SCAN ("12345", "%ld", N, 1, 12345);
SCAN ("12345", "%llllld", N, 0, -1);
SCAN ("12345", "%LLLLLd", N, 0, -1);
SCAN ("test ", "%*s%n", n, 0, 4);
SCAN ("test ", "%2*s%n", n, 0, -1);
SCAN ("12 ", "%l2d", n, 0, -1);
SCAN ("12 ", "%2ld", N, 1, 12);
n = -1;
N = -1;
retval = sscanf ("1 1", "%d %Z", &n, &N);
printf ("sscanf (\"1 1\", \"%%d %%Z\", &n, &N) => %d, n = %d, N = %ld\n", \
retval, n, N); \
result |= retval != 1 || n != 1 || N != -1;
return result;
}
int
main (int argc, char *argv[])
{
int result = 0;
result |= t1 ();
result |= t2 ();
result |= fflush (stdout) == EOF;
return result;
}

View File

@@ -0,0 +1,41 @@
#
#
#
PROGS = thread
all: $(PROGS:%=%.exe)
.phony: all
clean: $(PROGS:%=%_clean)
$(PROGS:%=%_clean): %_clean:
- $(RM) $*.o
- $(RM) $*.exe
- $(RM) $*.sym
.phony: clean
floppy: # $(PROGS:%=$(FLOPPY_DIR)/apps/%.exe)
$(PROGS:%=$(FLOPPY_DIR)/apps/%.exe): $(FLOPPY_DIR)/apps/%.exe: %.exe
ifeq ($(DOSCLI),yes)
$(CP) $*.exe $(FLOPPY_DIR)\apps\$*.exe
else
$(CP) $*.exe $(FLOPPY_DIR)/apps/$*.exe
endif
dist: $(PROGS:%=../../$(DIST_DIR)/apps/%.exe)
$(PROGS:%=../../$(DIST_DIR)/apps/%.exe): ../../$(DIST_DIR)/apps/%.exe: %.exe
ifeq ($(DOSCLI),yes)
$(CP) $*.exe ..\..\$(DIST_DIR)\apps\$*.exe
else
$(CP) $*.exe ../../$(DIST_DIR)/apps/$*.exe
endif
thread.exe: thread.c
$(CC) $(CFLAGS) thread.c -lkernel32 -o thread.exe
$(NM) --numeric-sort thread.exe > thread.sym
include ../../rules.mak

View File

@@ -0,0 +1,46 @@
#include <stdio.h>
#include <windows.h>
#define NR_THREADS (10)
ULONG nr;
DWORD WINAPI thread_main1(LPVOID param)
{
ULONG s;
printf("Thread %d running\n", (DWORD)param);
s = nr = ((nr * 1103515245) + 12345) & 0x7fffffff;
s = s % 10;
printf("s %d\n", s);
Sleep(s);
printf("Thread %d finished\n", (DWORD)param);
return 0;
}
int main (int argc, char* argv[])
{
HANDLE hThread;
DWORD i=0;
DWORD id;
ULONG nr;
nr = atoi(argv[1]);
printf("Seed %d\n", nr);
printf("Creating %d threads...\n",NR_THREADS*2);
for (i=0;i<NR_THREADS;i++)
{
CreateThread(NULL,
0,
thread_main1,
(LPVOID)i,
0,
&id);
}
printf("All threads created...\n");
for(;;);
return 0;
}

View File

@@ -0,0 +1,2 @@
buildno
buildno.exe

View File

@@ -0,0 +1,26 @@
# $Id: Makefile,v 1.3 1999/11/12 12:01:09 dwelch Exp $
#
BASE_CFLAGS = -I../../include
TARGETNAME=buildno
CLEAN_FILES= $(TARGETNAME).o $(TARGETNAME)$(EXE_POSTFIX) $(TARGETNAME).sym
all: $(TARGETNAME)$(EXE_POSTFIX)
$(EXE_PREFIX)$(TARGETNAME)$(EXE_POSTFIX) -q
$(TARGETNAME)$(EXE_POSTFIX): $(TARGETNAME).c ../../include/reactos/version.h
$(NATIVE_CC) -I../../include -o $(TARGETNAME)$(EXE_POSTFIX) $(TARGETNAME).c
clean:
$(RM) $(TARGETNAME).o
$(RM) $(TARGETNAME).sym
$(RM) $(TARGETNAME)$(EXE_POSTFIX)
.phony: clean
include ../../rules.mak
# EOF

View File

@@ -0,0 +1,262 @@
/* $Id: buildno.c,v 1.2 1999/12/26 20:21:02 ea Exp $
*
* buildno - Generate the build number for ReactOS
*
* Copyright (c) 1999 Emanuele Aliberti
*
*
* It assumes the last release date is defined in
* <reactos/version.h> as a macro named
*
* KERNEL_RELEASE_DATE
*
* as a 32-bit unsigned long YYYYMMDD (UTC).
*
* The build number is the number of full days
* elapsed since the last release date (UTC).
*
* The build number is stored in the file
* <reactos/buildno.h> as a set of macros:
*
* KERNEL_VERSION_BUILD
* KERNEL_VERSION_BUILD_STR
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <reactos/version.h>
#define FALSE 0
#define TRUE 1
/* File to (over)write */
#define BUILDNO_INCLUDE_FILE "../../include/reactos/buildno.h"
static char * argv0 = "";
int
elapsed_days (
time_t t_today,
time_t t_release_day
)
{
double seconds = difftime (t_today, t_release_day);
double days = seconds / (double) 86400.0;
char buf [32];
char * dot = buf;
sprintf (buf, "%f", days );
while ( *dot && *dot != '.') ++dot;
*dot = '\0';
return atol (buf);
}
void
write_h (int build)
{
FILE *h = NULL;
h = fopen ( BUILDNO_INCLUDE_FILE, "w");
if (!h)
{
fprintf (
stderr,
"%s: can not create file \"%s\"!\n",
argv0,
BUILDNO_INCLUDE_FILE
);
return;
}
fprintf (
h,
"/* Do not edit - Machine generated */\n"
);
fprintf (h, "#ifndef _INC_REACTOS_BUILDNO\n" );
fprintf (h, "#define _INC_REACTOS_BUILDNO\n" );
fprintf (
h,
"#define KERNEL_VERSION_BUILD\t%d\n",
build
);
fprintf (
h,
"#define KERNEL_VERSION_BUILD_STR\t\"%d\"\n",
build
);
fprintf (
h,
"#define KERNEL_RELEASE_RC\t\"%d.%d.%d.%d\\0\"\n",
KERNEL_VERSION_MAJOR,
KERNEL_VERSION_MINOR,
KERNEL_VERSION_PATCH_LEVEL,
build
);
fprintf (
h,
"#define KERNEL_RELEASE_STR\t\"%d.%d.%d.%d\"\n",
KERNEL_VERSION_MAJOR,
KERNEL_VERSION_MINOR,
KERNEL_VERSION_PATCH_LEVEL,
build
);
fprintf (
h,
"#define KERNEL_VERSION_RC\t\"%d.%d.%d\\0\"\n",
KERNEL_VERSION_MAJOR,
KERNEL_VERSION_MINOR,
KERNEL_VERSION_PATCH_LEVEL
);
fprintf (
h,
"#define KERNEL_VERSION_STR\t\"%d.%d.%d\"\n",
KERNEL_VERSION_MAJOR,
KERNEL_VERSION_MINOR,
KERNEL_VERSION_PATCH_LEVEL
);
fprintf (
h,
"#endif\n/* EOF */\n"
);
fclose (h);
}
void
usage (void)
{
fprintf (
stderr,
"Usage: %s [-q]\n",
argv0
);
exit (EXIT_SUCCESS);
}
int
main (int argc, char * argv [])
{
int quiet = FALSE;
int year = 0;
int month = 0;
int day = 0;
int build = 0;
time_t t0 = 0;
struct tm t0_tm = {0};
time_t t1 = 0;
struct tm * t1_tm = NULL;
argv0 = argv[0];
switch (argc)
{
case 1:
break;
case 2:
if (argv[1][0] == '-')
{
if (argv[1][1] == 'q')
{
quiet = TRUE;
}
else
{
usage ();
}
}
else
{
usage ();
}
break;
default:
usage ();
}
/*
* We are building TODAY!
*/
time (& t0);
/*
* "Parse" the release date.
*/
day = KERNEL_RELEASE_DATE % 100;
month = ( ( KERNEL_RELEASE_DATE
% 10000
)
- day
)
/ 100;
year =
( KERNEL_RELEASE_DATE
- (month * 100)
- day
)
/ 10000;
if (FALSE == quiet)
{
printf ( "\n\
ReactOS Build Number Generator\n\n\
Last release: %4d-%02d-%02d\n",
year,
month,
day
);
}
t0_tm.tm_year = year - ((year > 1999) ? 2000 : 1900);
t0_tm.tm_mon = month;
t0_tm.tm_mday = day;
t0 = mktime (& t0_tm);
time (& t1); /* current build time */
t1_tm = gmtime (& t1);
t1_tm->tm_year +=
(t1_tm->tm_year < 70)
? 2000
: 1900;
if (FALSE == quiet)
{
printf (
"Current date: %4d-%02d-%02d\n\n",
t1_tm->tm_year,
t1_tm->tm_mon,
t1_tm->tm_mday
);
}
/*
* Compute delta days.
*/
build = elapsed_days (t1, t0);
if (FALSE == quiet)
{
printf (
"Build number: %d (elapsed days since last release)\n",
build
);
printf (
"ROS Version : %d.%d.%d.%d\n",
KERNEL_VERSION_MAJOR,
KERNEL_VERSION_MINOR,
KERNEL_VERSION_PATCH_LEVEL,
build
);
}
/*
* (Over)write the include file.
*/
write_h (build);
return EXIT_SUCCESS;
}
/* EOF */

View File

@@ -0,0 +1,26 @@
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char* argv[])
{
int i;
FILE* in;
char ch;
for (i=1; i<argc; i++)
{
in = fopen(argv[i],"r");
if (in == NULL)
{
printf("Failed to open file %s\n", argv[i]);
return(0);
}
while ((ch = fgetc(in)) != EOF)
{
putchar(ch);
}
fclose(in);
}
return 0;
}

View File

@@ -0,0 +1,42 @@
#
#
#
OBJECTS= cat.o
PROGS= cat.exe
all: cat.exe
.phony: all
clean:
- $(RM) cat.o
- $(RM) cat.exe
- $(RM) cat.sym
.phony: clean
floppy: $(PROGS:%=$(FLOPPY_DIR)/apps/%)
$(PROGS:%=$(FLOPPY_DIR)/apps/%): $(FLOPPY_DIR)/apps/%: %
ifeq ($(DOSCLI),yes)
$(CP) $* $(FLOPPY_DIR)\apps\$*
else
$(CP) $* $(FLOPPY_DIR)/apps/$*
endif
dist: $(PROGS:%=../../$(DIST_DIR)/apps/%)
$(PROGS:%=../../$(DIST_DIR)/apps/%): ../../$(DIST_DIR)/apps/%: %
ifeq ($(DOSCLI),yes)
$(CP) $* ..\..\$(DIST_DIR)\apps\$*
else
$(CP) $* ../../$(DIST_DIR)/apps/$*
endif
.PHONY: floppy dist
cat.exe: $(OBJECTS) $(LIBS)
$(CC) $(OBJECTS) -o cat.exe
$(NM) --numeric-sort cat.exe > cat.sym
include ../../rules.mak

View File

@@ -0,0 +1,42 @@
#
#
#
OBJECTS= ../common/crt0.o shell.o
PROGS= shell.exe
LIBS= ../../lib/kernel32/kernel32.a ../../lib/ntdll/ntdll.a
CLEAN_FILES= shell.o shell.exe shell.sym
BASE_CFLAGS = -I../../include
all: shell.exe
clean: $(CLEAN_FILES:%=%_clean)
$(CLEAN_FILES:%=%_clean): %_clean:
- $(RM) $*
.phony: clean $(CLEAN_FILES:%=%_clean)
floppy: $(PROGS:%=$(FLOPPY_DIR)/apps/%)
$(PROGS:%=$(FLOPPY_DIR)/apps/%): $(FLOPPY_DIR)/apps/%: %
ifeq ($(DOSCLI),yes)
$(CP) $* $(FLOPPY_DIR)\apps\$*
else
$(CP) $* $(FLOPPY_DIR)/apps/$*
endif
dist: $(PROGS:%=../../$(DIST_DIR)/apps/%)
$(PROGS:%=../../$(DIST_DIR)/apps/%): ../../$(DIST_DIR)/apps/%: %
ifeq ($(DOSCLI),yes)
$(CP) $* ..\..\$(DIST_DIR)\apps\$*
else
$(CP) $* ../../$(DIST_DIR)/apps/$*
endif
shell.exe: $(OBJECTS) $(LIBS)
$(CC) -specs=../../specs $(OBJECTS) $(LIBS) -lgcc -o shell.exe
$(NM) --numeric-sort shell.exe > shell.sym
include ../../rules.mak

View File

@@ -0,0 +1,389 @@
#include <ddk/ntddk.h>
#include <windows.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
HANDLE InputHandle, OutputHandle;
void debug_printf(char* fmt, ...)
{
va_list args;
char buffer[255];
va_start(args,fmt);
vsprintf(buffer,fmt,args);
WriteConsoleA(OutputHandle, buffer, strlen(buffer), NULL, NULL);
va_end(args);
}
void ExecuteVer(void)
{
debug_printf(
"Reactos Simple Shell\n(compiled on %s, at %s)\n",
__DATE__,
__TIME__
);
}
void ExecuteCd(char* cmdline)
{
if (!SetCurrentDirectoryA(cmdline))
{
debug_printf("Invalid directory\n");
}
}
void ExecuteDir(char* cmdline)
{
HANDLE shandle;
WIN32_FIND_DATA FindData;
int nFile=0, nRep=0;
FILETIME fTime;
SYSTEMTIME sTime;
shandle = FindFirstFile("*",&FindData);
if (shandle==INVALID_HANDLE_VALUE)
{
debug_printf("Invalid directory\n");
return;
}
do
{
debug_printf("%-15.15s",FindData.cAlternateFileName);
if(FindData.dwFileAttributes &FILE_ATTRIBUTE_DIRECTORY)
debug_printf("<DIR> "),nRep++;
else
debug_printf(" %10d ",FindData.nFileSizeLow),nFile++;
FileTimeToLocalFileTime(&FindData.ftLastWriteTime ,&fTime);
FileTimeToSystemTime(&fTime, &sTime);
debug_printf("%02d/%02d/%04d %02d:%02d:%02d "
,sTime.wMonth,sTime.wDay,sTime.wYear
,sTime.wHour,sTime.wMinute,sTime.wSecond);
debug_printf("%s\n",FindData.cFileName);
} while(FindNextFile(shandle,&FindData));
debug_printf("\n %d files\n %d directories\n\n",nFile,nRep);
FindClose(shandle);
}
void ExecuteReboot(char* cmdline)
{
NtShutdownSystem (ShutdownReboot);
}
void ExecuteType(char* cmdline)
{
HANDLE FileHandle;
char c;
DWORD Result;
FileHandle = CreateFile(cmdline,
FILE_GENERIC_READ,
0,
NULL,
OPEN_EXISTING,
0,
NULL);
if (FileHandle == NULL)
{
debug_printf("Unknown file\n");
return;
}
while (ReadFile(FileHandle,
&c,
1,
&Result,
NULL))
{
debug_printf("%c",c);
c = 0;
}
CloseHandle(FileHandle);
}
int ExecuteProcess(char* name, char* cmdline, BOOL detached)
{
PROCESS_INFORMATION ProcessInformation;
STARTUPINFO StartupInfo;
// char arguments;
BOOL ret;
memset(&StartupInfo, 0, sizeof(StartupInfo));
StartupInfo.cb = sizeof (STARTUPINFO);
StartupInfo.lpTitle = name;
ret = CreateProcessA(name,
cmdline,
NULL,
NULL,
FALSE,
((TRUE == detached)
? DETACHED_PROCESS
: CREATE_NEW_CONSOLE
),
NULL,
NULL,
& StartupInfo,
& ProcessInformation
);
if (TRUE == detached)
{
if (ret)
{
debug_printf("%s detached:\n"
"\thProcess = %08X\n"
"\thThread = %08X\n"
"\tPID = %d\n"
"\tTID = %d\n\n",
name,
ProcessInformation.hProcess,
ProcessInformation.hThread,
ProcessInformation.dwProcessId,
ProcessInformation.dwThreadId);
CloseHandle(ProcessInformation.hProcess);
CloseHandle(ProcessInformation.hThread);
}
else
{
debug_printf("Could not detach %s\n", name);
}
}
else
{
if (ret)
{
debug_printf("ProcessInformation.hThread %x\n",
ProcessInformation.hThread);
// CloseHandle(ProcessInformation.hThread);
WaitForSingleObject(ProcessInformation.hProcess, INFINITE);
CloseHandle(ProcessInformation.hProcess);
debug_printf("Thandle %x\n", ProcessInformation.hThread);
CloseHandle(ProcessInformation.hThread);
}
}
return(ret);
}
void ExecuteStart(char* CommandLine)
{
char *ImageName = CommandLine;
for ( ;
( (*CommandLine)
&& (*CommandLine != ' ')
&& (*CommandLine != '\t')
);
CommandLine++
);
*CommandLine++ = '\0';
while ( (*CommandLine)
&& ( (*CommandLine == ' ')
|| (*CommandLine == '\t')
)
);
ExecuteProcess(
ImageName,
CommandLine,
TRUE
);
return;
}
void
ExecuteKill(char * lpPid)
{
HANDLE hProcess;
DWORD dwProcessId;
dwProcessId = (DWORD) atol(lpPid);
debug_printf("dwProcessId %d\n",dwProcessId);
hProcess = OpenProcess(
PROCESS_TERMINATE,
FALSE,
dwProcessId
);
if (NULL == hProcess)
{
debug_printf(
"Could not open the process with PID = %d\n",
dwProcessId
);
return;
}
if (FALSE == TerminateProcess(
hProcess,
0
)
) {
debug_printf(
"Could not terminate the process with PID = %d\n",
dwProcessId
);
}
CloseHandle(hProcess);
return;
}
void ExecuteCommand(char* line)
{
char* cmd;
char* tail;
if (isalpha(line[0]) && line[1] == ':' && line[2] == 0)
{
line[2] = '\\';
line[3] = 0;
SetCurrentDirectoryA(line);
return;
}
tail = line;
while ((*tail)!=' ' && (*tail)!=0)
{
tail++;
}
if ((*tail)==' ')
{
*tail = 0;
tail++;
}
cmd = line;
if (cmd==NULL || *cmd == '\0' )
{
return;
}
if (strcmp(cmd,"cd")==0)
{
ExecuteCd(tail);
return;
}
if (strcmp(cmd,"dir")==0)
{
ExecuteDir(tail);
return;
}
if (strcmp(cmd,"kill")==0)
{
ExecuteKill(tail);
return;
}
if (strcmp(cmd,"reboot")==0)
{
ExecuteReboot(tail);
return;
}
if (strcmp(cmd,"type")==0)
{
ExecuteType(tail);
return;
}
if (strcmp(cmd,"ver")==0)
{
ExecuteVer();
return;
}
if (strcmp(cmd,"validate")==0)
{
debug_printf("Validating heap...");
if (HeapValidate(GetProcessHeap(),0,NULL))
{
debug_printf("succeeded\n");
}
else
{
debug_printf("failed\n");
}
return;
}
if (strcmp(cmd,"start") == 0)
{
ExecuteStart(tail);
return;
}
if (strcmp(cmd,"exit")==0)
{
ExitProcess(0);
return;
}
if (ExecuteProcess(cmd,tail,FALSE))
{
return;
}
debug_printf("Unknown command\n");
}
void ReadLine(char* line)
{
// KEY_EVENT_RECORD KeyEvent;
DWORD Result;
UCHAR CurrentDir[255];
char ch;
int length = 0;
GetCurrentDirectoryA(255,CurrentDir);
debug_printf("%s>", CurrentDir);
do
{
if (!ReadConsoleA(InputHandle,
&ch,
1,
&Result,
NULL))
{
debug_printf("Failed to read from console\n");
for(;;);
}
switch (ch)
{
case '\b':
if (length > 0)
{
debug_printf("\b \b");
line--;
length--;
}
break;
default:
debug_printf("%c", ch);
*line = ch;
line++;
length++;
}
} while (ch != '\n');
line--;
*line = 0;
}
int main(void)
{
static char line[255];
AllocConsole();
InputHandle = GetStdHandle(STD_INPUT_HANDLE);
OutputHandle = GetStdHandle(STD_OUTPUT_HANDLE);
debug_printf("Shell Starting...\n");
SetCurrentDirectoryA("C:\\");
for(;;)
{
ReadLine(line);
ExecuteCommand(line);
}
return 0;
}

View File

@@ -1 +1 @@
loaders\dos\loadros kernel\kimage.bin %1 %2 %3 %4
loadros ntoskrnl.exe ide.sys vfatfs.sys

32
reactos/bootflop.bat Normal file
View File

@@ -0,0 +1,32 @@
@ECHO OFF
:
: copy files to HD...
:
COPY /Y A:\DRIVERS\*.SYS C:\reactos\system32\drivers > NUL:
COPY /Y A:\DLLS\*.DLL C:\reactos\system32 > NUL:
COPY /Y A:\APPS\*.EXE C:\reactos\system32 > NUL:
COPY /Y A:\SUBSYS\*.EXE C:\reactos\system32 > NUL:
COPY /Y A:\SUBSYS\*.DLL C:\reactos\system32 > NUL:
:
: present a menu to the booter...
:
: ECHO 1) IDE,VFatFSD
: ECHO 2) No Drivers
: CHOICE /C:123 /T:1,3 "Select kernel boot config"
: IF ERRORLEVEL 2 GOTO :L2
:L1
CLS
LOADROS NTOSKRNL.EXE DRIVERS\IDE.SYS DRIVERS\VFATFSD.SYS
GOTO :END
:L2
CLS
LOADROS NTOSKRNL.EXE
GOTO :END
:END
EXIT

View File

@@ -1,20 +1,22 @@
DIRECTORIES
system : compiled versions of the various system components and
libraries
mkernel : microkernel source
mkernel/hal : hardware abstraction layer source
mkernel/mm : memory managment subsystem source
mkernel/iomgr : IO manager subsystem source
include : win32 headers
include/internal : kernel private header files
include/ntdll : system library private header files
include/kernel32 : system library private header files
include/user32 : user interface private header files
include/gdi32 : graphics interface private header files
include/ddk : header files for modules
lib/ntdll : NT dll source
lib/kernel32 : kernel32 source
doc : documentation
loaders/dos : DOS based loader
loaders/boot : boot loader
DIRECTORIES
system : compiled versions of the various system components and
libraries
ntoskrnl : kernel source
ntoskrnl/hal : hardware abstraction layer source
ntoskrnl/mm : memory managment subsystem source
ntoskrnl/io : IO manager subsystem source
ntoskrnl/ke : kernel source
include : win32 headers
include/internal : kernel private header files
include/ntdll : system library private header files
include/kernel32 : system library private header files
include/ddk : header files for modules
lib/ntdll : NT dll source
lib/kernel32 : kernel32 source
doc : documentation
loaders/dos : DOS based loader
loaders/boot : boot loader
services : various services (device drivers, filesystems etc)
services/dd : device drivers
services/fs : file systems

130
reactos/doc/HACKING Normal file
View File

@@ -0,0 +1,130 @@
* Introduction
Having successfully built ReactOS and been amazed by what it does, you're
now desperate to fill in some of the omissions, this document shows you how.
* Prerequisites
A working knowledge of NT driver development is useful for understanding the
kernel and some of its abstractions. The NT4 ddk is available for free
download from http://www.microsoft.com/hwdev/. The Windows 98 and Windows
2000 DDKs are also available but the NT4 one is the most useful. See
Legal Stuff below however.
There are a number of books on NT driver development, I would recommend
'Windows NT Device Driver Development' (http://www.osr.com/book/) since OSR
seem to know their stuff. There is only one book on NT filesystem
development 'Windows NT File System Internals'. Please don't buy any of
these books unless you need to, and can afford it.
These mailing lists and newsgroups are useful for NT internals related
questions,
ntfsd@atria.com, ntdev@atria.com
(subscribe by email to majordomo@atria.com)
comp.os.????
microsoft.public.????
* Style
There is no coding style used for ReactOS, however the following guidelines
make things easier
Include information at the top of a module about its purpose, contact
information for its programmer and any useful notes.
Include a comment by each non-trival function describing its arguments,
purpose and any other notes.
Update the documentation in this directory
These guidelines are an ideal, no one manages to implement them all the
time, straightforward working code is probably just as good.
* Debugging
Debugging kernel-mode code is tricky, these are some snippets
DbgPrint writes a message to the console using a printf style format
string. The DPRINT macro (defined in internal/debug.h) expands to
DbgPrint unless NDEBUG is defined, this is useful for having copious
output from a module only when a problem is being debugging. DPRINT
also prefixes the message with the file and line number to make it
easier to see where output is coming from. DbgPrint can be used at any
point including in interrupt handlers.
There are options in ntoskrnl/kd/kdebug.c for copying DbgPrint output
to a serial device or bochs logging port (parallel support should also
be added). This can be useful if a lot of output is being generated.
It should be possible to include support for debugging the kernel with
gdb over a serial line. Bochs (a shareware CPU emulator) is also useful
for debugging the kernel, I wrote some patches to allow capture of console
output from within bochs to file and for debugging a kernel running
under bochs with gdb. Contact me (welch@cwcom.net) if you're are
interested.
If CPU reports an exception not handled by the kernel (any page fault
not part of virtual memory support or any other exception) the kernel
will display output like this and halt
General Protection Fault Exception: 13(0)
CS:EIP xxxxxxxx:xxxxxxx
DS xxxx ES xxxx FS xxxx GS xxxxx
EAX: xxxx EBX: xxxx
....
EDI: xxxx EFLAGS: xxxx ESP: xxxx
cr2: xxxx
Stack: xxxx xxxx xxxx ...
....
Frames: xxxx xxxx xxxx ...
....
The fault type will usually be either 'General Protection' or
'Page Fault', see your Intel manual for the more exotic types. The
'EIP' number is the address of the faulting instruction. If the 'CS'
number is 0x20 then the exception occured in kernel mode, if it is 0x11
then the exception occurred in user mode. 'cr2' is the address that the
faulting instruction was trying to access, if the exception was a page
fault. The number printed after 'Frames' are any addresses on the stack
that look like function addresses.
If the kernel detects a serious problem that it will bug check, displaying
output like this
Bug detected (code x, param x x x x)
Frames: xxx xxxx xxxx
....
Again the numbers printed after 'Frames' are any addresses on the stack
that look like function addresss. Usually the kernel will also print a
message describing the problem in more detail, the bug check code isn't
very useful at the moment.
* Contacts
There is a mailing list for kernel development,
ros-kernel@reactos.com
The main developers use a cvs account to coordinate changes, ask
rex (rex@lvcablemodem.com) for an account if you are going to be adding
a lot of code. Smaller patches can go to the mailing list or to the
relevant developer (usually the comment at the top of a module will have
an email address). Regular snapshots are made available for download,
see the mailing list for announcements.
* Legal stuff
The ReactOS project is GPL'ed, please make sure any code submitted is
compatible with this.
The NT4 ddk license agreement allows its usage for developing nt drivers
only. Legally therefore it can not be used to develop ReactOS, neither the
documentation or the sample code. I'm not a lawyer, but I doubt the
effiacy of 'shrinkwrap licenses' particularly on freely downloadable
software. The only precendent I know of, in a Scottish court, didn't
upload this type of license.
Also the 'fair use' section of copyright law allows the 'quoting' of small
sections from copyrighted documents, e.g. Windows API or DDK documentation

6
reactos/doc/INDEX Normal file
View File

@@ -0,0 +1,6 @@
HACKING: Some notes for adding code to ReactOS
DIRS: Explanation of directory layout
INTERNALS: Some notes on kernel internals
TODO: Bugs and omissions, big and little things that need to be done
NOTES: Unsorted material, some of it is redundant
BUGLIST: Known bugs, please update when you find one

43
reactos/doc/INTERNALS Normal file
View File

@@ -0,0 +1,43 @@
A collection of articles on kernel internals, please add to this
------------------------------------------------------------------------------
IRQ level
------------------------------------------------------------------------------
IRQ level (IRQL) is a per-processor state in ReactOS used to coordinate
execution between ISRs and between threads. There are several levels
PASSIVE_LEVEL, APC_LEVEL: The normal level for user mode and most
kernel mode code. At the moment APC_LEVEL is unused.
DISPATCH_LEVEL: At this level all irqs are still allowed but thread
rescheduling on the current processor is disabled. This is used by
the spinlock synchronization primitive to implement its uniprocessor
semantics (multiprocessor is more complex). It is also used for some
other forms of synchronization, DPCs for example. Many APIs are
unavailable at this IRQL, usually those that might have to wait. It
is recommended that you don't spend too much time at this IRQL
otherwise system responsiveness will be reduced.
> DISPATCH_LEVEL: Each irq is assigned a priority (which will be
greater than DISPATCH_LEVEL). At an irq's priority level that irq,
lower priority irqs and thread rescheduling are disabled. Higher
priority irqs can still run. Very few APIs are available at IRQLs
greater than DISPATCH_LEVEL.
HIGH_LEVEL: All irqs are disabled.
-------------------------------------------------------------------------------
DPCs
-------------------------------------------------------------------------------
It is a design goal not to spend too much time in ISRs, for this reason
ISRs should postpone most processing till it can run at a lower IRQL. The
mechanism for this is a Delayed Procedure Call (DPC). When a DPC object is
created, it is associated with a function. The DPC object can then be inserted
in the DPC queue from an ISR. If the IRQL on return from the ISR is less than
DISPATCH_LEVEL the DPC queue will be drained, otherwise this will happen when
the IRQL level drops below DISPATCH_LEVEL or the processor becomes idle. When
the DPC queue is drained each DPC object is removed and the associated
function is called at DISPATCH_LEVEL. A DPC object can only be inserted once,
further insertions before it is removed will have no effect.

36
reactos/doc/apc Normal file
View File

@@ -0,0 +1,36 @@
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.

View File

@@ -1,140 +0,0 @@
This file attempts to document the functions made publically available by
the various subsystems.
* Formatted I/O operations *
NAME: int vsprintf(char *buf, const char *fmt, va_list args)
NAME: int sprintf(char* buf, const char* fmt, ...)
WHERE: internal/kernel.h
FUNCTION: The same as the standard c library versions
* PIO operations *
NAME: in[b/w/l](port)
WHERE: internal/io.h
FUNCTION: Read an IO port of the specified size (byte/word or long)
RETURNS: The value read
NAME: out[b/w/l](port,val)
WHERE: internal/io.h
FUNCTION: Write an IO port of the specified size (byte/word or long)
NAME: in_p[b/w/l](port)
WHERE: internal/io.h
FUNCTION: Read an IO port of the specified size (byte/word or long) with
a pause
RETURNS: The value read
NAME: out_p[b/w/l](port,val)
WHERE: internal/io.h
FUNCTION: Write an IO port of the specified size (byte/word or long) with
a pause
* Bit operations *
NAME: int set_bit(int nr, void* addr)
NAME: int clear_bit(int nr, void* addr)
NAME: int change_bit(int nr, void* addr)
WHERE: internal/bitops.h>
FUNCTION: Operate on a bit in the word pointed to by addr
RETURN: 0 if the bit was cleared before the operations
non-zero otherwise
* Debugging functions *
NAME: DPRINT(fmt,....)
WHERE: internal/debug.h
FUNCTION: Outputs a string to the console if NDEBUG isn't defined before
including internal/debug.h, a NOP otherwise
ARGUMENTS: The same as printf
NAME: printk
WHERE: internal/kernel.h
FUNCTION: Outputs a string to the console
ARGUMENTS: The same as printf
* Memory managment functions *
NAME: unsigned int physical_to_linear(unsigned int paddr)
WHERE: hal/page.h
FUNCTION: Converts a physical address to a linear one
RECEIVES:
paddr = the physical address to convert
RETURNS: A virtual address where the memory at that physical address can be
accessed
NAME: void* ExAllocatePool(unsigned int size, unsigned int type = 0);
WHERE: internal/pool.h
FUNCTION: Allocates a block of memory
RECEIVES:
size = the size of the block to allocate
type = will be whether to allocate pagable memory
RETURNS: The address of the block
NOTE: This isn't interrupt safe
NAME: void ExFreePool(void* block)
WHERE: internal/pool.h
FUNCTION: Frees a block of memory
NAME: void free_page(unsigned int physical_base, unsigned int nr = 1)
WHERE: internal/mm.h
FUNCTION: Adds a continuous range of physical memory to the free list
NAME: unsigned int get_free_page(void)
WHERE: internal/mm.h
FUNCTION: Gets a free page
RETURNS: Its physical address
NAME: unsigned int get_page_physical_address(unsigned int vaddr)
WHERE: internal/mm.h
FUNCTION: Gets the physical address of a page
NAME: void mark_page_not_writable(unsigned int vaddr)
WHERE: internal/mm.h
FUNCTION: Prevent writing the page
* DMA functions *
NAME: unsigned int get_dma_page(unsigned int max_address)
WHERE: internal/mm.h
FUNCTION: Gets a page with a restricted physical address i.e. suitable for
dma
RETURNS: The physical address of the page
NAME: void disable_dma(unsigned int dmanr)
WHERE: internal/dma.h
FUNCTION: Disables the specified dma channel
NAME: void enable_dma(unsigned int dmanr)
WHERE: internal/dma.h
FUNCTION: Enables the specified dma channel
NAME: void clear_dma_ff(unsigned int dmanr)
WHERE: internal/dma.h
FUNCTION: Clear the dma flip-flop
NAME: void set_dma_mode(unsigned int dmanr, char mode)
WHERE: internal/dma.h
FUNCTION: Sets the type of dma transfer
NAME: void set_dma_page(unsigned int dmanr, char pagenr)
WHERE: internal/dma.h
FUNCTION: Set only the page register bits of the transfer address
NAME: void set_dma_addr(unsigned int dmanr, unsigned int a)
WHERE: internal/dma.h
FUNCTION: Set the transfer address for dma
NOTE: Assumes flip-flop is clear
NAME: void set_dma_count(unsigned int dmanr, unsigned int count)
WHERE: internal/dma.h
FUNCTION: Sets the size of the transfer
ARGUMENTS:
count = the number of bytes to transfer
NOTE: Count must be even for channels 5-7
NAME: int get_dma_residue(unsigned int dmanr)
WHERE: internal/dma.h
FUNCTION: Gets the residue remaining after a dma transfer on the channel

View File

@@ -1,2 +0,0 @@
* Kernel bugs not fixed

View File

@@ -1,27 +0,0 @@
This is a list of the functions documented in the ddk that have been
implemented
IoAllocateController
IoFreeController
IoCreateController
IoDeleteController
IoStartNextPacket
IoStartNextPacketByKey
IoStartPacket
IoSizeOfIrp
IoMarkIrpPending
IoFreeIrp
IoConnectInterrupt
IoDisconnectInterrupt
IoGetCurrentIrpStackLocation
IoGetNextIrpStackLocation
IoRequestDpc
IoInitializeDpc
IoInitializeTimer
IoStartTimer
IoStopTimer
Partially implemented
IoCreateDevice
IoCallDriver

View File

@@ -1,19 +0,0 @@
Some notes on debugging the ReactOS kernel
------------------------------------------
* Interpreting crashes
If the kernel causes a fatal cpu fault then it will print out a message and
halt. This message contains important information for debugging the problem,
look for these lines
Exception: xx(yy)
CS:EIP 20:zzzzzzzzzzzz
Here xx is the type of error, usually either 14 or 13 and yy is the error
code. Generally error codes 13 and 14 both mean the kernel tried to access
some memory in an invalid way. zzzzzzzzz is the address of the erronous
instruction.
* Debugging with bochs

View File

@@ -1,114 +0,0 @@
Kernel Development FAQ (for v0.0.7)
This attempts to answer some of the common questions people developing for
the kernel might want to ask (or at least what I think they should ask).
Obviously I can only detail those parts which I have written so other
developers please fill in the gaps.
Q: What is this, what are you people, what's going on
A: This is the ReactOS, an operating system intended as a clone of windows
NT. See the project website (http://www.sid-dis.com/reactos/) for more details.
Q: Why ReactOS
A: To condemn Bill Gates to penury.
Q: What do I need to compile the kernel
A: DJGPP, get it from http://www.delorie.com/djgpp
Q: How do I compile the kernel
A: Unpack the zip. It is important not to install the kernel in the same
directory as a previous version, this has caused a bit of confusion in the
past. Edit the makefile in the top level directory, in particular select the
correct host to build from. Then run make in the top directory
Q: What files are created when I make the kernel
A: The following files are created in the kernel directory
kimage = the kernel as a coff executable
kimage.bin = the kernel as a raw binary image
kernel.sym = a list of the kernel symbols
Q: How do I load the kernel
A: Run the boot.bat batch file.
Q: Does it boot from disk
A: Not at the moment.
Q: When I run the kernel it crashes
A: The kernel (at the moment) can only be loaded from a clean system. That
is one without EMM386 or any version of windows loaded. A quick way to
ensure this (if you have windows 95) is to set the program to run in msdos
mode and specify an empty config.sys and autoexec.bat. See the windows help
for more information.
If you do that and the problem persists then contact the kernel team
(ros-kernel@sid-dis.com) as it is probably a bug in the kernel
Q6: How do I load a module with the kernel
A: Add the names of any modules to be loaded to the command line of boot.bat.
Q7: I want to add code to the kernel, how do I get it to be compiled
A: You will need to edit the Makefile in kernel directory. There should be
a statement like this
OBJECTS = hal/head.o hal/exp.o kernel/vsprintf.o \
....
kernel/irqhand.o hal/page.o mm/virtual.o kernel/error.o \
kernel/exports.o kernel/module.o
Add the name of the object file (the file produced when your code is
compiled) to the end of the statement (in this case after kernel/module.o).
If you need to go onto a new line then add a slash to the end of the
previous line. It is also very important to use an editor which preserves
tabs.
Q8: I want to add code to the kernel, how do I make it official
A: Contact the kernel mailing list ros-kernel@sid-dis.com or our coordinator
dwinkley@whitworth.edu. If it is for a specific section then the kernel
website (http://www.geocities.com/SiliconValley/Peaks/1957) has a list of
those working on individual areas, you might what to contact one of them
instead.
Q9: What header files should I use
A: Don't include the usual DJGPP headers like stdio.h unless you are using
something compiler based like stdargs.h. To use the DJGPP headers requires
linking with libc which is useless in kernel mode.
All the header files are in the top-level include directory which is laid
out like this
include = general win32 api declarations
include/internal = private kernel headers
include/internal/hal = HAL headers
include/ddk = header files with declarations for modules
There should be a file called api.txt which documents all of the functions
(and which header files they need).
Q11: I want to export my function for modules to use, how do I do that
A: Add the function to the list in kernel/exports.lst, then remake the
kernel. Note the function must be declared as extern "C".
Q12: I want to make my functions part of the kernel interface to user mode,
A: That section isn't finished yet, though it will probably mean adding a
pointer to the function and the size of its parameters to a internal table
somewhere.
Q14: I want to write a module, what are the guidelines
A: See modules.txt in this directory
Q15: I want to write an ISR (interrupt service routine)
A: See irq.txt in this directory
Q16: I want to use DMA
A: Firstly this answer covers only DMA via the dma chips *not*
busmaster DMA.
To program the dma chip use the functions in internal/dma.h (look in api.txt
for details). PC DMA can only go to memory with a physical address below
1mb (or 16mb on some systems), use the get_dma_page to allocate this kind
of memory.
Q17: You haven't answered my question
A: Send your questions to ros-kernel@sid-dis.com
- David Welch (welch@mcmail.com)

View File

@@ -1,10 +0,0 @@
This document describes the implementation of the memory managment
* ReactOS memory map
0x00000000 - 0xc0000000 = User memory
0xc0000000 - 0xd0000000 = Kernel memory
0xd0000000 - 0xffffffff = Identify map of physical memory
*

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +0,0 @@
This contains documentation describing the internals of the various kernel
subsystems and a few other useful bits of information.

View File

@@ -1,135 +0,0 @@
** Introduction
This attempts to document the ReactOS irq handling. As of v0.0.8 this has
changed to be more nt like, I will attempt to summarize the new
implementation for those unavailable with nt device driver writing. Note,
ReactOS doesn't have an exact implementation but the omissions are, except
where noted, not user visible.
** Steps in grabbing an irq vector
* Call HalConnectInterrupt
PROTOTYPE:
ULONG HalGetInterruptVector(INTERFACE_TYPE InterfaceType,
ULONG BusNumber,
ULONG BusInterruptLevel,
ULONG BusInterruptVector,
OUT PKIRQL Irql,
OUT PKAFFINITY Affinity)
PURPOSE:
Translates a bus dependant interrupt vector to a system vector
ARGUMENTS:
InterfaceType = Type of bus to which the device to receive interrupts
from is connected to. Currently only 'Internal' is
recognized
BusNumber = Number of the bus the device is connected to
(currently ignored)
BusInterruptLevel = Bus specific interrupt level (currently ignored)
BusInterruptVector = Bus specific vector. Currently this is the same
as the normal vector (09 is the keyboard vector
for example)
Irql = On return contains the DIRQL for the vector
Affinity = On return contains the affinity mask for the vector
(currently unimplemented)
RETURNS:
The system mapped vector
* Call IoConnectInterrupt
PROTOTYPE:
NTSTATUS IoConnectInterrupt(OUT PKINTERRUPT* InterruptObject,
PKSERVICE_ROUTINE ServiceRoutine,
PVOID ServiceContext,
PKSPIN_LOCK SpinLock,
ULONG Vector,
KIRQL Irql,
KIRQL SynchronizeIrql,
KINTERRUPT_MODE InterruptMode,
BOOLEAN ShareVector,
KAFFINITY ProcessorEnableMask,
BOOLEAN FloatingSave)
PURPOSE:
Connect a service routine to an interrupt vector
ARGUMENTS:
InterruptObject = Points to an object describes the interrupt on
return
ServiceRoutine = Function to be called when the device interrupts
ServiceContext = Parameters to be passed to the service routine
SpinLock = Should be NULL
Vector = System mapped vector returned from HalGetInterruptVector
Irql = DIRQL returned from HalGetInterruptVector
SynchronizeIrql = Should be the same as Irql
InterruptMode = Device interrupt type (currently ignored)
ShareVector = True if the interrupt vector can shared
ProcessorEnableMask = Currently ignored
FloatingSave = Should be false
RETURNS: Status
* Sample code for snarfing an interrupt vector
void grab_my_irq()
{
ULONG MappedIrq;
KIRQL Dirql;
KAFFINITY Affinity;
PKINTERRUPT IrqObject;
MappedIrq = HalGetInterruptVector(Internal,
0,
0,
MY_VECTOR,
&Dirql,
&Affinity);
IoConnectInterrupt(&IrqObject,
my_irq_service_routine,
my_context,
NULL,
MappedIrq,
Dirql,
Dirql,
0,
FALSE, // Not sharable
Affinity,
FALSE);
}
** Designing an interrupt service routine
An interrupt service routine should have the following prototype
BOOLEAN my_irq_service_routine(PKINTERRUPT Interrupt,
PVOID ServiceContext);
ARGUMENTS:
Interrupt = The same as the object returned from the
IoConnectInterrupt
ServiceContext = A user defined parameters
(passed to IoConnectInterrupt)
RETURNS:
True if it handled the interrupt, false if it should be passed onto
other devices sharing the same vector
NOTES:
While an isr is executing all devices of a lower or equal priority
can't interrupt. For this reason it is important that an isr
should complete in a short an interval as possible. The set of
routines an isr can call is also restricted.

View File

@@ -1,21 +0,0 @@
This document describes the state of a uniprocessor PC at each of the IRQ
levels supported by the ReactOS kernel
PASSIVE_LEVEL: IF bit clear in the processor flags
All irqs umasked at the PIC
APC_LEVEL: Unknown
WAKE_LEVEL: Unknown
DISPATCH_LEVEL: IF bit clear in the processor flags
All irqs umasked at the PIC
Thread dispatching disabled
DIRQL (Device specific IRQ level):
IF bit clear in the processor flags
Device's irq and all lower priority irqs masked at the PIC
Thread dispatching disabled
HIGH_LEVEL: IF bit set in the processor flags
All irqs masked at the PIC
Thread dispatching disabled

View File

@@ -1,33 +0,0 @@
** Introduction
This is (an incomplete) guide to writing device drivers (and other kernel
extensions) for ReactOS.
** Setting up the build environment
Create a new subdirectory in the modules directory and copy one of the
existing module makefiles into it. Customize the makefile to compile the
source files for the module. Note: generally it is not necessary to specify
the compiler or compiler flags to use.
** Initializing a module
On loading the kernel will call the module function
PROTOTYPE:
NTSTATUS ModuleEntry(PDRIVER_OBJECT DriverObject,
PUNICODE_STRING RegistryPath)
PURPOSE:
Initializing the module
ARGUMENTS:
DriverObject = Pointer to an object describing the driver
RegistryPath = Currently NULL
RETURNS:
STATUS_SUCCESS = If the module initialized successfully

696
reactos/doc/notes Normal file
View File

@@ -0,0 +1,696 @@
*** This file contains messages I've culled off the net as well
as previous discussions all of which have useful info on fixes
that need to be added to ReactOS. messages are between five
dashes on a line by themselves. If you implement the fix
reffered to in a message, feel free to delete it from the file.
Rex ***
-----
Subject: [ros-kernel] Inside the Boot Process
Date: Mon, 22 Mar 1999 22:05:47 +0100
From: Emanuele Aliberti <ea@iol.it>
For those working on the boot loader: in WinNt Magazine november 1998
issue (http://www.winntmag.com/) there is a detailed description, by
Mark Russinovich, of the r<>le the MBR, NTLDR, boot.ini, ntdetect.com...
play in the boot process ("Inside the Boot Process, Part 1").
-----
Yes with DPCs, KeDrainDpcQueue should go to HIGH_LEVEL because
it needs to synchronize with KeInsertDpcQueue. Also the idle thread
should run at DISPATCH_LEVEL and regularly drain the dpc queue, that
way if an irq happens and the dpc can't be executed immediately it
will be executed as soon as the processor is idle rather than
waiting for the next timer tick
-----
About the console driver, I think it might be quite useful to have a simple
way for apps to print to the screen for debugging. But when the kernel is more
stable, console handling should be moved to user level because console printing
needs to know about windows and so on which can only be done at user level.
-----
Subject: Re: IMSAMP-how to avoid rebooting?
Date: 9 Nov 1998 00:40:32 -0000
From: Charles Bryant <n51190709.ch@chch.demon.co.uk>
Newsgroups: comp.os.ms-windows.programmer.nt.kernel-mode
References: 1, 2 , 3 , 4
In article <un264wzle.fsf@xxx.yyy.zzz>, David C. <qqqq@xxx.yyy.zzz> wrote:
>The reason it won't unload when something is bound to it is the same
>reason you can't unload any other driver that has an open client. If
>you install any driver, and have a user program (or another driver) open
>a handle to it, and then give the "net stop" command to unload it,
>you'll find that the unload will be delayed until the user program
>closes its handle.
When developing a driver I found this to be a considerable nuisance.
Frequently a bug would leave an IRP stuck in the driver and I
couldn't unload and reload a fixed version. While reading NTDDK.H I
found a suspicious constant and discovered that the Flags field in
the device (the one which you OR in DO_BUFFERED_IO or DO_DIRECT_IO)
has a bit called DO_UNLOAD_PENDING. By experiment I confirmed that
this bit is set when you do 'net stop', so a driver can check it
periodically (e.g. from a timer DPC every ten seconds) and cancel all
queued IRPs if it is found to be set.
Since this is not documented anywhere that I can find, it might be
unwise to rely on it for production code, but it is very useful for
debugging. Maybe someone with internals knowledge can comment on the
reliability of it.
-----
Subject: Re: Kernel bugs
Date: Fri, 23 Oct 1998 12:08:36 -0700
From: rex <rex@lvcablemodem.com>
To: Jason Filby <jasonfilby@yahoo.com>
References: 1
Jason Filby wrote:
> Hi,
>
> Ok -- here's most of what I get when I press a key:
>
> Page fault detected at address 1fd4 with eip c042f794
> Recursive page fault detected
> Exception 14(2)
> CS:EIP 20:c042f794
>
> Rex -- do you know of anyway to find out which function in what file
> is causing the exception? I know that for problems in the kernel, you
> just look in the ntoskrnl\kernel.sym file and find the EIP value which
> matches the one given in the exception debug text. But what about
> modules? How can we track exceptions that occur in functions in modules?
>
I know this is a little belated, but I thought I'd take astab at answering
this anyway. add an option to the
makefile for the module to generate a listing file with
symbol information. Then, on a boot test, note the
address that the module is loaded at, and subtract
this from the EIP value. add any offset used in the
module link specification (I dont think there currently
is one), and look for the last symbol with a lower
address offset.
Brian, I have an idea on how to make this exception
dump information a little more useful. We should
have the load information for the load modules
in memory somewhere. Perhaps the exception
dump could check offending addresses to see if
they lie in the kernel or in a module, and if they
lie in a module the proper offset could be subtracted
and this number could be displayed seperately. If
I get a chance today, I'll make this change and send
it to ya.
Rex.
-----
Subject: [ros-kernel] Pet peeve of the week
Resent-Date: Sun, 25 Oct 1998 11:57:40 -0600
Resent-From: ros-kernel@sid-dis.com
Date: Sun, 25 Oct 1998 09:53:48 -0800
From: rex <rex@lvcablemodem.com>
Reply-To: <ros-kernel@sid-dis.com>
To: ReactOS Kernel Forum <ros-kernel@sid-dis.com>
Hi all,
I guess it's about time to start another mailstorm
on the list. :)
I have a suggestion for a change to the kernel.
It not a very big change, and I hope everyone
will agree that it makes sense.
There is a structure used in many places in the
kernel called LARGE_INTEGER. the is also
a version called ULARGE_INTEGER, but it
is not used at all as far as I can tell. this structure
is equivalent to a long long int. You can literally
cast a pointer to a LARGE_INTEGER to a
long long int and all manipulation will work
seemlessly. My suggestion is that we replace the
use of this structure with long long ints. Even
microsoft, in their infinite wisdom, has made this
suggestion in the DDK documentation. If you're
wondering where, look at the RTL functions
that manipulate LARGE_INTEGER structs.
Replacing LI's with long long ints will work
because they are binary compatable. All software
compiled to use LI's will manipulate long long ints
correctly and vice versa. There is one problem
with this suggestion: the LARGE_INTEGER type
is a structure containing 2 members. Any code
that accesses the structure by members will break.
I think the kernel side impact is minimal, and is
worth the change. However, the structure is used
in several of the Win32 API functions, and needs
to remain there. I think we build a conditionally
compiled version of the LARGE_INTEGER type.
In kernel mode code (the kernel proper and drivers)
the LARGE INTEGER will be the following:
typedef long long int LARGE_INTEGER,
*PLARGE_INTEGER;
typedef unsigned long long int ULARGE_INTEGER,
*PULARGE_INTEGER;
and in user mode code it will expand out to the
current definition (which by the way, is not
strictly correct, but can't be because it uses a
MS compiler extension).
Brian, I would be willing to make the conversion
to those kernel modules that needed it, and of
course to the IDE driver if we want to go forward
with the change.
Lastly, I'll mention what made me consider this.
I was fixing the timer routines, and two of the
three problems turned out to be related to LI
conversion problems.
Rex.
-----
Subject: Re: [ros-kernel] Pet peeve of the week
Date: Thu, 29 Oct 1998 19:10:37 +0100
From: Boudewijn <ariadne@xs4all.nl>
To: rex@lvcablemodem.com
References: 1
Hai Rex
I think it is a good idea to wrap a makro around the member access
to large integers.
I haven't tested this, but do you think this is a good sugestion ?
#ifdef COMPILER_LARGE_INTEGERS
#define GET_LARGE_INTEGER_HIGH_PART(LargeInteger) ( ( LargeInteger >>
32) )
#define GET_LARGE_INTEGER_LOW_PART(LargeInteger) ( (LargeInteger &
0xFFFFFFFF) )
#define SET_LARGE_INTEGER_HIGH_PART(LargeInteger,Signed_Long) (
LargeInteger |= ( ((LARGE_INTEGER)Signed_Long) << 32 ) )
#define SET_LARGE_INTEGER_LOW_PART(LargeInteger,Unsigned_Long) (
LargeInteger |= Unsigned_Long )
#else
#define GET_LARGE_INTEGER_HIGH_PART(LargeInteger) ( (
LargeInteger.HighPart) )
#define GET_LARGE_INTEGER_LOW_PART(LargeInteger) (
(LargeInteger.LowPart) )
#define SET_LARGE_INTEGER_HIGH_PART(LargeInteger,Signed_Long) (
LargeInteger.HighPart= Signed_Long )
#define SET_LARGE_INTEGER_LOW_PART(LargeInteger,Unsigned_Long) (
LargeInteger.LowPart = Unsigned_Long )
#endif
Boudewijn
-----
Subject: Re: Question on "Sending buffers on the stack to asynchronous DeviceIoControl with buffered I/O"
Date: Mon, 16 Nov 1998 11:24:57 -0800
From: "-Paul" <paulsan@microsoftSPAM.com>
Organization: Microsoft Corp.
Newsgroups: microsoft.public.win32.programmer.kernel, comp.os.ms-windows.programmer.nt.kernel-mode
References: 1
Radu, I post the following information occassionally for questions such as
yours. I hope it helps.
-Paul
Here is an explanation of buffers and DeviceIoControl.
First, here are the parameters,
BOOL DeviceIoControl(
HANDLE hDevice, // handle to device of interest
DWORD dwIoControlCode, // control code of operation to perform
LPVOID lpInBuffer, // pointer to buffer to supply input data
DWORD nInBufferSize, // size of input buffer
LPVOID lpOutBuffer, // pointer to buffer to receive output data
DWORD nOutBufferSize, // size of output buffer
LPDWORD lpBytesReturned, // pointer to variable to receive output byte
count
LPOVERLAPPED lpOverlapped // pointer to overlapped structure for
asynchronous operation
);
METHOD_BUFFERED
user-mode perspective
lpInBuffer - optional, contains data that is written to the driver
lpOutBuffer - optional, contains data that is read from the driver after
the call has completed
lpInBuffer and lpOutBuffer can be two buffers or a single shared buffer.
If a shared buffer, lpInBuffer is overwritten by lpOutBuffer.
I/O Manager perspective
examines nInBufferSize and nOutBufferSize. Allocates memory from non-paged
pool and puts the address of this pool in Irp->AssociatedIrp.SystemBuffer.
The size of this buffer is equal to the size of the larger of the two
bufferes. This buffer is accessible at any IRQL.
copies nInBufferSize to irpSp->Parameters.DeviceIoControl.InputBufferLength
copies nOutBufferSize to
irpSp->Parameters.DeviceIoControl.OutputBufferLength
copies contents of lpInBuffer to SystemBuffer allocated above
calls your driver
Device Driver perspective
you have one buffer, Irp->AssociatedIrp.SystemBuffer. You read input data
from this buffer and you write output data to the same buffer, overwriting
the input data.
Before calling IoCompleteRequest, you must
- set IoStatus.Status to an approriate NtStatus
- if IoStatus.Status == STATUS_SUCCESS
set IoStatus.Information to the
number of bytes you want copied
from the SystemBuffer back into
lpOutBuffer.
I/O Manager Completion Routine perspective
looks at IoStatus block, if IoStatus.Status = STATUS_SUCCESS, copies the
number of bytes specified by IoStatus.Information from
Irp->AssociatedIrp.SystemBuffer into lpOutBuffer
completes the request
METHOD_IN_DIRECT
user-mode perspective
lpInBuffer - optional, contains data that is written to the driver. This
buffer is used in the exact same fashion as METHOD_BUFFERED. To avoid
confusion, mentally rename this buffer to lpControlBuffer. This is
typically a small, optional buffer that might contain a control structure
with useful information for the device driver. This buffer is smal and is
double buffered.
lpOutBuffer - NOT OPTIONAL, This LARGE buffer contains data that is read by
the driver. To avoid confusion, mentally rename this buffer to
lpDataTransferBuffer. This is physically the same buffer that the device
driver will read from. There is no double buffering. Technically, this
buffer is still optional, but since you are using this buffering method,
what would be the point???
I/O Manager perspective
If lpInBuffer exists, allocates memory from non-paged pool and puts the
address of this pool in Irp->AssociatedIrp.SystemBuffer. This buffer is
accessible at any IRQL.
copies nInBufferSize to irpSp->Parameters.DeviceIoControl.InputBufferLength
copies nOutBufferSize to
irpSp->Parameters.DeviceIoControl.OutputBufferLength
copies contents of lpInBuffer to SystemBuffer allocated above
So far this is completely identical to METHOD_BUFFERED. Most likely
lpInBuffer (mentally renamed to lpControlBuffer) is very small in size.
For lpOutBuffer (mentally renamed to lpDataTransferBuffer), an MDL is
allocated. lpOutBuffer is probed and locked into memory. Then, the user
buffer virtual addresses are checked to be sure they are readable in the
caller's access mode.
The MDL is address is stored in Irp->MdlAddress.
Your driver is called.
Device Driver perspective
The device driver can read the copy of lpOutBuffer via
Irp->AssociatedIrp.SystemBuffer. Anything written by the device driver to
this buffer is lost. The I/O Manager does not copy any data back to the
user-mode buffers as it did in the completion routine for METHOD_BUFFERED.
Art Baker's book is wrong in this respect (page 168, "data going from the
driver back to the caller is passed through an intermediate system-space
buffer" and page 177, "When the IOCTL IRP is completed, the contents of the
system buffer will be copied back into the callers original output buffer".
The device driver accesses the Win32 buffer directly via Irp->MdlAddress.
The driver uses whatever Mdl API's to read the buffer. Usually, this
buffer is to be written to some mass storage media or some similar
operation. Since this is a large data transfer, assume a completion
routine is required.
mark the Irp pending
queue it
return status pending
Device Driver Completion Routine perspective
standard completion routine operations
set IoStatus.Status to an approriate NtStatus
IoStatus.Information is not needed
completete the request
I/O Manager Completion Routine perspective
standard I/O Manager completion routine operations
unmap the pages
deallocate the Mdl
complete the request
METHOD_OUT_DIRECT
user-mode perspective
lpInBuffer - optional, contains data that is written to the driver. This
buffer is used in the exact same fashion as METHOD_BUFFERED. To avoid
confusion, mentally rename this buffer to lpControlBuffer. This is
typically a small, optional buffer that might contain a control structure
with useful information for the device driver. This buffer is smal and is
double buffered.
lpOutBuffer - NOT OPTIONAL, This LARGE buffer contains data that is written
by the driver and read by the wer-mode application when the request is
completed. To avoid confusion, mentally rename this buffer to
lpDataTransferBuffer. This is physically the same buffer that the device
driver will write to. There is no double buffering. Technically, this
buffer is still optional, but since you are using this buffering method,
what would be the point???
I/O Manager perspective
If lpInBuffer exists, allocates memory from non-paged pool and puts the
address of this pool in Irp->AssociatedIrp.SystemBuffer. This buffer is
accessible at any IRQL.
copies nInBufferSize to irpSp->Parameters.DeviceIoControl.InputBufferLength
copies nOutBufferSize to
irpSp->Parameters.DeviceIoControl.OutputBufferLength
copies contents of lpInBuffer to SystemBuffer allocated above
So far this is completely identical to METHOD_BUFFERED. Most likely
lpInBuffer (mentally renamed to lpControlBuffer) is very small in size.
For lpOutBuffer (mentally renamed to lpDataTransferBuffer), an MDL is
allocated. lpOutBuffer is probed and locked into memory. Then the user
buffer's addresses are checked to make sure the caller could write to them
in the caller's access mode.
The MDL is address is stored in Irp->MdlAddress.
Your driver is called.
Device Driver perspective
The device driver can read the copy of lpOutBuffer via
Irp->AssociatedIrp.SystemBuffer. Anything written by the device driver to
this buffer is lost.
The device driver accesses the Win32 buffer directly via Irp->MdlAddress.
The driver uses whatever Mdl API's to write data to the buffer. Usually,
this buffer is to be read from some mass storage media or some similar
operation. Since this is a large data transfer, assume a completion
routine is required.
mark the Irp pending
queue it
return status pending
Device Driver Completion Routine perspective
standard completion routine operations
set IoStatus.Status to an approriate NtStatus
IoStatus.Information is not needed
completete the request
I/O Manager Completion Routine perspective
standard I/O Manager completion routine operations
unmap the pages
deallocate the Mdl
complete the request
METHOD_NEITHER
I/O Manager perspective
Irp->UserBuffer = lpOutputBuffer;
IrpSp->Parameters.DeviceIoControl.Type3InputBuffer = lpInputBuffer;
No comments here. Don't use METHOD_DIRECT unless you know what you are
doing. Simple rule.
If your IOCtl involves no data transfer buffers, then METHOD_NEITHER is the
fastest path through the I/O Manager that involves an Irp.
Final Comment
Don't touch Irp->UserBuffer. This is a bookmark for the I/O Manager. Two
major problems can occur. 1 - page fault at high IRQL, or 2 - you write
something to Irp->UserBuffer and the I/O Manager overwrites you in its
completion routine. File systems access Irp->UserBuffer, but FSD writers
know all of the above and know when it is safe to touch Irp->UserBuffer.
Radu Woinaroski wrote in message <364F8F6E.2434B010@scitec.com.au>...
>Hello,
>
>I have a kernel-mode device driver that accepts a number of IoControl
>commands that use buffered data transfer (METHOD_BUFFERED).
>
>A user mode API provides a higher level access then the DeviceIoControl
>function.
>
>The function is implemented like that
>
>BOOL
Something(
> HANDLE hDevice ,
> int param1,
> int param2,
> DWORD * pReturn,
> LPOVERLAPPED pOverlapped)
>{
> // here a data buffer on the stack sent to asynchronous DeviceIoControl
>call
> int aDataIn[2];
> aDataIn[0] = param1;
> aDataIn[1] = param2;
>
> return DeviceIoControl(
> hDevice,
> DO_SOMETHING_IO,
> aDataIn,
> sizeof(int)*2,
> pReturn,
> sizeof(DWORD),
> pOverlapped);
>}
>
>The aDataIn buffer will not exist after DeviceIoControl returns (and
>when the I/O operation terminates). I know that for buffered IO the
>input data buffer is copyed by de IOManager to a nonpaged-pool area
>before passing the request to driver dispatch routine (DeviceControl).
>At the point of calling the dispatch routine (DeviceControl) the driver
>runs in the context of the calling thread so DeviceIoControl hasn't
>returned yet (?? or so I think) so aDataI
n will still be valid at the
>time IOManager copyes it to its buffer. So, this apears to work ok (at
>least in my opinion).
>
>Does I/O Manager use the Input buffer from the call to the Win32
>DeviceIoControl any where else after the first copy ?
>
>Is there any reason why this approach (passing a buffer on the stack to
>a asynchronous DeviceIoControl that uses buffered I/O) wouldn't work ?
>
>Allocating buffers from heap and deleting them on IO completion while
>managing asynchronous IO seems too much work ;-) .
>
>Thanks in advance for your opinions
>Radu W.
>
>--
>Radu Woinaroski
>Scitec
>Sydney, Australia
>Radu.Woinaroski@scitec.com.au
-----
Subject: Re: PCI ISR problem
Date: Fri, 20 Nov 1998 18:04:48 GMT
From: jeh@cmkrnl.com (Jamie Hanrahan)
Organization: Kernel Mode Systems, San Diego, CA
Newsgroups: comp.os.ms-windows.programmer.nt.kernel-mode
References: 1
On Thu, 19 Nov 1998 15:46:13 -0600, Eric Gardiner
<eric.gardiner@natinst.com> wrote:
>I'm having problems with NT4 not hooking the interrupt line indicated by
>a PCI device. Here's what I'm doing:
>
>1) Enumerating the PCI buses on the system (using HalGetBusData) until
>I find my device.
>2) Once my device is found, I read the "Interrupt Line Register" in the
>device's PCI config space to determine what interrupt level to pass to
>HalGetInterruptVector.
Whups! No. Call HalAssignSlotResources and look at the returned
CM_RESOURCE_LIST to find the vector, level, port addresses, etc., for
your device. (Then pass the returned CM_RESOURCE_LIST to ExFreePool.)
See Knowledge Base article Q152044.
--- Jamie Hanrahan, Kernel Mode Systems, San Diego CA (jeh@cmkrnl.com)
Drivers, internals, networks, applications, and training for VMS and Windows NT
NT kernel driver FAQ, links, and other information: http://www.cmkrnl.com/
Please post replies, followups, questions, etc., in news, not via e-mail.
-----
Subject: Re: IRP canceling
Date: Mon, 23 Nov 1998 09:05:47 -0500
From: Walter Oney <waltoney@oneysoft.com>
Organization: Walter Oney Software
Newsgroups: comp.os.ms-windows.programmer.nt.kernel-mode
References: 1
Seol,Keun Seok wrote:
> But, if the IRP was the CurrentIrp of the Device Object,
> the Driver's Start I/O routine will try to process the IRP.
> In the DDK help, the Start I/O routine MUST check the current IRP's
> Cancel bit.
> If set, Start I/O routine must just return.
>
> But I think that the IRP already completed should not be accessed.
You're absolutely right. I recommend the following code in a standard
StartIo routine to avoid the problem you point out:
VOID StartIo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
KIRQL oldirql;
IoAcquireCancelSpinLock(&oldirql);
if (Irp != DeviceObject->CurrentIrp || Irp->Cancel)
{
IoReleaseCancelSpinLock(oldirql);
return;
}
else
{
IoSetCancelRoutine(Irp, NULL);
IoReleaseCancelSpinLock(oldirql);
}
. . .
}
This dovetails with a standard cancel routine:
VOID CancelRoutine(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
if (DeviceObject->CurrentIrp == Irp)
{
IoReleaseCancelSpinLock(Irp->CancelIrql);
IoStartNextPacket(DeviceObject, TRUE);
}
else
{
KeRemoveEntryDeviceQueue(&DeviceObject->DeviceQueue,
&Irp->Tail.Overlay.DeviceQueueEntry);
IoReleaseCancelSpinLock(Irp->CancelIrql);
}
Irp->IoStatus.Status = STATUS_CANCELLED;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
}
You need to remember that the C language specification requires that
evaluation of boolean operators short circuit when the result is known.
So, if StartIo discovers that the Irp it got as an argument is not the
same as CurrentIrp, it will not attempt to evaulate Irp->Cancel.
Now, as to why this works: StartIo gets called either by IoStartPacket
or IoStartNextPacket. Each of them will grab the cancel spin lock and
set CurrentIrp, then release the spin lock and call StartIo. If someone
should sneak in on another CPU and cancel this very same IRP, your
cancel routine will immediately release the spin lock and call
IoStartNextPacket. One of two things will then happen. IoStartNextPacket
may succeed in getting the cancel spin lock, whereupon it will nullify
the CurrentIrp pointer. If another IRP is on the queue, it will remove
it from the queue, set CurrentIrp to point to this *new* IRP, release
the spin lock, and call StartIo. [You now have two instances of StartIo
running on two different CPUs for two different IRPs, but it's not a
problem because they won't be able to interfere with each other.]
Meanwhile, your original instance of StartIo gets the cancel spin lock
and sees that CurrentIrp is not equal to the IRP pointer it got as an
argument, so it gives up.
The second way this could play out is that StartIo gets the cancel lock
before IoStartNextPacket does. In this case, CurrentIrp is still
pointing to the IRP that's in the process of being cancelled and that
StartIo got as an argument. But this IRP hasn't been completed yet (the
CPU that's running your cancel routine is spinning inside
IoStartNextPacket and therefore hasn't gotten to calling
IoCompleteRequest yet), so no-one will have been able to call IoFreeIrp
to make your pointer invalid.
People may tell you that you should be using your own queues for IRPs so
you can avoid bottlenecking the system on the global cancel spin lock.
That's true enough, but doing it correctly with Plug and Play and Power
management things in the way is gigantically complicated. There's a
sample in the NT 5 beta-2 DDK called CANCEL that shows how to manage
your own queue if you don't worry about PNP and POWER. I hear tell of an
upcoming MSJ article by a Microsoft developer that may solve the
complete problem.
-----
Subject: ANNOUNCE: ALINK v1.5
Date: 16 Nov 1998 16:36:05 GMT
From: anthony_w@my-dejanews.com
Organization: Deja News - The Leader in Internet Discussion
Newsgroups: comp.os.ms-windows.programmer.win32, comp.lang.asm.x86, comp.os.msdos.programmer
ALINK is a freeware linker, creating MSDOS COM and EXE files and Win32 PE EXE
and DLL files from OMF format OBJ and LIB files, win32-COFF format OBJ files,
and win32 RES files.
NEW for version 1.5:
Win32 COFF object file support.
Download it now from my home page.
Anthony
--
anthony_w@geocities.com
http://www.geocities.com/SiliconValley/Network/4311/index.html
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
-----

View File

@@ -1,31 +1,59 @@
* Kernel things implemented [exceptions in brackets]
Spinlocks [Uniprocessor only]
IRQ levels [Not APC_LEVEL or WAKE_LEVEL, uniprocessor only]
ISRs [Partial, uniprocessor only]
Timers [Untested]
DPCs [Untested]
Objects [Partial]
Namespace [Partial]
Handle tables [One process only]
Threads [Some initial work]
RTL list functions [All except sequenced lists]
Zones [Untested]
Memory pool [Working but semantics partially incompatiable]
Device objects [Some but no support for layering]
IRP [Partial]
Memory sections [Partial, no file mappings]
PCI interface [Probes but no support]
CreateFile API [Device only]
ReadFile/WriteFile API [Device only]
MDL functions [Untested]
* Critical path tasks
Test and debug Registry routines
Finish multiple system service table support (HalRegisterServiceTable)
Modify GENNTDLL to generate all needed system service tables
* Kernel things unimplemented (partial)
* These tasks would be nice
Separate HAL into KM DLL
Add support for source level debugging to Bochs
Support for remote debugging
Process managment
Dispatcher objects (Mutex, Semaphore etc)
Investigate user and kernel mode APCs
Asynchronous I/O
Optimization
* Function groups totally or partially unimplemented
Dma functions (see hal/x86/dma.c)
PCI interface functions (see hal/x86/bios32.c, hal/x86/pci.c)
HalExamineMbr
Locale support (see ex/locale.c)
Shutdown support (see ex/power.c)
Zw(Set/Get)SystemInformation (see ex/sysinfo.c)
Adapter functions (see io/adapter.c)
Io cancelation support (see io/cancel, et al)
Directory change notification (see io/dir.c)
Error logging (see io/errlog.c)
Buffer flushing (see io/flush.c)
Io completion ports (see io/iocomp.c)
File locking (see io/lock.c)
Mailslots (see io/mailslot.c)
Named pipes (see io/npipe.c)
Hardware resource management (see io/resource.c)
File access checking (see io/share.c)
APCs to user-mode (see ke/apc.c, ke/apchelp.asm)
Exception support (see ke/catch.c)
Mutex support (see ke/mutex.c)
Semaphore support (see ke/sem.c)
Timer support (see ke/timer.c)
Properly calibrate delay loop (see ke/timer.c)
Waiting for multiple objects (see ke/wait.c)
Single linked lists (see rtl/slist.c)
Sequenced lists (see rtl/seqlist.c)
* Verify implementation
Fast mutexes (see ex/fmutex.c)
* Major areas
Security support (see se/*.c)
Registry support (see cm/*.c)
Paging support
File system cache support
SCSI miniport driver
Network support
Video drivers
USER and GDI modules
* Drivers
NTFS, EXT2 filesystems
Many others (use oem's where possible)
* For the future
DOS, Win16, POSIX subsystems

View File

@@ -1,16 +0,0 @@
subject wstring.zip
author Boudewijn Dekker
date 06-06-98
I wrote some inline wide character string functions. It are modified version
of the ones in string.h. I added four more function nl stricmp, strnicmp,
wcsicmp, and wcsnicmp. These are the case insensitive variants of
strcmp, strncmp and wcscmp, wcsncmp. I tested all the functions but I
would urge anyone to tested again. I removed an extern specifier
__wcstok and strtok cause I it caused an compilation error when
using strtok or wcstok. Please could someone see if this correct.
I also used these string functions in lstring api functions.
Boudewijn Dekker

View File

@@ -0,0 +1,4 @@
base.tmp
junk.tmp
temp.exp

View File

@@ -0,0 +1,290 @@
/* $Id: beep.c,v 1.4 1999/10/16 12:41:42 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: services/dd/beep/beep.c
* PURPOSE: BEEP device driver
* PROGRAMMER: Eric Kohl (ekohl@abo.rhein-zeitung.de)
* UPDATE HISTORY:
* 30/01/99 Created
* 16/10/99 Minor fixes
*/
/* INCLUDES ****************************************************************/
#include <ddk/ntddk.h>
#include <ddk/ntddbeep.h>
#define NDEBUG
#include <internal/debug.h>
/* TYEPEDEFS ***************************************************************/
typedef struct tagBEEP_DEVICE_EXTENSION
{
KDPC Dpc;
KTIMER Timer;
KEVENT Event;
BOOL BeepOn;
} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
/* FUNCTIONS ***************************************************************/
VOID BeepDPC (PKDPC Dpc, PVOID DeferredContext, PVOID SystemArgument1, PVOID SystemArgument2)
{
PDEVICE_EXTENSION DeviceExtension = DeferredContext;
DPRINT ("BeepDPC() called!\n");
HalMakeBeep (0);
DeviceExtension->BeepOn = FALSE;
KeSetEvent (&(DeviceExtension->Event), 0, TRUE);
DPRINT ("BeepDPC() finished!\n");
}
NTSTATUS BeepCreate (PDEVICE_OBJECT DeviceObject, PIRP Irp)
/*
* FUNCTION: Handles user mode requests
* ARGUMENTS:
* DeviceObject = Device for request
* Irp = I/O request packet describing request
* RETURNS: Success or failure
*/
{
PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation(Irp);
NTSTATUS status;
if (Stack->MajorFunction == IRP_MJ_CREATE)
{
DPRINT ("BeepCreate() called!\n");
Irp->IoStatus.Information = 0;
status = STATUS_SUCCESS;
}
else
status = STATUS_NOT_IMPLEMENTED;
Irp->IoStatus.Status = status;
IoCompleteRequest (Irp,IO_NO_INCREMENT);
return (status);
}
NTSTATUS BeepClose(PDEVICE_OBJECT DeviceObject, PIRP Irp)
/*
* FUNCTION: Handles user mode requests
* ARGUMENTS:
* DeviceObject = Device for request
* Irp = I/O request packet describing request
* RETURNS: Success or failure
*/
{
PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation (Irp);
NTSTATUS status;
switch (Stack->MajorFunction)
{
case IRP_MJ_CLOSE:
DPRINT ("BeepClose() called!\n");
Irp->IoStatus.Information = 0;
status = STATUS_SUCCESS;
break;
default:
status = STATUS_NOT_IMPLEMENTED;
}
Irp->IoStatus.Status = status;
IoCompleteRequest (Irp, IO_NO_INCREMENT);
return (status);
}
NTSTATUS BeepCleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp)
/*
* FUNCTION: Handles user mode requests
* ARGUMENTS:
* DeviceObject = Device for request
* Irp = I/O request packet describing request
* RETURNS: Success or failure
*/
{
PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation (Irp);
NTSTATUS status;
if (Stack->MajorFunction == IRP_MJ_CLEANUP)
{
DPRINT ("BeepCleanup() called!\n");
Irp->IoStatus.Information = 0;
status = STATUS_SUCCESS;
}
else
status = STATUS_NOT_IMPLEMENTED;
Irp->IoStatus.Status = status;
IoCompleteRequest (Irp, IO_NO_INCREMENT);
return (status);
}
NTSTATUS BeepDeviceControl (PDEVICE_OBJECT DeviceObject, PIRP Irp)
/*
* FUNCTION: Handles user mode requests
* ARGUMENTS:
* DeviceObject = Device for request
* Irp = I/O request packet describing request
* RETURNS: Success or failure
*/
{
PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation(Irp);
PDEVICE_EXTENSION DeviceExtension;
PBEEP_SET_PARAMETERS pbsp;
NTSTATUS status;
DeviceExtension = DeviceObject->DeviceExtension;
DPRINT ("BeepDeviceControl() called!\n");
if (Stack->Parameters.DeviceIoControl.IoControlCode == IOCTL_BEEP_SET)
{
Irp->IoStatus.Information = 0;
if (Stack->Parameters.DeviceIoControl.InputBufferLength == sizeof(BEEP_SET_PARAMETERS))
{
pbsp = (PBEEP_SET_PARAMETERS)Irp->AssociatedIrp.SystemBuffer;
if (pbsp->Frequency >= BEEP_FREQUENCY_MINIMUM &&
pbsp->Frequency <= BEEP_FREQUENCY_MAXIMUM)
{
LARGE_INTEGER DueTime;
DueTime.QuadPart = 0;
/* do the beep!! */
DPRINT ("Beep:\n Freq: %lu Hz\n Dur: %lu ms\n",
pbsp->Frequency, pbsp->Duration);
if (pbsp->Duration >= 0)
{
DueTime.QuadPart = (LONGLONG)pbsp->Duration * -10000;
KeSetTimer (&DeviceExtension->Timer,
DueTime,
&DeviceExtension->Dpc);
HalMakeBeep (pbsp->Frequency);
DeviceExtension->BeepOn = TRUE;
KeWaitForSingleObject (&(DeviceExtension->Event),
Executive,
KernelMode,
FALSE,
NULL);
}
else if (pbsp->Duration == (DWORD)-1)
{
if (DeviceExtension->BeepOn)
{
HalMakeBeep (0);
DeviceExtension->BeepOn = FALSE;
}
else
{
HalMakeBeep (pbsp->Frequency);
DeviceExtension->BeepOn = TRUE;
}
}
DPRINT ("Did the beep!\n");
status = STATUS_SUCCESS;
}
else
{
status = STATUS_INVALID_PARAMETER;
}
}
else
{
status = STATUS_INVALID_PARAMETER;
}
}
else
{
status = STATUS_NOT_IMPLEMENTED;
}
Irp->IoStatus.Status = status;
IoCompleteRequest (Irp, IO_NO_INCREMENT);
return (status);
}
NTSTATUS BeepUnload(PDRIVER_OBJECT DriverObject)
{
DPRINT ("BeepUnload() called!\n");
return (STATUS_SUCCESS);
}
STDCALL NTSTATUS
DriverEntry (PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
/*
* FUNCTION: Called by the system to initalize the driver
* ARGUMENTS:
* DriverObject = object describing this driver
* RegistryPath = path to our configuration entries
* RETURNS: Success or failure
*/
{
PDEVICE_OBJECT DeviceObject;
PDEVICE_EXTENSION DeviceExtension;
NTSTATUS ret;
ANSI_STRING ansi_device_name;
UNICODE_STRING device_name;
ANSI_STRING asymlink_name;
UNICODE_STRING symlink_name;
DbgPrint ("Beep Device Driver 0.0.2\n");
RtlInitAnsiString (&ansi_device_name, "\\Device\\Beep");
RtlAnsiStringToUnicodeString (&device_name, &ansi_device_name, TRUE);
ret = IoCreateDevice (DriverObject,
sizeof(DEVICE_EXTENSION),
&device_name,
FILE_DEVICE_BEEP,
0,
FALSE,
&DeviceObject);
if (ret!=STATUS_SUCCESS)
{
return (ret);
}
/* prelininary */
RtlInitAnsiString (&asymlink_name, "\\??\\Beep");
RtlAnsiStringToUnicodeString (&symlink_name, &asymlink_name, TRUE);
IoCreateSymbolicLink (&symlink_name, &device_name);
DriverObject->MajorFunction[IRP_MJ_CREATE] = BeepCreate;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = BeepClose;
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = BeepCleanup;
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = BeepDeviceControl;
DriverObject->DriverUnload = BeepUnload;
/* set up device extension */
DeviceExtension = DeviceObject->DeviceExtension;
DeviceExtension->BeepOn = FALSE;
KeInitializeDpc (&(DeviceExtension->Dpc),
BeepDPC,
DeviceExtension);
KeInitializeTimer (&(DeviceExtension->Timer));
KeInitializeEvent (&(DeviceExtension->Event),
SynchronizationEvent,
FALSE);
return (STATUS_SUCCESS);
}
/* EOF */

View File

@@ -0,0 +1,39 @@
#include <defines.h>
#include <reactos/resource.h>
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
VS_VERSION_INFO VERSIONINFO
FILEVERSION RES_UINT_FV_MAJOR,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUILD
PRODUCTVERSION RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUILD
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", RES_STR_COMPANY_NAME
VALUE "FileDescription", "PC Speaker Device Driver\0"
VALUE "FileVersion", "0.0.2\0"
VALUE "InternalName", "beep\0"
VALUE "LegalCopyright", RES_STR_LEGAL_COPYRIGHT
VALUE "OriginalFilename", "beep.sys\0"
VALUE "ProductName", RES_STR_PRODUCT_NAME
VALUE "ProductVersion", RES_STR_PRODUCT_VERSION
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

View File

@@ -0,0 +1,71 @@
# $Id: makefile,v 1.6 1999/12/04 20:58:35 ea Exp $
#
#
TARGET = beep
OBJECTS = beep.o beep.coff ../../../ntoskrnl/ntoskrnl.a
BASE_CFLAGS = -I../../../include
all: beep.sys
.PHONY: all
clean:
- $(RM) beep.o
- $(RM) beep.coff
- $(RM) junk.tmp
- $(RM) base.tmp
- $(RM) temp.exp
- $(RM) beep.sys
.phony: clean
floppy: $(FLOPPY_DIR)/drivers/$(TARGET).sys
$(FLOPPY_DIR)/drivers/$(TARGET).sys: $(TARGET).sys
ifeq ($(DOSCLI),yes)
$(CP) $(TARGET).sys $(FLOPPY_DIR)\drivers\$(TARGET).sys
else
$(CP) $(TARGET).sys $(FLOPPY_DIR)/drivers/$(TARGET).sys
endif
dist: ../../../$(DIST_DIR)/drivers/$(TARGET).sys
../../../$(DIST_DIR)/drivers/$(TARGET).sys: $(TARGET).sys
ifeq ($(DOSCLI),yes)
$(CP) $(TARGET).sys ..\..\..\$(DIST_DIR)\drivers\$(TARGET).sys
else
$(CP) $(TARGET).sys ../../../$(DIST_DIR)/drivers/$(TARGET).sys
endif
beep.sys: $(OBJECTS)
$(CC) \
-specs=../../svc_specs \
-mdll \
-o junk.tmp \
-Wl,--defsym,_end=end \
-Wl,--defsym,_edata=__data_end__ \
-Wl,--defsym,_etext=etext \
-Wl,--base-file,base.tmp \
$(OBJECTS)
- $(RM) junk.tmp
$(DLLTOOL) \
--dllname beep.sys \
--base-file base.tmp \
--output-exp temp.exp \
--kill-at
- $(RM) base.tmp
$(CC) \
--verbose \
-Wl,--image-base,0x10000 \
-Wl,-e,_DriverEntry@8 \
-Wl,temp.exp \
-specs=../../svc_specs \
-mdll \
-o $(TARGET).sys \
$(OBJECTS)
- $(RM) temp.exp
include ../../../rules.mak

View File

@@ -0,0 +1,4 @@
base.tmp
junk.tmp
temp.exp

View File

@@ -0,0 +1,634 @@
/* $Id: blue.c,v 1.19 2000/01/11 17:33:44 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: services/dd/blue/blue.c
* PURPOSE: Console (blue screen) device driver
* PROGRAMMER: Eric Kohl (ekohl@abo.rhein-zeitung.de)
* UPDATE HISTORY:
* ??? Created
*/
/* INCLUDES ******************************************************************/
#include <ddk/ntddk.h>
#include <ddk/ntddblue.h>
#include <string.h>
#include <defines.h>
#define NDEBUG
#include <internal/debug.h>
/* DEFINITIONS ***************************************************************/
#define IDMAP_BASE 0xd0000000
#define VIDMEM_BASE 0xb8000
#define CRTC_COMMAND ((PUCHAR)0x3d4)
#define CRTC_DATA ((PUCHAR)0x3d5)
#define CRTC_COLUMNS 0x01
#define CRTC_OVERFLOW 0x07
#define CRTC_ROWS 0x12
#define CRTC_SCANLINES 0x09
#define CRTC_CURSORSTART 0x0a
#define CRTC_CURSOREND 0x0b
#define CRTC_CURSORPOSHI 0x0e
#define CRTC_CURSORPOSLO 0x0f
#define ATTRC_WRITEREG ((PUCHAR)0x3c0)
#define ATTRC_READREG ((PUCHAR)0x3c1)
#define ATTRC_INPST1 ((PUCHAR)0x3da)
#define TAB_WIDTH 8
/* NOTES ******************************************************************/
/*
* [[character][attribute]][[character][attribute]]....
*/
/* TYPEDEFS ***************************************************************/
typedef struct _DEVICE_EXTENSION
{
PBYTE VideoMemory; /* Pointer to video memory */
DWORD CursorSize;
BOOL CursorVisible;
WORD CharAttribute;
DWORD Mode;
BYTE ScanLines; /* Height of a text line */
WORD Rows; /* Number of rows */
WORD Columns; /* Number of columns */
} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
/* FUNCTIONS **************************************************************/
NTSTATUS
ScrCreate (PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
PDEVICE_EXTENSION DeviceExtension;
NTSTATUS Status;
unsigned int offset;
BYTE data, value;
DeviceExtension = DeviceObject->DeviceExtension;
/* initialize device extension */
/* get pointer to video memory */
/* FIXME : use MmMapIoSpace() */
DeviceExtension->VideoMemory = (PBYTE)(IDMAP_BASE + VIDMEM_BASE);
/* disable interrupts */
__asm__("cli\n\t");
/* get current output position */
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSLO);
offset = READ_PORT_UCHAR (CRTC_DATA);
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSHI);
offset += (READ_PORT_UCHAR (CRTC_DATA) << 8);
/* switch blinking characters off */
READ_PORT_UCHAR (ATTRC_INPST1);
value = READ_PORT_UCHAR (ATTRC_WRITEREG);
WRITE_PORT_UCHAR (ATTRC_WRITEREG, 0x10);
data = READ_PORT_UCHAR (ATTRC_READREG);
data = data & ~0x08;
WRITE_PORT_UCHAR (ATTRC_WRITEREG, data);
WRITE_PORT_UCHAR (ATTRC_WRITEREG, value);
READ_PORT_UCHAR (ATTRC_INPST1);
/* read screen information from crt controller */
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_COLUMNS);
DeviceExtension->Columns = READ_PORT_UCHAR (CRTC_DATA) + 1;
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_ROWS);
DeviceExtension->Rows = READ_PORT_UCHAR (CRTC_DATA);
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_OVERFLOW);
data = READ_PORT_UCHAR (CRTC_DATA);
DeviceExtension->Rows |= (((data & 0x02) << 7) | ((data & 0x40) << 3));
DeviceExtension->Rows++;
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_SCANLINES);
DeviceExtension->ScanLines = (READ_PORT_UCHAR (CRTC_DATA) & 0x1F) + 1;
/* enable interrupts */
__asm__("sti\n\t");
/* calculate number of text rows */
DeviceExtension->Rows =
DeviceExtension->Rows / DeviceExtension->ScanLines;
DPRINT ("%d Columns %d Rows %d Scanlines\n",
DeviceExtension->Columns,
DeviceExtension->Rows,
DeviceExtension->ScanLines);
DeviceExtension->CursorSize = 5; /* FIXME: value correct?? */
DeviceExtension->CursorVisible = TRUE;
/* more initialization */
DeviceExtension->CharAttribute = 0x17; /* light grey on blue */
DeviceExtension->Mode = ENABLE_PROCESSED_OUTPUT |
ENABLE_WRAP_AT_EOL_OUTPUT;
/* show blinking cursor */
__asm__("cli\n\t");
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORSTART);
WRITE_PORT_UCHAR (CRTC_DATA, (DeviceExtension->ScanLines - 1) & 0x1F);
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSOREND);
data = READ_PORT_UCHAR (CRTC_DATA) & 0xE0;
WRITE_PORT_UCHAR (CRTC_DATA,
data | ((DeviceExtension->ScanLines - 1) & 0x1F));
__asm__("sti\n\t");
Status = STATUS_SUCCESS;
Irp->IoStatus.Status = Status;
IoCompleteRequest (Irp, IO_NO_INCREMENT);
return (Status);
}
NTSTATUS
ScrWrite (PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
PIO_STACK_LOCATION stk = IoGetCurrentIrpStackLocation (Irp);
PDEVICE_EXTENSION DeviceExtension;
NTSTATUS Status;
char *pch = Irp->UserBuffer;
char *vidmem;
int i, j, offset;
int cursorx, cursory;
int rows, columns;
DeviceExtension = DeviceObject->DeviceExtension;
vidmem = DeviceExtension->VideoMemory;
rows = DeviceExtension->Rows;
columns = DeviceExtension->Columns;
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSHI);
offset = READ_PORT_UCHAR (CRTC_DATA)<<8;
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSLO);
offset += READ_PORT_UCHAR (CRTC_DATA);
cursory = offset / columns;
cursorx = offset % columns;
for (i = 0; i < stk->Parameters.Write.Length; i++, pch++)
{
switch (*pch)
{
case '\b':
if (cursorx > 0)
{
cursorx--;
}
else if (cursory > 0)
{
cursorx = columns - 1;
cursory--;
}
break;
case '\n':
cursory++;
cursorx = 0;
break;
case '\r':
break;
case '\t':
offset = TAB_WIDTH - (cursorx % TAB_WIDTH);
for (j = 0; j < offset; j++)
{
vidmem[(cursorx * 2) + (cursory * columns * 2)] = ' ';
cursorx++;
if (cursorx >= columns)
{
cursory++;
cursorx = 0;
}
}
break;
default:
vidmem[(cursorx * 2) + (cursory * columns * 2)] = *pch;
vidmem[(cursorx * 2) + (cursory * columns * 2) + 1] = (char) DeviceExtension->CharAttribute;
cursorx++;
if (cursorx >= columns)
{
cursory++;
cursorx = 0;
}
break;
}
if (cursory >= rows)
{
unsigned short *LinePtr;
memcpy (vidmem,
&vidmem[columns * 2],
columns * (rows - 1) * 2);
LinePtr = (unsigned short *) &vidmem[columns * (rows - 1) * 2];
for (j = 0; j < columns; j++)
{
LinePtr[j] = DeviceExtension->CharAttribute << 8;
}
cursory = rows - 1;
for (j = 0; j < columns; j++)
{
vidmem[(j * 2) + (cursory * columns * 2)] = ' ';
vidmem[(j * 2) + (cursory * columns * 2) + 1] = (char)DeviceExtension->CharAttribute;
}
}
}
/* Set the cursor position */
offset = (cursory * columns) + cursorx;
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSLO);
WRITE_PORT_UCHAR (CRTC_DATA, offset);
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSHI);
offset >>= 8;
WRITE_PORT_UCHAR (CRTC_DATA, offset);
Status = STATUS_SUCCESS;
Irp->IoStatus.Status = Status;
IoCompleteRequest (Irp, IO_NO_INCREMENT);
return (Status);
}
NTSTATUS
ScrIoControl (PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
PIO_STACK_LOCATION stk = IoGetCurrentIrpStackLocation (Irp);
PDEVICE_EXTENSION DeviceExtension;
NTSTATUS Status;
DeviceExtension = DeviceObject->DeviceExtension;
switch (stk->Parameters.DeviceIoControl.IoControlCode)
{
case IOCTL_CONSOLE_GET_SCREEN_BUFFER_INFO:
{
PCONSOLE_SCREEN_BUFFER_INFO pcsbi = (PCONSOLE_SCREEN_BUFFER_INFO)Irp->AssociatedIrp.SystemBuffer;
int rows = DeviceExtension->Rows;
int columns = DeviceExtension->Columns;
unsigned int offset;
/* read cursor position from crtc */
__asm__("cli\n\t");
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSLO);
offset = READ_PORT_UCHAR (CRTC_DATA);
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSHI);
offset += (READ_PORT_UCHAR (CRTC_DATA) << 8);
__asm__("sti\n\t");
pcsbi->dwSize.X = rows;
pcsbi->dwSize.Y = columns;
pcsbi->dwCursorPosition.X = (SHORT)(offset % columns);
pcsbi->dwCursorPosition.Y = (SHORT)(offset / columns);
pcsbi->wAttributes = DeviceExtension->CharAttribute;
pcsbi->srWindow.Left = 0;
pcsbi->srWindow.Right = columns - 1;
pcsbi->srWindow.Top = 0;
pcsbi->srWindow.Bottom = rows - 1;
pcsbi->dwMaximumWindowSize.X = columns;
pcsbi->dwMaximumWindowSize.Y = rows;
Irp->IoStatus.Information = sizeof (CONSOLE_SCREEN_BUFFER_INFO);
Status = STATUS_SUCCESS;
}
break;
case IOCTL_CONSOLE_SET_SCREEN_BUFFER_INFO:
{
PCONSOLE_SCREEN_BUFFER_INFO pcsbi = (PCONSOLE_SCREEN_BUFFER_INFO)Irp->AssociatedIrp.SystemBuffer;
unsigned int offset;
DeviceExtension->CharAttribute = pcsbi->wAttributes;
offset = (pcsbi->dwCursorPosition.Y * DeviceExtension->Columns) +
pcsbi->dwCursorPosition.X;
__asm__("cli\n\t");
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSLO);
WRITE_PORT_UCHAR (CRTC_DATA, offset);
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSHI);
WRITE_PORT_UCHAR (CRTC_DATA, offset>>8);
__asm__("sti\n\t");
Irp->IoStatus.Information = 0;
Status = STATUS_SUCCESS;
}
break;
case IOCTL_CONSOLE_GET_CURSOR_INFO:
{
PCONSOLE_CURSOR_INFO pcci = (PCONSOLE_CURSOR_INFO)Irp->AssociatedIrp.SystemBuffer;
pcci->dwSize = DeviceExtension->CursorSize;
pcci->bVisible = DeviceExtension->CursorVisible;
Irp->IoStatus.Information = sizeof (CONSOLE_CURSOR_INFO);
Status = STATUS_SUCCESS;
}
break;
case IOCTL_CONSOLE_SET_CURSOR_INFO:
{
PCONSOLE_CURSOR_INFO pcci = (PCONSOLE_CURSOR_INFO)Irp->AssociatedIrp.SystemBuffer;
BYTE data, value;
DWORD size, height;
DeviceExtension->CursorSize = pcci->dwSize;
DeviceExtension->CursorVisible = pcci->bVisible;
height = DeviceExtension->ScanLines;
data = (pcci->bVisible) ? 0x40 : 0x20;
size = (pcci->dwSize * height) / 100;
if (size < 1)
size = 1;
data |= (BYTE)(height - size);
__asm__("cli\n\t");
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORSTART);
WRITE_PORT_UCHAR (CRTC_DATA, data);
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSOREND);
value = READ_PORT_UCHAR (CRTC_DATA) & 0xE0;
WRITE_PORT_UCHAR (CRTC_DATA, value | (height - 1));
__asm__("sti\n\t");
Irp->IoStatus.Information = 0;
Status = STATUS_SUCCESS;
}
break;
case IOCTL_CONSOLE_GET_MODE:
{
PCONSOLE_MODE pcm = (PCONSOLE_MODE)Irp->AssociatedIrp.SystemBuffer;
pcm->dwMode = DeviceExtension->Mode;
Irp->IoStatus.Information = sizeof(CONSOLE_MODE);
Status = STATUS_SUCCESS;
}
break;
case IOCTL_CONSOLE_SET_MODE:
{
PCONSOLE_MODE pcm = (PCONSOLE_MODE)Irp->AssociatedIrp.SystemBuffer;
DeviceExtension->Mode = pcm->dwMode;
Irp->IoStatus.Information = 0;
Status = STATUS_SUCCESS;
}
break;
case IOCTL_CONSOLE_FILL_OUTPUT_ATTRIBUTE:
{
POUTPUT_ATTRIBUTE Buf = (POUTPUT_ATTRIBUTE)Irp->AssociatedIrp.SystemBuffer;
char *vidmem;
int offset;
DWORD dwCount;
vidmem = DeviceExtension->VideoMemory;
offset = (Buf->dwCoord.Y * DeviceExtension->Columns * 2) +
(Buf->dwCoord.X * 2) + 1;
for (dwCount = 0; dwCount < Buf->nLength; dwCount++)
{
vidmem[offset + (dwCount * 2)] = (char) Buf->wAttribute;
}
Buf->dwTransfered = Buf->nLength;
Irp->IoStatus.Information = 0;
Status = STATUS_SUCCESS;
}
break;
case IOCTL_CONSOLE_READ_OUTPUT_ATTRIBUTE:
{
POUTPUT_ATTRIBUTE Buf = (POUTPUT_ATTRIBUTE)Irp->AssociatedIrp.SystemBuffer;
LPWORD pAttr = (LPWORD)MmGetSystemAddressForMdl(Irp->MdlAddress);
char *vidmem;
int offset;
DWORD dwCount;
vidmem = DeviceExtension->VideoMemory;
offset = (Buf->dwCoord.Y * DeviceExtension->Columns * 2) +
(Buf->dwCoord.X * 2) + 1;
for (dwCount = 0; dwCount < stk->Parameters.Write.Length; dwCount++, pAttr++)
{
(char) *pAttr = vidmem[offset + (dwCount * 2)];
}
Buf->dwTransfered = dwCount;
Irp->IoStatus.Information = sizeof(OUTPUT_ATTRIBUTE);
Status = STATUS_SUCCESS;
}
break;
case IOCTL_CONSOLE_WRITE_OUTPUT_ATTRIBUTE:
{
POUTPUT_ATTRIBUTE Buf = (POUTPUT_ATTRIBUTE)Irp->AssociatedIrp.SystemBuffer;
LPWORD pAttr = (LPWORD)MmGetSystemAddressForMdl(Irp->MdlAddress);
char *vidmem;
int offset;
DWORD dwCount;
vidmem = DeviceExtension->VideoMemory;
offset = (Buf->dwCoord.Y * DeviceExtension->Columns * 2) +
(Buf->dwCoord.X * 2) + 1;
for (dwCount = 0; dwCount < stk->Parameters.Write.Length; dwCount++, pAttr++)
{
vidmem[offset + (dwCount * 2)] = (char) *pAttr;
}
Buf->dwTransfered = dwCount;
Irp->IoStatus.Information = sizeof(OUTPUT_ATTRIBUTE);
Status = STATUS_SUCCESS;
}
break;
case IOCTL_CONSOLE_SET_TEXT_ATTRIBUTE:
DeviceExtension->CharAttribute = (WORD)*(LPWORD)Irp->AssociatedIrp.SystemBuffer;
Irp->IoStatus.Information = 0;
Status = STATUS_SUCCESS;
break;
case IOCTL_CONSOLE_FILL_OUTPUT_CHARACTER:
{
POUTPUT_CHARACTER Buf = (POUTPUT_CHARACTER)Irp->AssociatedIrp.SystemBuffer;
char *vidmem;
int offset;
DWORD dwCount;
vidmem = DeviceExtension->VideoMemory;
offset = (Buf->dwCoord.Y * DeviceExtension->Columns * 2) +
(Buf->dwCoord.X * 2);
CHECKPOINT
for (dwCount = 0; dwCount < Buf->nLength; dwCount++)
{
vidmem[offset + (dwCount * 2)] = (char) Buf->cCharacter;
}
Buf->dwTransfered = Buf->nLength;
Irp->IoStatus.Information = 0;
Status = STATUS_SUCCESS;
}
break;
case IOCTL_CONSOLE_READ_OUTPUT_CHARACTER:
{
POUTPUT_CHARACTER Buf = (POUTPUT_CHARACTER)Irp->AssociatedIrp.SystemBuffer;
LPSTR pChar = (LPSTR)MmGetSystemAddressForMdl(Irp->MdlAddress);
char *vidmem;
int offset;
DWORD dwCount;
vidmem = DeviceExtension->VideoMemory;
offset = (Buf->dwCoord.Y * DeviceExtension->Columns * 2) +
(Buf->dwCoord.X * 2);
for (dwCount = 0; dwCount < stk->Parameters.Write.Length; dwCount++, pChar++)
{
*pChar = vidmem[offset + (dwCount * 2)];
}
Buf->dwTransfered = dwCount;
Irp->IoStatus.Information = sizeof(OUTPUT_ATTRIBUTE);
Status = STATUS_SUCCESS;
}
break;
case IOCTL_CONSOLE_WRITE_OUTPUT_CHARACTER:
{
POUTPUT_CHARACTER Buf = (POUTPUT_CHARACTER)Irp->AssociatedIrp.SystemBuffer;
LPSTR pChar = (LPSTR)MmGetSystemAddressForMdl(Irp->MdlAddress);
char *vidmem;
int offset;
DWORD dwCount;
vidmem = DeviceExtension->VideoMemory;
offset = (Buf->dwCoord.Y * DeviceExtension->Columns * 2) +
(Buf->dwCoord.X * 2) + 1;
for (dwCount = 0; dwCount < stk->Parameters.Write.Length; dwCount++, pChar++)
{
vidmem[offset + (dwCount * 2)] = (char) *pChar;
}
Buf->dwTransfered = dwCount;
Irp->IoStatus.Information = sizeof(OUTPUT_ATTRIBUTE);
Status = STATUS_SUCCESS;
}
break;
default:
Status = STATUS_NOT_IMPLEMENTED;
}
Irp->IoStatus.Status = Status;
IoCompleteRequest (Irp, IO_NO_INCREMENT);
return (Status);
}
NTSTATUS
ScrDispatch (PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
PIO_STACK_LOCATION stk = IoGetCurrentIrpStackLocation(Irp);
NTSTATUS Status;
switch (stk->MajorFunction)
{
case IRP_MJ_CLOSE:
Status = STATUS_SUCCESS;
break;
default:
Status = STATUS_NOT_IMPLEMENTED;
break;
}
Irp->IoStatus.Status = Status;
IoCompleteRequest (Irp, IO_NO_INCREMENT);
return (Status);
}
/*
* Module entry point
*/
NTSTATUS STDCALL
DriverEntry (PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
{
PDEVICE_OBJECT DeviceObject;
ANSI_STRING adevice_name;
UNICODE_STRING device_name;
ANSI_STRING asymlink_name;
UNICODE_STRING symlink_name;
DbgPrint ("Screen Driver 0.0.6\n");
DriverObject->MajorFunction[IRP_MJ_CREATE] = ScrCreate;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = ScrDispatch;
DriverObject->MajorFunction[IRP_MJ_READ] = ScrDispatch;
DriverObject->MajorFunction[IRP_MJ_WRITE] = ScrWrite;
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL ] = ScrIoControl;
RtlInitAnsiString (&adevice_name, "\\Device\\BlueScreen");
RtlAnsiStringToUnicodeString (&device_name, &adevice_name, TRUE);
IoCreateDevice (DriverObject,
sizeof(DEVICE_EXTENSION),
&device_name,
FILE_DEVICE_SCREEN,
0,
TRUE,
&DeviceObject);
RtlInitAnsiString (&asymlink_name, "\\??\\BlueScreen");
RtlAnsiStringToUnicodeString (&symlink_name, &asymlink_name, TRUE);
IoCreateSymbolicLink (&symlink_name, &device_name);
RtlFreeUnicodeString (&device_name);
RtlFreeUnicodeString (&symlink_name);
return (STATUS_SUCCESS);
}
/* EOF */

View File

@@ -0,0 +1,39 @@
#include <defines.h>
#include <reactos/resource.h>
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
VS_VERSION_INFO VERSIONINFO
FILEVERSION RES_UINT_FV_MAJOR,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUILD
PRODUCTVERSION RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUILD
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", RES_STR_COMPANY_NAME
VALUE "FileDescription", "HAL Console Device Driver\0"
VALUE "FileVersion", "0.0.6\0"
VALUE "InternalName", "blue\0"
VALUE "LegalCopyright", RES_STR_LEGAL_COPYRIGHT
VALUE "OriginalFilename", "blue.sys\0"
VALUE "ProductName", RES_STR_PRODUCT_NAME
VALUE "ProductVersion", RES_STR_PRODUCT_VERSION
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

View File

@@ -0,0 +1,70 @@
# $Id: makefile,v 1.10 1999/12/18 10:17:41 ea Exp $
#
#
TARGET = blue
BASE_CFLAGS = -I../../../include
OBJECTS = $(TARGET).o $(TARGET).coff ../../../ntoskrnl/ntoskrnl.a
all: $(TARGET).sys
.phony: all
clean:
- $(RM) $(TARGET).o
- $(RM) $(TARGET).coff
- $(RM) junk.tmp
- $(RM) base.tmp
- $(RM) temp.exp
- $(RM) blue.sys
.phony: clean
floppy: $(FLOPPY_DIR)/drivers/$(TARGET).sys
$(FLOPPY_DIR)/drivers/$(TARGET).sys: $(TARGET).sys
ifeq ($(DOSCLI),yes)
$(CP) $(TARGET).sys $(FLOPPY_DIR)\drivers\$(TARGET).sys
else
$(CP) $(TARGET).sys $(FLOPPY_DIR)/drivers/$(TARGET).sys
endif
dist: ../../../$(DIST_DIR)/drivers/$(TARGET).sys
../../../$(DIST_DIR)/drivers/$(TARGET).sys: $(TARGET).sys
ifeq ($(DOSCLI),yes)
$(CP) $(TARGET).sys ..\..\..\$(DIST_DIR)\drivers\$(TARGET).sys
else
$(CP) $(TARGET).sys ../../../$(DIST_DIR)/drivers/$(TARGET).sys
endif
$(TARGET).sys: $(OBJECTS)
$(CC) \
-specs=../../svc_specs \
-mdll \
-o junk.tmp \
-Wl,--defsym,_end=end \
-Wl,--defsym,_edata=__data_end__ \
-Wl,--defsym,_etext=etext \
-Wl,--base-file,base.tmp $(OBJECTS)
- $(RM) junk.tmp
$(DLLTOOL) \
--dllname $(TARGET).sys \
--base-file base.tmp \
--output-exp temp.exp \
--kill-at
- $(RM) base.tmp
$(CC) \
--verbose \
-Wl,--image-base,0x10000 \
-Wl,-e,_DriverEntry@8 \
-Wl,temp.exp \
-specs=../../svc_specs \
-mdll \
-o $(TARGET).sys \
$(OBJECTS)
- $(RM) temp.exp
include ../../../rules.mak

View File

@@ -0,0 +1,2 @@
DIRS=exe \
sys

View File

@@ -0,0 +1,168 @@
/*++
Copyright (c) 1996 Microsoft Corporation
Module Name:
EventTest.c
Abstract:
Simple console test app demonstrating how a Win32 app can share
an event object with a kernel-mode driver. For more information
on using Event Objects at the application level see the Win32 SDK.
Author:
Jeff Midkiff (jeffmi) 23-Jul-96
Enviroment:
User Mode
Revision History:
--*/
//
// INCLUDES
//
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <winioctl.h>
#include <conio.h>
#include "event.h"
//
// MAIN
//
void __cdecl
main(
int argc,
char ** argv
)
{
BOOL bStatus;
HANDLE hDevice;
ULONG ulReturnedLength;
SET_EVENT setEvent;
FLOAT fDelay;
if ( (argc < 2) || (argv[1] == NULL) ) {
printf("event <delay>\n");
printf("\twhere <delay> = time to delay the event signal in seconds.\n");
exit(0);
}
sscanf( argv[1], "%f", &fDelay );
//
// open the device
//
hDevice = CreateFile(
"\\\\.\\EVENT", // lpFileName
GENERIC_READ | GENERIC_WRITE, // dwDesiredAccess
FILE_SHARE_READ | FILE_SHARE_WRITE, // dwShareMode
NULL, // lpSecurityAttributes
OPEN_EXISTING, // dwCreationDistribution
0, // dwFlagsAndAttributes
NULL // hTemplateFile
);
if (hDevice == INVALID_HANDLE_VALUE) {
printf("CreateFile error = %d\n", GetLastError() );
exit(0);
}
//
// set the event signal delay
//
setEvent.DueTime.QuadPart = -((LONGLONG)(fDelay * 10.0E6));// use relative time for this sample
//
// test the driver for bad event handles
//
setEvent.hEvent = NULL;
bStatus = DeviceIoControl(
hDevice, // Handle to device
IOCTL_SET_EVENT, // IO Control code
&setEvent, // Input Buffer to driver.
SIZEOF_SETEVENT, // Length of input buffer in bytes.
NULL, // Output Buffer from driver.
0, // Length of output buffer in bytes.
&ulReturnedLength, // Bytes placed in buffer.
NULL // synchronous call
);
if ( !bStatus ) {
printf("Bad handle TEST returned code %d.\n\n", GetLastError() );
} else {
printf("we should never get here\n");
exit(0);
}
//
//
//
setEvent.hEvent = CreateEvent(
NULL, // lpEventAttributes
TRUE, // bManualReset
FALSE, // bInitialState
NULL // lpName
);
if ( !setEvent.hEvent ) {
printf("CreateEvent error = %d\n", GetLastError() );
} else {
printf("Event HANDLE = 0x%x\n", setEvent.hEvent );
printf("Press any key to exit.\n");
while( !_kbhit() ) {
bStatus = DeviceIoControl(
hDevice, // Handle to device
IOCTL_SET_EVENT, // IO Control code
&setEvent, // Input Buffer to driver.
SIZEOF_SETEVENT, // Length of input buffer in bytes.
NULL, // Output Buffer from driver.
0, // Length of output buffer in bytes.
&ulReturnedLength, // Bytes placed in buffer.
NULL // synchronous call
);
if ( !bStatus ) {
printf("Ioctl failed with code %d\n", GetLastError() );
break;
} else {
printf("Waiting for Event...\n");
WaitForSingleObject(setEvent.hEvent,
INFINITE );
printf("Event signalled.\n\n");
ResetEvent( setEvent.hEvent);
//printf("Event reset.\n");
}
}
}
//
// close the driver
//
if ( !CloseHandle(hDevice) ) {
printf("Failed to close device.\n");
}
exit(0);
}
// EOF

View File

@@ -0,0 +1,7 @@
#
# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
# file to this component. This file merely indirects to the real make file
# that is shared by all the driver components of the Windows NT DDK
#
!INCLUDE $(NTMAKEENV)\makefile.def

View File

@@ -0,0 +1,10 @@
TARGETNAME=event
TARGETPATH=$(BASEDIR)\lib
TARGETTYPE=PROGRAM
INCLUDES=..\sys
SOURCES=eventtest.c
UMTYPE=console
UMBASE=0x100000

View File

@@ -0,0 +1,50 @@
This sample demonstrates one way that a Windows NT kernel-mode device driver
can share and explicitly signal an Event Object with a Win32 application.
It is composed of two parts, a Windows NT kernel-mode device driver and a Win32
console test application. Both are built using the Windows NT DDK.
Instructions:
-------------
1) Build the driver and test application in either the FREE or CHECKED build environment:
BLD
Both the driver and application are put in %NTDDK%\LIB\*\FREE | CHECKED on your build machine.
2) Copy the newly built driver to your Target machine's %SystemRoot%\system32\drivers
directory. Copy the newly built application to your target machine.
Also copy the EVENT.INI file to your Target machine.
3) Update the Target machine's Registry by running REGINI.EXE on the EVENT.INI file, i.e.:
REGINI EVENT.INI
This adds a driver key under the
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services tree in the Registry.
You can verify this by running REGEDIT32.EXE and looking at the \Event key.
4) Reboot the Target machine for the Registry changes to take effect.
Your driver will not load until you reboot.
5) Load the driver from the command line:
NET START EVENT
6) Run the test app from the command line:
EVENT <DELAY>
where DELAY = time to delay the Event signal in seconds.
7) Unload the driver from the command line:
NET STOP EVENT

View File

@@ -0,0 +1,447 @@
/*++
Copyright (c) 1996 Microsoft Corporation
Module Name:
Event.c
Abstract:
This sample demonstrates one way that a Windows NT kernel-mode driver
can share and explicitly signal an Event Object with a Win32 application.
This sample uses the following method:
The application creates an event object using CreateEvent().
The app passes the event handle to the driver in a private IOCTL.
The driver is running in the app's thread context during the IOCTL so
there is a valid user-mode handle at that time.
The driver dereferences the user-mode handle into system space & saves
the new system handle for later use.
The driver signals the event via KeSetEvent() at IRQL <= DISPATCH_LEVEL.
The driver MUST delete any driver references to the event object at
Unload time.
An alternative method would be to create a named event in the driver via
IoCreateNotificationEvent and then open the event in user mode. This API
however is new to Windows NT 4.0 so you can not use this method in your
NT 3.5x drivers.
Note that this sample's event can be signalled (almost) at will from within
the driver. A different event signal can be set when the driver is setup to
do asynchronous I/O, and it is opened with FILE_FLAG_OVERLAPPED, and an
event handle is passed down in an OVERLAPPED struct from the app's Read,
Write, or DeviceIoControl. This different event signal is set by the I/O
Manager when the driver calls IoCompleteRequest on a pending Irp. This type
of Irp completion signal is not the purpose of this sample, hence the lack of
Irp queing.
Author:
Jeff Midkiff (jeffmi) 23-Jul-96
Enviroment:
Kernel Mode Only
Revision History:
--*/
//
// INCLUDES
//
#include "ntddk.h"
#include "event.h"
//
// DEFINES
//
#define USER_NAME L"\\DosDevices\\EVENT"
#define SYSTEM_NAME L"\\Device\\EVENT"
//
// DATA
//
typedef struct _DEVICE_EXTENSION {
KDPC Dpc;
KTIMER Timer;
HANDLE hEvent;
} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
//
// PROTOS
//
NTSTATUS
DriverEntry(
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath
);
NTSTATUS
Unload(
IN PDRIVER_OBJECT DriverObject
);
NTSTATUS
Dispatch(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
);
VOID
CustomTimerDPC(
IN PKDPC Dpc,
IN PVOID DeferredContext,
IN PVOID SystemArgument1,
IN PVOID SystemArgument2
);
NTSTATUS
DriverEntry(
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath
)
/*++
Routine Description:
This routine gets called by the system to initialize the driver.
Arguments:
DriverObject - the system supplied driver object.
RegistryPath - the system supplied registry path for this driver.
Return Value:
NTSTATUS
--*/
{
PDEVICE_OBJECT pDeviceObject;
PDEVICE_EXTENSION pDeviceExtension;
UNICODE_STRING usSystemName;
UNICODE_STRING usUserName;
NTSTATUS status;
KdPrint(("Event!DriverEntry - IN\n"));
//
// create the device object
//
RtlInitUnicodeString( &usSystemName, SYSTEM_NAME );
status = IoCreateDevice(
DriverObject, // DriverObject
sizeof( DEVICE_EXTENSION ), // DeviceExtensionSize
&usSystemName, // DeviceName
FILE_DEVICE_UNKNOWN, // DeviceType
0, // DeviceCharacteristics
TRUE, // Exclusive
&pDeviceObject // DeviceObject
);
if ( !NT_SUCCESS(status) ) {
KdPrint(("\tIoCreateDevice returned 0x%x\n", status));
return( status );
}
//
// Set up dispatch entry points for the driver.
//
DriverObject->MajorFunction[IRP_MJ_CREATE] =
DriverObject->MajorFunction[IRP_MJ_CLOSE] =
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = Dispatch;
DriverObject->DriverUnload = Unload;
//
// Create a symbolic link into user mode for the driver.
//
RtlInitUnicodeString( &usUserName, USER_NAME );
status = IoCreateSymbolicLink( &usUserName, &usSystemName );
if ( !NT_SUCCESS(status) ) {
IoDeleteDevice( pDeviceObject );
KdPrint(("\tIoCreateSymbolicLink returned 0x%x\n", status));
return( status );
}
//
// establish user-buffer access method
//
pDeviceObject->Flags |= DO_BUFFERED_IO;
//
// setup the device extension
//
pDeviceExtension = pDeviceObject->DeviceExtension;
KeInitializeDpc(
&pDeviceExtension->Dpc, // Dpc
CustomTimerDPC, // DeferredRoutine
pDeviceObject // DeferredContext
);
KeInitializeTimer(
&pDeviceExtension->Timer // Timer
);
pDeviceExtension->hEvent = NULL;
KdPrint(("Event!DriverEntry - OUT\n"));
return( status );
}
NTSTATUS
Unload(
IN PDRIVER_OBJECT DriverObject
)
/*++
Routine Description:
This routine gets called to remove the driver from the system.
Arguments:
DriverObject - the system supplied driver object.
Return Value:
NTSTATUS
--*/
{
PDEVICE_OBJECT pDeviceObject = DriverObject->DeviceObject;
PDEVICE_EXTENSION pDeviceExtension = pDeviceObject->DeviceExtension;
UNICODE_STRING usUserName;
KdPrint(("Event!Unload\n"));
//
// dereference the event object or it will NEVER go away until reboot
//
if ( pDeviceExtension->hEvent )
ObDereferenceObject( pDeviceExtension->hEvent );
// Delete the user-mode symbolic link.
RtlInitUnicodeString( &usUserName, USER_NAME );
IoDeleteSymbolicLink( &usUserName );
// Delete the DeviceObject
IoDeleteDevice( pDeviceObject );
return( STATUS_SUCCESS );
}
NTSTATUS
Dispatch(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
)
/*++
Routine Description:
This device control dispatcher handles IOCTLs.
Arguments:
DeviceObject - Context for the activity.
Irp - The device control argument block.
Return Value:
NTSTATUS
--*/
{
PDEVICE_EXTENSION pDeviceExtension;
PIO_STACK_LOCATION pIrpStack;
PSET_EVENT pSetEvent;
ULONG ulInformation = 0L;
NTSTATUS status = STATUS_NOT_IMPLEMENTED;
KdPrint(("Event!Dispatch - IN\n"));
pDeviceExtension = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension;
pIrpStack = IoGetCurrentIrpStackLocation( Irp );
switch( pIrpStack->MajorFunction )
{
case IRP_MJ_CREATE:
case IRP_MJ_CLOSE:
KdPrint(("\t%s\n", (IRP_MJ_CREATE == pIrpStack->MajorFunction) ? "IRP_MJ_CREATE" : "IRP_MJ_CLOSE"));
status = STATUS_SUCCESS;
break;
case IRP_MJ_DEVICE_CONTROL:
switch( pIrpStack->Parameters.DeviceIoControl.IoControlCode )
{
case IOCTL_SET_EVENT:
KdPrint(("\tIOCTL_SET_EVENT\n"));
if ( pIrpStack->Parameters.DeviceIoControl.InputBufferLength < SIZEOF_SETEVENT ) {
// Parameters are invalid
KdPrint(("\tSTATUS_INVALID_PARAMETER\n"));
status = STATUS_INVALID_PARAMETER;
} else {
pSetEvent = (PSET_EVENT)Irp->AssociatedIrp.SystemBuffer;
KdPrint(("\tuser-mode HANDLE = 0x%x\n", pSetEvent->hEvent ));
status = ObReferenceObjectByHandle( pSetEvent->hEvent,
SYNCHRONIZE,
NULL,
KernelMode,
&pDeviceExtension->hEvent,
NULL
);
if ( !NT_SUCCESS(status) ) {
KdPrint(("\tUnable to reference User-Mode Event object, Error = 0x%x\n", status));
} else {
KdPrint(("\tkernel-mode HANDLE = 0x%x\n", pDeviceExtension->hEvent ));
//
// Start the timer to run the CustomTimerDPC in DueTime seconds to
// simulate an interrupt (which would queue a DPC).
// The user's event object is signaled in the DPC.
//
// ensure relative time for this sample
if ( pSetEvent->DueTime.QuadPart > 0 )
pSetEvent->DueTime.QuadPart = -(pSetEvent->DueTime.QuadPart);
KdPrint(("\tDueTime = %d\n", pSetEvent->DueTime.QuadPart ));
KeSetTimer(
&pDeviceExtension->Timer, // Timer
pSetEvent->DueTime, // DueTime
&pDeviceExtension->Dpc // Dpc
);
status = STATUS_SUCCESS;
}
}
break;
default:
// should never hit this
ASSERT(0);
status = STATUS_NOT_IMPLEMENTED;
break;
} // switch IoControlCode
break;
default:
// should never hit this
ASSERT(0);
status = STATUS_NOT_IMPLEMENTED;
break;
} // switch MajorFunction
//
// complete the Irp
//
Irp->IoStatus.Status = status;
Irp->IoStatus.Information = ulInformation;
IoCompleteRequest( Irp, IO_NO_INCREMENT );
KdPrint(("Event!Dispatch - OUT\n"));
return status;
}
VOID
CustomTimerDPC(
IN PKDPC Dpc,
IN PVOID DeferredContext,
IN PVOID SystemArgument1,
IN PVOID SystemArgument2
)
/*++
Routine Description:
This is the DPC associated with this drivers Timer object setup in DriverEntry.
Arguments:
Dpc - our DPC object associated with our Timer
DeferredContext - Context for the DPC that we setup in DriverEntry
SystemArgument1 -
SystemArgument2 -
Return Value:
Nothing.
--*/
{
PDEVICE_OBJECT pDeviceObject = DeferredContext;
PDEVICE_EXTENSION pDeviceExtension = pDeviceObject->DeviceExtension;
KdPrint(("Event!CustomTimerDPC - IN\n"));
//
// Signal the Event created user-mode
//
// Note:
// Do not call KeSetEvent from your ISR;
// you must call it at IRQL <= DISPATCH_LEVEL.
// Your ISR should queue a DPC and the DPC can
// then call KeSetEvent on the ISR's behalf.
//
KeSetEvent((PKEVENT)pDeviceExtension->hEvent,// Event
0, // Increment
FALSE // Wait
);
// there is no Irp to complete here
KdPrint(("Event!CustomTimerDPC - OUT\n"));
return;
}
// EOF

View File

@@ -0,0 +1,43 @@
/*++
Copyright (c) 1996 Microsoft Corporation
Module Name:
Event.h
Abstract:
Author:
Jeff Midkiff (jeffmi) 23-Jul-96
Enviroment:
Revision History:
--*/
#ifndef __EVENT__
#define __EVENT__
#include "devioctl.h"
typedef struct _SET_EVENT
{
HANDLE hEvent;
LARGE_INTEGER DueTime; // requested DueTime in 100-nanosecond units
} SET_EVENT, *PSET_EVENT;
#define SIZEOF_SETEVENT sizeof(SET_EVENT)
#define IOCTL_SET_EVENT \
CTL_CODE( FILE_DEVICE_UNKNOWN, 0x800, METHOD_BUFFERED, FILE_ANY_ACCESS )
#endif // __EVENT__

View File

@@ -0,0 +1,7 @@
; note - the service name matches the driver's file (.sys) name
\Registry\Machine\System\CurrentControlSet\Services\Event
Type = REG_DWORD 0x00000001
Start = REG_DWORD 0x00000003
Group = Extended Base
ErrorControl = REG_DWORD 0x00000001

View File

@@ -0,0 +1,11 @@
#include <windows.h>
#include <ntverp.h>
#define VER_FILETYPE VFT_DRV
#define VER_FILESUBTYPE VFT2_DRV_SYSTEM
#define VER_FILEDESCRIPTION_STR "Sample Event Driver"
#define VER_INTERNALNAME_STR "event.sys"
#include "common.ver"

View File

@@ -0,0 +1,7 @@
#
# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
# file to this component. This file merely indirects to the real make file
# that is shared by all the driver components of the Windows NT DDK
#
!INCLUDE $(NTMAKEENV)\makefile.def

View File

@@ -0,0 +1,6 @@
TARGETNAME=event
TARGETPATH=$(BASEDIR)\lib
TARGETTYPE=DRIVER
SOURCES=event.c \
event.rc

View File

@@ -0,0 +1,444 @@
//
// FLOPPY.C - NEC-765/8272A floppy device driver
// written by Rex Jolliff
// with help from various other sources, including but not limited to:
// Art Baker's NT Device Driver Book, Linux Source, and the internet.
//
// Modification History:
// 08/19/98 RJJ Created.
//
// To do:
// FIXME: get it working
// FIXME: add support for DMA hardware
// FIXME: should add support for floppy tape/zip devices
#include <ddk/ntddk.h>
#include "floppy.h"
#define VERSION "V0.0.1"
// --------------------------------------------------- File Statics
typedef struct _FLOPPY_CONTROLLER_PARAMETERS
{
int PortBase;
int Vector;
int IrqL;
int SynchronizeIrqL;
KINTERRUPT_MODE InterruptMode;
KAFFINITY Affinity;
} FLOPPY_CONTROLLER_PARAMETERS, *PFLOPPY_CONTROLLER_PARAMETERS;
#define FLOPPY_MAX_CONTROLLERS 2
FLOPPY_CONTROLLER_PARAMETERS ControllerParameters[FLOPPY_MAX_CONTROLLERS] =
{
{0x03f0, 6, 6, 6, LevelSensitive, 0xffff},
{0x0370, 6, 6, 6, LevelSensitive, 0xffff},
};
FLOPPY_DEVICE_PARAMETERS DeviceTypes[] =
{
/* Unknown */
{0, 500, 16, 16, 8000, 1000, 3000, 0, 20, 5, 80, 3000, 20, {3,1,2,0,2}, 0, 0, { 7, 4, 8, 2, 1, 5, 3,10}, 1500, 0, "unknown"},
/* 5 1/4 360 KB PC*/
{1, 300, 16, 16, 8000, 1000, 3000, 0, 20, 5, 40, 3000, 17, {3,1,2,0,2}, 0, 0, { 1, 0, 0, 0, 0, 0, 0, 0}, 1500, 1, "360K PC"},
/* 5 1/4 HD AT*/
{2, 500, 16, 16, 6000, 400, 3000, 14, 20, 6, 83, 3000, 17, {3,1,2,0,2}, 0, 0, { 2, 5, 6,23,10,20,11, 0}, 1500, 2, "1.2M"},
/* 3 1/2 DD*/
{3, 250, 16, 16, 3000, 1000, 3000, 0, 20, 5, 83, 3000, 20, {3,1,2,0,2}, 0, 0, { 4,22,21,30, 3, 0, 0, 0}, 1500, 4, "720k"},
/* 3 1/2 HD*/
{4, 500, 16, 16, 4000, 400, 3000, 10, 20, 5, 83, 3000, 20, {3,1,2,0,2}, 0, 0, { 7, 4,25,22,31,21,29,11}, 1500, 7, "1.44M"},
/* 3 1/2 ED*/
{5, 1000, 15, 8, 3000, 400, 3000, 10, 20, 5, 83, 3000, 40, {3,1,2,0,2}, 0, 0, { 7, 8, 4,25,28,22,31,21}, 1500, 8, "2.88M AMI BIOS"},
/* 3 1/2 ED*/
{6, 1000, 15, 8, 3000, 400, 3000, 10, 20, 5, 83, 3000, 40, {3,1,2,0,2}, 0, 0, { 7, 8, 4,25,28,22,31,21}, 1500, 8, "2.88M"}
};
static BOOLEAN FloppyInitialized = FALSE;
// ------------------------------------------------------ Functions
// ModuleEntry
//
// DESCRIPTION:
// This function initializes the driver, locates and claims
// hardware resources, and creates various NT objects needed
// to process I/O requests.
//
// RUN LEVEL:
// PASSIVE_LEVEL
//
// ARGUMENTS:
// IN PDRIVER_OBJECT DriverObject System allocated Driver Object
// for this driver
// IN PUNICODE_STRING RegistryPath Name of registry driver service
// key
//
// RETURNS:
// NTSTATUS
NTSTATUS
DriverEntry(IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath)
{
NTSTATUS RC;
PFLOPPY_DEVICE_EXTENSION DeviceExtension;
// Export other driver entry points...
DriverObject->DriverStartIo = FloppyStartIo;
DriverObject->MajorFunction[IRP_MJ_CREATE] = FloppyDispatchOpenClose;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = FloppyDispatchOpenClose;
DriverObject->MajorFunction[IRP_MJ_READ] = FloppyDispatchReadWrite;
DriverObject->MajorFunction[IRP_MJ_WRITE] = FloppyDispatchReadWrite;
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = FloppyDispatchDeviceControl;
// Try to detect controller and abort if it fails
if (!FloppyCreateController(DriverObject,
&ControllerParameters[0],
0))
{
DPRINT("Could not find floppy controller");
return STATUS_NO_SUCH_DEVICE;
}
return STATUS_SUCCESS;
}
static BOOLEAN
FloppyCreateController(PDRIVER_OBJECT DriverObject,
PFLOPPY_CONTROLLER_PARAMETERS ControllerParameters,
int Index)
{
PFLOPPY_CONTROLLER_TYPE ControllerType;
PCONTROLLER_OBJECT ControllerObject;
PFLOPPY_CONTROLLER_EXTENSION ControllerExtension;
/* Detect controller and determine type */
if (!FloppyGetControllerVersion(ControllerParameters, &ControllerType))
{
return FALSE;
}
// FIXME: Register port ranges and interrupts with HAL
/* Create controller object for FDC */
ControllerObject = IoCreateController(sizeof(FLOPPY_CONTROLLER_EXTENSION));
if (ControllerObject == NULL)
{
DPRINT("Could not create controller object for controller %d\n",
Index);
return FALSE;
}
// FIXME: fill out controller data
ControllerExtension = (PFLOPPY_CONTROLLER_EXTENSION)
ControllerObject->ControllerExtension;
ControllerExtension->Number = Index;
ControllerExtension->PortBase = ControllerParameters->PortBase;
ControllerExtension->Vector = ControllerParameters->Vector;
ControllerExtension->FDCType = ControllerType;
/* Initialize the spin lock in the controller extension */
KeInitializeSpinLock(&ControllerExtension->SpinLock);
/* Register an interrupt handler for this controller */
RC = IoConnectInterrupt(&ControllerExtension->Interrupt,
FloppyIsr,
ControllerExtension,
&ControllerExtension->SpinLock,
ControllerExtension->Vector,
ControllerParameters->IrqL,
ControllerParameters->SynchronizeIrqL,
ControllerParameters->InterruptMode,
FALSE,
ControllerParameters->Affinity,
FALSE);
if (!NT_SUCCESS(RC))
{
DPRINT("Could not Connect Interrupt %d\n", ControllerExtension->Vector);
IoDeleteController(ControllerObject);
return FALSE;
}
// FIXME: setup DMA stuff for controller
// Check for each possible drive and create devices for them
for (DriveIdx = 0; DriveIdx < FLOPPY_MAX_DRIVES; DriveIdx++)
{
// FIXME: try to identify the drive
// FIXME: create a device if it's there
}
return STATUS_SUCCESS;
}
// FloppyGetControllerVersion
//
// DESCRIPTION
// Get the type/version of the floppy controller
//
// RUN LEVEL:
// PASSIVE_LEVEL
//
// ARGUMENTS:
// IN OUT PFLOPPY_DEVICE_EXTENSION DeviceExtension
//
// RETURNS:
// BOOL success or failure
//
// COMMENTS:
// This routine (get_fdc_version) was originally written by David C. Niemi
//
static BOOLEAN
FloppyGetControllerVersion(IN PFLOPPY_CONTROLLER_PARAMETERS ControllerParameters,
OUT PFLOPPY_CONTROLLER_TYPE ControllerType)
{
BYTE ResultReturned
BYTE Result[FLOPPY_MAX_REPLIES];
int ResultLength;
/* 82072 and better know DUMPREGS */
if (!FloppyWriteCommandByte(ControllerParameters->PortBase,
FLOPPY_CMD_DUMP_FDC))
{
return FALSE;
}
ResultLength = FloppyReadResultCode(PortBase, &Result));
if (ResultLength < 0)
{
return FALSE;
}
/* 8272a/765 don't know DUMPREGS */
if ((ResultLength == 1) && (Result[0] == 0x80))
{
DPRINT("FDC %d is an 8272A\n", PortBase);
*ControllerType = FDC_8272A;
return TRUE;
}
if (r != 10)
{
DPRINT("FDC %d init: DUMP_FDC: unexpected return of %d bytes.\n",
PortBase,
ResultLength);
return FALSE;
}
if (!FloppyConfigure(PortBase, FALSE, 0x0a))
{
DPRINT("FDC %d is an 82072\n", PortBase);
*ControllerType = FDC_82072;
return TRUE;
}
FloppyWriteCommandByte(PortBase, FLOPPY_CMD_PPND_RW);
if (FloppyNeedsMoreOutput(PortBase, Result) == FLOPPY_NEEDS_OUTPUT)
{
FloppyWriteCommandByte(PortBase, 0);
}
else
{
DPRINT("FDC %d is an 82072A\n", PortBase);
*ControllerType = FDC_82072A;
return TRUE;
}
/* Pre-1991 82077, doesn't know LOCK/UNLOCK */
FloppyWriteCommandByte(PortBase, FLOPPY_CMD_UNLK_FIFO);
ResultLength = FloppyReadResultCode(PortBase, &Result));
if ((ResultLength == 1) && (Result[0] == 0x80))
{
DPRINT("FDC %d is a pre-1991 82077\n", PortBase);
*ControllerType = FDC_82077_ORIG;
return TRUE;
}
if ((ResultLength != 1) || (Result[0] != 0x00))
{
DPRINT("FDC %d init: UNLOCK: unexpected return of %d bytes.\n",
PortBase,
ResultLength);
return FALSE;
}
/* Revised 82077AA passes all the tests */
FloppyWriteCommandByte(PortBase, FLOPPY_CMD_PARTID);
ResultLength = FloppyReadResultCode(PortBase, &Result));
if (ResultLength != 1)
{
DPRINT("FDC %d init: PARTID: unexpected return of %d bytes.\n",
PortBase,
ResultLength);
return FALSE;
}
if (Result[0] == 0x80)
{
DPRINT("FDC %d is a post-1991 82077\n", PortBase);
*ControllerType = FDC_82077;
return TRUE;
}
switch (Result[0] >> 5)
{
case 0x0:
/* Either a 82078-1 or a 82078SL running at 5Volt */
DPRINT("FDC %d is an 82078.\n", PortBase);
*ControllerType = FDC_82078;
return TRUE;
case 0x1:
DPRINT("FDC %d is a 44pin 82078\n", PortBase);
*ControllerType = FDC_82078;
return TRUE;
case 0x2:
DPRINT("FDC %d is a S82078B\n", PortBase);
*ControllerType = FDC_S82078B;
return TRUE;
case 0x3:
DPRINT("FDC %d is a National Semiconductor PC87306\n", PortBase);
*ControllerType = FDC_87306;
return TRUE;
default:
DPRINT("FDC %d init: 82078 variant with unknown PARTID=%d.\n",
PortBase,
Result[0] >> 5);
*ControllerType = FDC_82078_UNKN;
return TRUE;
}
}
/* sends a command byte to the fdc */
static BOOLEAN
FloppyWriteCommandByte(WORD PortBase, BYTE Byte)
{
int Status;
if ((Status = FloppyWaitUntilReady()) < 0)
{
return FALSE;
}
if ((Status & (STATUS_READY|STATUS_DIR|STATUS_DMA)) == STATUS_READY)
{
FloppyWriteData(PortBase, Byte);
return 0;
}
if (FloppyInitialized)
{
DPRINT("Unable to send byte %x to FDC. Fdc=%x Status=%x\n",
Byte,
PortBase,
Status);
}
return FALSE;
}
/* gets the response from the fdc */
static int
FloppyReadResultCode(WORD PortBase, PBYTE Result)
{
int Replies;
int Status;
for (Replies = 0; Replies < FLOPPY_MAX_REPLIES; Replies++)
{
if ((Status = FloppyWaitUntilReady(PortBase)) < 0)
{
break;
}
Status &= STATUS_DIR | STATUS_READY | STATUS_BUSY | STATUS_DMA;
if ((Status & ~STATUS_BUSY) == STATUS_READY)
{
return Replies;
}
if (Status == (STATUS_DIR | STATUS_READY | STATUS_BUSY))
{
Result[Replies] = fd_inb(FD_DATA);
}
else
{
break;
}
}
if (FloppyInitialized)
{
DPRINT("get result error. Fdc=%d Last status=%x Read bytes=%d\n",
PortBase,
Status,
Replies);
}
return -1;
}
/* waits until the fdc becomes ready */
static int
FloppyWaitUntilReady(WORD PortBase)
{
int Retries;
int Status;
for (Retries = 0; Retries < FLOPPY_MAX_STAT_RETRIES; Retries++)
{
status = FloppyReadSTAT(PortBase);
if (Status & STATUS_READY)
{
return Status;
}
}
if (FloppyInitialized)
{
DPRINT("Getstatus times out (%x) on fdc %d\n",
Status,
PortBase);
}
return -1;
}
#define MORE_OUTPUT -2
/* does the fdc need more output? */
static int
FloppyNeedsMoreOutput(WORD PortBase, PBYTE Result)
{
int Status;
if ((Status = FloppyWaitUntilReady(PortBase)) < 0)
return -1;
if ((Status & (STATUS_READY | STATUS_DIR | STATUS_DMA)) == STATUS_READY)
{
return FLOPPY_NEEDS_OUTPUT;
}
return FloppyReadResultCode(PortBase, Result);
}
static BOOLEAN
FloppyConfigure(WORD PortBase, BOOLEAN DisableFIFO, BYTE FIFODepth)
{
BYTE Result[FLOPPY_MAX_REPLIES];
/* Turn on FIFO */
FloppyWriteCommandByte(FLOPPY_CMD_CFG_FIFO);
if (FloppyNeedsOutput(PortBase, Result) != FLOPPY_NEEDS_OUTPUT)
{
return FALSE;
}
FloppyWriteCommandByte(PortBase, 0);
FloppyWriteCommandByte(PortBase,
0x10 |
(DisableFIFO ? 0x20 : 0x00) |
(FIFODepth & 0x0f));
/* pre-compensation from track 0 upwards */
FloppyWriteCommandByte(PortBase, 0);
return TRUE;
}

View File

@@ -0,0 +1,158 @@
#define FLOPPY_MAX_STAT_RETRIES 10000
#define FLOPPY_NEEDS_OUTPUT -2
//
// Floppy register definitions
//
#define FLOPPY_REG_DOR 0x0002
#define FLOPPY_REG_MSTAT 0x0004
#define FLOPPY_MS_DRV0BUSY 0x01
#define FLOPPY_MS_DRV1BUSY 0x02
#define FLOPPY_MS_DRV2BUSY 0x04
#define FLOPPY_MS_DRV3BUSY 0x08
#define FLOPPY_MS_FDCBUSY 0x10
#define FLOPPY_MS_DMAMODE 0x20
#define FLOPPY_MS_DATADIR 0x40
#define FLOPPY_MS_DATARDY 0x80
#define FLOPPY_REG_DATA 0x0005
#define FLOPPY_REG_DIR 0x0007 /* READ ONLY */
#define FLOPPY_DI_DSKCHNG 0x80
#define FLOPPY_REG_CCNTL 0x0007 /* WRITE ONLY */
#define FLOPPY_CMD_RD_TRK 0x02
#define FLOPPY_CMD_SPEC_CHARS 0x03
#define FLOPPY_CSC_SRT_SHIFT 4
#define FLOPPY_CSC_HUT_MASK 0x0f
#define FLOPPY_CSC_HLT_SHIFT 1
#define FLOPPY_CSC_NON_DMA 0x01
#define FLOPPY_CMD_SNS_DRV 0x04
#define FLOPPY_CMD_WRT_DATA 0x05
#define FLOPPY_CMD_RD_DATA 0x06
#define FLOPPY_CMD_RECAL 0x07
#define FLOPPY_CMD_SNS_INTR 0x08
#define FLOPPY_CSI_IC_MASK 0xe0
#define FLOPPY_CSI_IC_RDYCH 0x60
#define FLOPPY_CSI_IC_SEEKGD 0x80
#define FLOPPY_CSI_IC_SEEKBD 0xc0
#define FLOPPY_CMD_WRT_DEL 0x09
#define FLOPPY_CMD_RD_ID 0x0a
#define FLOPPY_CMD_RD_DEL 0x0c
#define FLOPPY_CMD_FMT_TRK 0x0d
#define FLOPPY_CMD_DUMP_FDC 0x0e
#define FLOPPY_CMD_SEEK 0x0f
#define FLOPPY_CMD_VERSION 0x10
#define FLOPPY_CMD_SCN_EQ 0x11
#define FLOPPY_CMD_PPND_RW 0x12
#define FLOPPY_CMD_CFG_FIFO 0x13
#define FLOPPY_CMD_LCK_FIFO 0x14
#define FLOPPY_CMD_PARTID 0x18
#define FLOPPY_CMD_SCN_LE 0x19
#define FLOPPY_CMD_SCN_GE 0x1d
#define FLOPPY_CMD_CFG_PWR 0x27
#define FLOPPY_CMD_SAVE_FDC 0x2e
#define FLOPPY_CMD_FMT_ISO 0x33
#define FLOPPY_CMD_DMA_READ 0x46
#define FLOPPY_CMD_DMA_WRT 0x4a
#define FLOPPY_CMD_REST_FDC 0x4e
#define FLOPPY_CMD_DRV_SPEC 0x8e
#define FLOPPY_CMD_RSEEK_OUT 0x8f
#define FLOPPY_CMD_ULK_FIFO 0x94
#define FLOPPY_CMD_RSEEK_IN 0xcf
#define FLOPPY_CMD_FMT_WRT 0xef
// Command Code modifiers
#define FLOPPY_C0M_SK 0x20
#define FLOPPY_C0M_MFM 0x40
#define FLOPPY_C0M_MT 0x80
#define FLOPPY_C1M_DRVMASK 0x03
#define FLOPPY_C1M_HEAD1 0x04
// Status code values and masks
#define FLOPPY_ST0_INVALID 0x80
// useful command defines
#define FLOPPY_CMD_READ (FLOPPY_CMD_RD_DATA | FLOPPY_C0M_SK | FLOPPY_C0M_MFM | FLOPPY_C0M_MT)
#define FLOPPY_CMD_WRITE (FLOPPY_CMD_WRT_DATA | FLOPPY_C0M_MFM | FLOPPY_C0M_MT)
#define FLOPPY_CMD_FORMAT (FLOPPY_CMD_FMT_TRK | FLOPPY_C0M_MFM)
//
// HAL floppy register access commands
//
#define FloppyWriteDOR(A, V) (WRITE_BYTE((A) + FLOPPY_REG_DOR, (V)))
#define FloppyReadMSTAT(A) (READ_BYTE((A) + FLOPPY_REG_MSTAT))
#define FloppyReadDATA(A) (READ_BYTE((A) + FLOPPY_REG_DATA))
#define FloppyWriteDATA(A, V) (WRITE_BYTE((A) + FLOPPY_REG_DATA, (V)))
#define FloppyReadDIR(A) (READ_BYTE((A) + FLOPPY_REG_DIR))
#define FloppyWriteCCNTL(A, V) (WRITE_BYTE((A) + FLOPPY_REG_CCNTL, (V)))
//
// Known Floppy controller types
//
typedef enum _FLOPPY_CONTROLLER_TYPE
{
FDC_NONE,
FDC_UNKNOWN,
FDC_8272A, /* Intel 8272a, NEC 765 */
FDC_765ED, /* Non-Intel 1MB-compatible FDC, can't detect */
FDC_82072, /* Intel 82072; 8272a + FIFO + DUMPREGS */
FDC_82072A, /* 82072A (on Sparcs) */
FDC_82077_ORIG, /* Original version of 82077AA, sans LOCK */
FDC_82077, /* 82077AA-1 */
FDC_82078_UNKN, /* Unknown 82078 variant */
FDC_82078, /* 44pin 82078 or 64pin 82078SL */
FDC_82078_1, /* 82078-1 (2Mbps fdc) */
FDC_S82078B, /* S82078B (first seen on Adaptec AVA-2825 VLB SCSI/EIDE/Floppy controller) */
FDC_87306 /* National Semiconductor PC 87306 */
} FLOPPY_CONTROLLER_TYPE, *PFLOPPY_CONTROLLER_TYPE;
typedef struct _FLOPPY_ERROR_THRESHOLDS
{
/* number of errors to be reached before aborting */
unsigned int Abort;
/* maximal number of errors permitted to read an entire track at once */
unsigned int ReadTrack;
/* maximal number of errors before a reset is tried */
unsigned int Reset;
/* maximal number of errors before a recalibrate is tried */
unsigned int Recal;
/*
* Threshold for reporting FDC errors to the console.
* Setting this to zero may flood your screen when using
* ultra cheap floppies ;-)
*/
unsigned int Reporting;
} FLOPPY_ERROR_THRESHOLDS;
#define FDP_DEBUG 0x02
#define FDP_SILENT_DCL_CLEAR 0x04
#define FDP_MSG 0x10
#define FDP_BROKEN_DCL 0x20
#define FDP_INVERTED_DCL 0x80
typedef struct _FLOPPY_DEVICE_PARAMETERS
{
char CMOSType;
unsigned long MaxDTR; /* Step rate, usec */
unsigned long HLT; /* Head load/settle time, msec */
unsigned long HUT; /* Head unload time (remnant of 8" drives) */
unsigned long SRT; /* Step rate, usec */
unsigned long Spinup; /* time needed for spinup */
unsigned long Spindown; /* timeout needed for spindown */
unsigned char SpindownOffset; /* decides in which position the disk will stop */
unsigned char SelectDelay; /* delay to wait after select */
unsigned char RPS; /* rotations per second */
unsigned char Tracks; /* maximum number of tracks */
unsigned long Timeout; /* timeout for interrupt requests */
unsigned char InterleaveSect; /* if there are more sectors, use interleave */
FLOPPY_ERROR_THRESHOLDS MaxErrors;
char Flags; /* various flags, including ftd_msg */
BOOLEAN ReadTrack; /* use readtrack during probing? */
short Autodetect[8]; /* autodetected formats */
int CheckFreq; /* how often should the drive be checked for disk changes */
int NativeFormat; /* native format of this drive */
char *DriveName; /* name of the drive for reporting */
} FLOPPY_DEVICE_PARAMETERS, *PFLOPPY_DEVICE_PARAMETERS;

View File

@@ -0,0 +1,3 @@
base.tmp
junk.tmp
temp.exp

2058
reactos/drivers/dd/ide/ide.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,235 @@
//
// IDE.H - defines and typedefs for the IDE Driver module.
//
#ifndef __IDE_H
#define __IDE_H
#ifdef __cplusplus
extern "C" {
#endif
#define IDE_MAXIMUM_DEVICES 8
#define IDE_MAX_NAME_LENGTH 50
#define IDE_NT_ROOTDIR_NAME "\\Device"
#define IDE_NT_DEVICE_NAME "\\Harddisk"
#define IDE_NT_PARTITION_NAME "\\Partition"
#define IDE_WIN32_DEVICE_NAME "\\DosDevices\\IDE"
#define IDE_DRIVER_NAME "IDEDRIVER"
#define IDE_SECTOR_BUF_SZ 512
#define IDE_MAX_SECTORS_PER_XFER 256
#define IDE_MAX_RESET_RETRIES 10000
#define IDE_MAX_POLL_RETRIES 100000
#define IDE_MAX_WRITE_RETRIES 1000
#define IDE_MAX_BUSY_RETRIES 100
//#define IDE_MAX_BUSY_RETRIES 100000
#define IDE_MAX_DRQ_RETRIES 10000
//#define IDE_MAX_CMD_RETRIES 1
#define IDE_MAX_CMD_RETRIES 0
#define IDE_CMD_TIMEOUT 5
#define IDE_RESET_PULSE_LENGTH 500 /* maybe a little too long */
#define IDE_RESET_BUSY_TIMEOUT 31
#define IDE_RESET_DRDY_TIMEOUT 120
// Control Block offsets and masks
#define IDE_REG_ALT_STATUS 0x0000
#define IDE_REG_DEV_CNTRL 0x0000 /* device control register */
#define IDE_DC_SRST 0x04 /* drive reset (both drives) */
#define IDE_DC_nIEN 0x02 /* IRQ enable (active low) */
#define IDE_REG_DRV_ADDR 0x0001
// Command Block offsets and masks
#define IDE_REG_DATA_PORT 0x0000
#define IDE_REG_ERROR 0x0001 /* error register */
#define IDE_ER_AMNF 0x01 /* addr mark not found */
#define IDE_ER_TK0NF 0x02 /* track 0 not found */
#define IDE_ER_ABRT 0x04 /* command aborted */
#define IDE_ER_MCR 0x08 /* media change requested */
#define IDE_ER_IDNF 0x10 /* ID not found */
#define IDE_ER_MC 0x20 /* Media changed */
#define IDE_ER_UNC 0x40 /* Uncorrectable data error */
#define IDE_REG_PRECOMP 0x0001
#define IDE_REG_SECTOR_CNT 0x0002
#define IDE_REG_SECTOR_NUM 0x0003
#define IDE_REG_CYL_LOW 0x0004
#define IDE_REG_CYL_HIGH 0x0005
#define IDE_REG_DRV_HEAD 0x0006
#define IDE_DH_FIXED 0xA0
#define IDE_DH_LBA 0x40
#define IDE_DH_HDMASK 0x0F
#define IDE_DH_DRV0 0x00
#define IDE_DH_DRV1 0x10
#define IDE_REG_STATUS 0x0007
#define IDE_SR_BUSY 0x80
#define IDE_SR_DRDY 0x40
#define IDE_SR_DRQ 0x08
#define IDE_SR_ERR 0x01
#define IDE_REG_COMMAND 0x0007
#define IDE_CMD_READ 0x20
#define IDE_CMD_READ_RETRY 0x21
#define IDE_CMD_WRITE 0x30
#define IDE_CMD_WRITE_RETRY 0x31
#define IDE_CMD_IDENT_DRV 0xEC
//
// Access macros for command registers
// Each macro takes an address of the command port block, and data
//
#define IDEReadError(Address) (inb_p((Address) + IDE_REG_ERROR))
#define IDEWritePrecomp(Address, Data) (outb_p((Address) + IDE_REG_PRECOMP, (Data)))
#define IDEReadSectorCount(Address) (inb_p((Address) + IDE_REG_SECTOR_CNT))
#define IDEWriteSectorCount(Address, Data) (outb_p((Address) + IDE_REG_SECTOR_CNT, (Data)))
#define IDEReadSectorNum(Address) (inb_p((Address) + IDE_REG_SECTOR_NUM))
#define IDEWriteSectorNum(Address, Data) (outb_p((Address) + IDE_REG_SECTOR_NUM, (Data)))
#define IDEReadCylinderLow(Address) (inb_p((Address) + IDE_REG_CYL_LOW))
#define IDEWriteCylinderLow(Address, Data) (outb_p((Address) + IDE_REG_CYL_LOW, (Data)))
#define IDEReadCylinderHigh(Address) (inb_p((Address) + IDE_REG_CYL_HIGH))
#define IDEWriteCylinderHigh(Address, Data) (outb_p((Address) + IDE_REG_CYL_HIGH, (Data)))
#define IDEReadDriveHead(Address) (inb_p((Address) + IDE_REG_DRV_HEAD))
#define IDEWriteDriveHead(Address, Data) (outb_p((Address) + IDE_REG_DRV_HEAD, (Data)))
#define IDEReadStatus(Address) (inb_p((Address) + IDE_REG_STATUS))
#define IDEWriteCommand(Address, Data) (outb_p((Address) + IDE_REG_COMMAND, (Data)))
//
// Data block read and write commands
//
#define IDEReadBlock(Address, Buffer, Count) \
(insw((Address) + IDE_REG_DATA_PORT, (Buffer), (Count) / 2))
#define IDEWriteBlock(Address, Buffer, Count) \
(outsw((Address) + IDE_REG_DATA_PORT, (Buffer), (Count) / 2))
//
// Access macros for control registers
// Each macro takes an address of the control port blank and data
//
#define IDEWriteDriveControl(Address, Data) (outb_p((Address) + IDE_REG_DEV_CNTRL, (Data)))
// IDE_DEVICE_EXTENSION
//
// DESCRIPTION:
// Extension to be placed in each device object
//
// ACCESS:
// Allocated from NON-PAGED POOL
// Available at any IRQL
//
typedef struct _IDE_DEVICE_EXTENSION {
PDEVICE_OBJECT DeviceObject;
PCONTROLLER_OBJECT ControllerObject;
struct _IDE_DEVICE_EXTESION *DiskExtension;
int UnitNumber;
BOOLEAN LBASupported;
BOOLEAN DMASupported;
int BytesPerSector;
int LogicalHeads;
int SectorsPerLogCyl;
int SectorsPerLogTrk;
int Offset;
int Size;
int Operation;
ULONG BytesRequested;
ULONG BytesToTransfer;
ULONG BytesRemaining;
ULONG StartingSector;
int SectorsTransferred;
BYTE *TargetAddress;
} IDE_DEVICE_EXTENSION, *PIDE_DEVICE_EXTENSION;
// IDE_TIMER_STATES
//
// DESCRIPTION:
// An enumeration containing the states in the timer DFA
//
typedef enum _IDE_TIMER_STATES {
IDETimerIdle,
IDETimerCmdWait,
IDETimerResetWaitForBusyNegate,
IDETimerResetWaitForDrdyAssert
} IDE_TIMER_STATES;
// IDE_CONTROLLER_EXTENSION
//
// DESCRIPTION:
// Driver-defined structure used to hold miscellaneous controller information.
//
// ACCESS:
// Allocated from NON-PAGED POOL
// Available at any IRQL
//
typedef struct _IDE_CONTROLLER_EXTENSION {
KSPIN_LOCK SpinLock;
int Number;
int Vector;
int CommandPortBase;
int ControlPortBase;
BOOLEAN DMASupported;
BOOLEAN ControllerInterruptBug;
PKINTERRUPT Interrupt;
BOOLEAN OperationInProgress;
BYTE DeviceStatus;
PIDE_DEVICE_EXTENSION DeviceForOperation;
PIRP CurrentIrp;
int Retries;
IDE_TIMER_STATES TimerState;
LONG TimerCount;
PDEVICE_OBJECT TimerDevice;
} IDE_CONTROLLER_EXTENSION, *PIDE_CONTROLLER_EXTENSION;
// IDE_DRIVE_IDENTIFY
typedef struct _IDE_DRIVE_IDENTIFY {
WORD ConfigBits; /*00*/
WORD LogicalCyls; /*01*/
WORD Reserved02; /*02*/
WORD LogicalHeads; /*03*/
WORD BytesPerTrack; /*04*/
WORD BytesPerSector; /*05*/
WORD SectorsPerTrack; /*06*/
BYTE InterSectorGap; /*07*/
BYTE InterSectorGapSize;
BYTE Reserved08H; /*08*/
BYTE BytesInPLO;
WORD VendorUniqueCnt; /*09*/
char SerialNumber[20]; /*10*/
WORD ControllerType; /*20*/
WORD BufferSize; /*21*/
WORD ECCByteCnt; /*22*/
char FirmwareRev[8]; /*23*/
char ModelNumber[40]; /*27*/
WORD RWMultImplemented; /*47*/
WORD Reserved48; /*48*/
WORD Capabilities; /*49*/
#define IDE_DRID_STBY_SUPPORTED 0x2000
#define IDE_DRID_IORDY_SUPPORTED 0x0800
#define IDE_DRID_IORDY_DISABLE 0x0400
#define IDE_DRID_LBA_SUPPORTED 0x0200
#define IDE_DRID_DMA_SUPPORTED 0x0100
WORD Reserved50; /*50*/
WORD MinPIOTransTime; /*51*/
WORD MinDMATransTime; /*52*/
WORD TMFieldsValid; /*53*/
WORD TMCylinders; /*54*/
WORD TMHeads; /*55*/
WORD TMSectorsPerTrk; /*56*/
WORD TMCapacity; /*57*/
WORD Reserved53[198]; /*58*/
} IDE_DRIVE_IDENTIFY, *PIDE_DRIVE_IDENTIFY;
#ifdef __cplusplus
}
#endif
#endif /* __IDE_H */

View File

@@ -0,0 +1,39 @@
#include <defines.h>
#include <reactos/resource.h>
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
VS_VERSION_INFO VERSIONINFO
FILEVERSION RES_UINT_FV_MAJOR,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUILD
PRODUCTVERSION RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUILD
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", RES_STR_COMPANY_NAME
VALUE "FileDescription", "IDE Disk Device Driver\0"
VALUE "FileVersion", "0.1.4\0"
VALUE "InternalName", "ide\0"
VALUE "LegalCopyright", RES_STR_LEGAL_COPYRIGHT
VALUE "OriginalFilename", "ide.sys\0"
VALUE "ProductName", RES_STR_PRODUCT_NAME
VALUE "ProductVersion", RES_STR_PRODUCT_VERSION
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

View File

@@ -0,0 +1,20 @@
#define IOCTL_DISK_GET_DRIVE_GEOMETRY CTL_CODE(FILE_DEVICE_DISK, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_GET_PARTITION_INFO CTL_CODE(FILE_DEVICE_DISK, 1, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_SET_PARTITION_INFO CTL_CODE(FILE_DEVICE_DISK, 2, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_GET_DRIVE_LAYOUT CTL_CODE(FILE_DEVICE_DISK, 3, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_SET_DRIVE_LAYOUT CTL_CODE(FILE_DEVICE_DISK, 4, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_VERIFY CTL_CODE(FILE_DEVICE_DISK, 5, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_FORMAT_TRACKS CTL_CODE(FILE_DEVICE_DISK, 6, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_REASSIGN_BLOCKS CTL_CODE(FILE_DEVICE_DISK, 7, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_PERFORMANCE CTL_CODE(FILE_DEVICE_DISK, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_IS_WRITABLE CTL_CODE(FILE_DEVICE_DISK, 9, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_LOGGING CTL_CODE(FILE_DEVICE_DISK, 10, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_FORMAT_TRACKS_EX CTL_CODE(FILE_DEVICE_DISK, 11, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_HISTOGRAM_STRUCTURE CTL_CODE(FILE_DEVICE_DISK, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_HISTOGRAM_DATA CTL_CODE(FILE_DEVICE_DISK, 13, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_HISTOGRAM_RESET CTL_CODE(FILE_DEVICE_DISK, 14, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_REQUEST_STRUCTURE CTL_CODE(FILE_DEVICE_DISK, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_REQUEST_DATA CTL_CODE(FILE_DEVICE_DISK, 16, METHOD_BUFFERED, FILE_ANY_ACCESS)

View File

@@ -0,0 +1,69 @@
# $Id: makefile,v 1.10 1999/12/18 10:17:41 ea Exp $
#
#
TARGET=ide
OBJECTS = $(TARGET).o $(TARGET).coff ../../../ntoskrnl/ntoskrnl.a
BASE_CFLAGS = -I../../../include
all: $(TARGET).sys
.phony: all
clean:
- $(RM) $(TARGET).o
- $(RM) $(TARGET).coff
- $(RM) junk.tmp
- $(RM) base.tmp
- $(RM) temp.exp
- $(RM) $(TARGET).sys
.phony: clean
floppy: $(FLOPPY_DIR)/drivers/$(TARGET).sys
$(FLOPPY_DIR)/drivers/$(TARGET).sys: $(TARGET).sys
ifeq ($(DOSCLI),yes)
$(CP) $(TARGET).sys $(FLOPPY_DIR)\drivers\$(TARGET).sys
else
$(CP) $(TARGET).sys $(FLOPPY_DIR)/drivers/$(TARGET).sys
endif
dist: ../../../$(DIST_DIR)/drivers/$(TARGET).sys
../../../$(DIST_DIR)/drivers/$(TARGET).sys: $(TARGET).sys
ifeq ($(DOSCLI),yes)
$(CP) $(TARGET).sys ..\..\..\$(DIST_DIR)\drivers\$(TARGET).sys
else
$(CP) $(TARGET).sys ../../../$(DIST_DIR)/drivers/$(TARGET).sys
endif
$(TARGET).sys: $(OBJECTS)
$(CC) \
-specs=../../svc_specs \
-mdll \
-o junk.tmp \
-Wl,--defsym,_end=end \
-Wl,--defsym,_edata=__data_end__ \
-Wl,--defsym,_etext=etext \
-Wl,--base-file,base.tmp $(OBJECTS)
- $(RM) junk.tmp
$(DLLTOOL) \
--dllname $(TARGET).sys \
--base-file base.tmp \
--output-exp temp.exp \
--kill-at
- $(RM) base.tmp
$(CC) \
--verbose \
-Wl,--image-base,0x10000 \
-Wl,-e,_DriverEntry@8 \
-Wl,temp.exp \
-specs=../../svc_specs \
-mdll \
-o $(TARGET).sys \
$(OBJECTS)
- $(RM) temp.exp
include ../../../rules.mak

View File

@@ -0,0 +1,93 @@
/**
*** Partition.h - defines and structs for harddrive partition info
***
*** 05/30/98 RJJ Created
**/
#ifndef __PARTITION_H
#define __PARTITION_H
#define PARTITION_MAGIC 0xaa55
#define PART_MAGIC_OFFSET 0x01fe
#define PARTITION_OFFSET 0x01be
#define PARTITION_TBL_SIZE 4
#define PTCHSToLBA(c, h, s, scnt, hcnt) ((s) & 0x3f) + \
(scnt) * ( (h) + (hcnt) * ((c) | (((s) & 0xc0) << 2)))
#define PTLBAToCHS(lba, c, h, s, scnt, hcnt) ( \
(s) = (lba) % (scnt) + 1, \
(lba) /= (scnt), \
(h) = (lba) % (hcnt), \
(lba) /= (heads), \
(c) = (lba) & 0xff, \
(s) |= ((lba) >> 2) & 0xc0)
/* taken from linux fdisk src */
typedef enum PartitionTypes {
PTEmpty = 0,
PTDOS3xPrimary, /* 1 */
PTXENIXRoot, /* 2 */
PTXENIXUsr, /* 3 */
PTOLDDOS16Bit, /* 4 */
PTDosExtended, /* 5 */
PTDos5xPrimary, /* 6 */
PTOS2HPFS, /* 7 */
PTAIX, /* 8 */
PTAIXBootable, /* 9 */
PTOS2BootMgr, /* 10 */
PTWin95FAT32,
PTWin95FAT32LBA,
PTWin95FAT16LBA,
PTWin95ExtendedLBA,
PTVenix286 = 0x40,
PTNovell = 0x51,
PTMicroport = 0x52,
PTGnuHurd = 0x63,
PTNetware286 = 0x64,
PTNetware386 = 0x65,
PTPCIX = 0x75,
PTOldMinix = 0x80,
PTMinix = 0x81,
PTLinuxSwap = 0x82,
PTLinuxExt2 = 0x83,
PTAmoeba = 0x93,
PTAmoebaBBT = 0x94,
PTBSD = 0xa5,
PTBSDIFS = 0xb7,
PTBSDISwap = 0xb8,
PTSyrinx = 0xc7,
PTCPM = 0xdb,
PTDOSAccess = 0xe1,
PTDOSRO = 0xe3,
PTDOSSecondary = 0xf2,
PTBBT = 0xff
} PARTITIONTYPES;
#define PartitionIsSupported(P) \
((P)->PartitionType == PTDOS3xPrimary || \
(P)->PartitionType == PTOLDDOS16Bit || \
(P)->PartitionType == PTDos5xPrimary || \
(P)->PartitionType == PTWin95FAT32 || \
(P)->PartitionType == PTWin95FAT32LBA || \
(P)->PartitionType == PTWin95FAT16LBA || \
(P)->PartitionType == PTLinuxExt2)
#define PartitionIsExtended(P) \
((P)->PartitionType == PTDosExtended)
typedef struct Partition {
unsigned char BootFlags;
unsigned char StartingHead;
unsigned char StartingSector;
unsigned char StartingCylinder;
unsigned char PartitionType;
unsigned char EndingHead;
unsigned char EndingSector;
unsigned char EndingCylinder;
unsigned int StartingBlock;
unsigned int SectorCount;
} PARTITION;
#endif // PARTITION_H

View File

@@ -0,0 +1,4 @@
base.tmp
junk.tmp
temp.exp

View File

@@ -0,0 +1,732 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: services/dd/keyboard/keyboard.c
* PURPOSE: Keyboard driver
* PROGRAMMER: Victor Kirhenshtein (sauros@iname.com)
* Jason Filby (jasonfilby@yahoo.com)
*/
/* INCLUDES ****************************************************************/
#include <ddk/ntddk.h>
#include <internal/mmhal.h>
#include <internal/halio.h>
#include <string.h>
#include <internal/string.h>
#include <defines.h>
#define NDEBUG
#include <internal/debug.h>
#include "keyboard.h"
/* GLOBALS *******************************************************************/
/*
* Driver data
*/
static KEY_EVENT_RECORD kbdBuffer[KBD_BUFFER_SIZE];
static int bufHead,bufTail;
static int keysInBuffer;
static int extKey;
static BYTE ledStatus;
static BYTE capsDown,numDown,scrollDown;
static DWORD ctrlKeyState;
static PKINTERRUPT KbdInterrupt;
static KDPC KbdDpc;
static BOOLEAN AlreadyOpened = FALSE;
/*
* PURPOSE: Current irp being processed
*/
static PIRP CurrentIrp;
/*
* PURPOSE: Number of keys that have been read into the current irp's buffer
*/
static ULONG KeysRead;
static ULONG KeysRequired;
/*
* Virtual key codes table
*
* Comments:
* * PrtSc = VK_PRINT
* * Alt+PrtSc (SysRq) = VK_EXECUTE
* * Alt = VK_MENU
*/
static const WORD vkTable[128]=
{
/* 00 - 07 */ 0, VK_ESCAPE, VK_1, VK_2, VK_3, VK_4, VK_5, VK_6,
/* 08 - 0F */ VK_7, VK_8, VK_9, VK_0, 189, 187, VK_BACK, VK_TAB,
/* 10 - 17 */ VK_Q, VK_W, VK_E, VK_R, VK_T, VK_Y, VK_U, VK_I,
/* 18 - 1F */ VK_O, VK_P, 219, 221, VK_RETURN, VK_CONTROL, VK_A, VK_S,
/* 20 - 27 */ VK_D, VK_F, VK_G, VK_H, VK_J, VK_K, VK_L, 186,
/* 28 - 2F */ 222, 192, VK_SHIFT, 220, VK_Z, VK_X, VK_C, VK_V,
/* 30 - 37 */ VK_B, VK_N, VK_M, 188, 190, 191, VK_SHIFT, VK_MULTIPLY,
/* 38 - 3F */ VK_MENU, VK_SPACE, VK_CAPITAL, VK_F1, VK_F2, VK_F3, VK_F4, VK_F5,
/* 40 - 47 */ VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, VK_NUMLOCK, VK_SCROLL, VK_HOME,
/* 48 - 4F */ VK_UP, VK_PRIOR, VK_SUBTRACT, VK_LEFT, VK_CLEAR, VK_RIGHT, VK_ADD, VK_END,
/* 50 - 57 */ VK_DOWN, VK_NEXT, VK_INSERT, VK_DELETE, VK_EXECUTE, 0, 0, VK_F11,
/* 58 - 5F */ VK_F12, 0, 0, 91, 92, 93, 0, 0,
/* 60 - 67 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 68 - 6F */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 70 - 77 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 78 - 7F */ 0, 0, 0, 0, 0, 0, 0, VK_PAUSE
};
static const WORD vkKeypadTable[13]= /* 47 - 53 */
{
VK_NUMPAD7, VK_NUMPAD8, VK_NUMPAD9, VK_SUBTRACT,
VK_NUMPAD4, VK_NUMPAD5, VK_NUMPAD6, VK_ADD,
VK_NUMPAD1, VK_NUMPAD2, VK_NUMPAD3, VK_NUMPAD0, VK_DECIMAL
};
/*
* ASCII translation tables
*/
static const BYTE asciiTable1[10]=
{
')','!','@','#','$','%','^','&','*','('
};
static const BYTE asciiTable2[16]=
{
'0','1','2','3','4','5','6','7','8','9','*','+',0,'-','.','/'
};
static const BYTE asciiTable3[37]=
{
';','=',',','-','.','/','`', 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
'[', '\\', ']', '\''
};
static const BYTE asciiTable4[37]=
{
':','+','<','_','>','?','~', 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
'{', '|', '}', '"'
};
/* FUNCTIONS *****************************************************************/
static void KbdWrite(int addr,BYTE data)
/*
* FUNCTION: Write data to keyboard
*/
{
BYTE status;
do
{
status=inb_p(KBD_CTRL_PORT); // Wait until input buffer empty
} while(status & KBD_IBF);
outb_p(addr,data);
}
static int KbdReadData(void)
/*
* FUNCTION: Read data from port 0x60
*/
{
int i;
BYTE status,data;
i=500000;
do
{
status=inb_p(KBD_CTRL_PORT);
if (!(status & KBD_OBF)) // Check if data available
continue;
data=inb_p(KBD_DATA_PORT);
if (status & (KBD_GTO | KBD_PERR)) // Check for timeout error
continue;
return data;
} while(--i);
return -1; // Timed out
}
/*
* Set keyboard LED's
*/
static void SetKeyboardLEDs(BYTE status)
{
KbdWrite(KBD_DATA_PORT,0xED);
if (KbdReadData()!=KBD_ACK) // Error
return;
KbdWrite(KBD_DATA_PORT,status);
KbdReadData();
}
/*
* Process scan code
*/
static void ProcessScanCode(BYTE scanCode,BOOL isDown)
{
switch(scanCode)
{
case 0x1D: // Ctrl
if (extKey)
{
if (isDown)
ctrlKeyState|=RIGHT_CTRL_PRESSED;
else
ctrlKeyState&=~RIGHT_CTRL_PRESSED;
}
else
{
if (isDown)
ctrlKeyState|=LEFT_CTRL_PRESSED;
else
ctrlKeyState&=~LEFT_CTRL_PRESSED;
}
break;
case 0x2A: // Left shift
case 0x36: // Right shift
if (isDown)
ctrlKeyState|=SHIFT_PRESSED;
else
ctrlKeyState&=~SHIFT_PRESSED;
break;
case 0x38: // Alt
if (extKey)
{
if (isDown)
ctrlKeyState|=RIGHT_ALT_PRESSED;
else
ctrlKeyState&=~RIGHT_ALT_PRESSED;
}
else
{
if (isDown)
ctrlKeyState|=LEFT_ALT_PRESSED;
else
ctrlKeyState&=~LEFT_ALT_PRESSED;
}
break;
case 0x3A: // CapsLock
if (ctrlKeyState & CTRL_PRESSED)
break;
if (isDown)
{
if (!capsDown)
{
capsDown=1;
if (ctrlKeyState & CAPSLOCK_ON)
{
ledStatus&=~KBD_LED_CAPS;
ctrlKeyState&=~CAPSLOCK_ON;
}
else
{
ledStatus|=KBD_LED_CAPS;
ctrlKeyState|=CAPSLOCK_ON;
}
SetKeyboardLEDs(ledStatus);
}
}
else
{
capsDown=0;
}
break;
case 0x45: // NumLock
if (ctrlKeyState & CTRL_PRESSED)
break;
if (isDown)
{
if (!numDown)
{
numDown=1;
if (ctrlKeyState & NUMLOCK_ON)
{
ledStatus&=~KBD_LED_NUM;
ctrlKeyState&=~NUMLOCK_ON;
}
else
{
ledStatus|=KBD_LED_NUM;
ctrlKeyState|=NUMLOCK_ON;
}
SetKeyboardLEDs(ledStatus);
}
}
else
{
numDown=0;
}
break;
case 0x46: // ScrollLock
if (ctrlKeyState & CTRL_PRESSED)
break;
if (isDown)
{
if (!scrollDown)
{
scrollDown=1;
if (ctrlKeyState & SCROLLLOCK_ON)
{
ledStatus&=~KBD_LED_SCROLL;
ctrlKeyState&=~SCROLLLOCK_ON;
}
else
{
ledStatus|=KBD_LED_SCROLL;
ctrlKeyState|=SCROLLLOCK_ON;
}
SetKeyboardLEDs(ledStatus);
}
}
else
{
scrollDown=0;
}
break;
default:
break;
}
}
/*
* Translate virtual key code to ASCII
*/
static BYTE VirtualToAscii(WORD keyCode,BOOL isDown)
{
if ((ctrlKeyState & ALT_PRESSED)&&(ctrlKeyState & CTRL_PRESSED))
return 0; // Ctrl+Alt+char always 0
if ((!isDown)&&(ctrlKeyState & ALT_PRESSED))
return 0; // Alt+char is 0 when key is released
if (ctrlKeyState & CTRL_PRESSED)
{
if ((keyCode>=VK_A)&&(keyCode<=VK_Z))
return keyCode-VK_A+1;
switch(keyCode)
{
case VK_SPACE:
return ' ';
case VK_BACK:
return 127;
case VK_RETURN:
return 10;
case 219: /* [ */
if (ctrlKeyState & SHIFT_PRESSED)
return 0;
return 27;
case 220: /* \ */
if (ctrlKeyState & SHIFT_PRESSED)
return 0;
return 28;
case 221: /* ] */
if (ctrlKeyState & SHIFT_PRESSED)
return 0;
return 29;
default:
return 0;
}
}
if ((keyCode>=VK_A)&&(keyCode<=VK_Z))
{
if (ctrlKeyState & CAPSLOCK_ON)
if (ctrlKeyState & SHIFT_PRESSED)
return keyCode-VK_A+'a';
else
return keyCode-VK_A+'A';
else
if (ctrlKeyState & SHIFT_PRESSED)
return keyCode-VK_A+'A';
else
return keyCode-VK_A+'a';
}
if ((keyCode>=VK_0)&&(keyCode<=VK_9))
{
if (ctrlKeyState & SHIFT_PRESSED)
return asciiTable1[keyCode-VK_0];
else
return keyCode-VK_0+'0';
}
if ((keyCode>=VK_NUMPAD0)&&(keyCode<=VK_DIVIDE))
return asciiTable2[keyCode-VK_NUMPAD0];
if ((keyCode>=186)&&(keyCode<=222))
{
if (ctrlKeyState & SHIFT_PRESSED)
return asciiTable4[keyCode-186];
else
return asciiTable3[keyCode-186];
}
switch(keyCode)
{
case VK_SPACE:
return ' ';
case VK_RETURN:
return '\n';
case VK_BACK:
return 8;
case VK_TAB:
return 9;
}
return 0;
}
/*
* Translate scan code to virtual key code
*/
static WORD ScanToVirtual(BYTE scanCode)
{
if ((scanCode>=0x47)&&(scanCode<=0x53)&&(ctrlKeyState & NUMLOCK_ON)&&
(!extKey)&&(!(ctrlKeyState & SHIFT_PRESSED)))
return vkKeypadTable[scanCode-0x47];
if ((scanCode==0x35)&&(extKey)) // Gray divide
return VK_DIVIDE;
if ((scanCode==0x37)&&(extKey)) // Print screen
return VK_PRINT;
return vkTable[scanCode];
}
/*
* Keyboard IRQ handler
*/
static VOID KbdDpcRoutine(PKDPC Dpc,
PVOID DeferredContext,
PVOID SystemArgument1,
PVOID SystemArgument2)
{
PIRP Irp = (PIRP)SystemArgument2;
PDEVICE_OBJECT DeviceObject = (PDEVICE_OBJECT)SystemArgument1;
CHECKPOINT;
DPRINT("KbdDpcRoutine(DeviceObject %x, Irp %x)\n",
DeviceObject,Irp);
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp,IO_NO_INCREMENT);
IoStartNextPacket(DeviceObject,FALSE);
}
static BOOLEAN KeyboardHandler(PKINTERRUPT Interrupt, PVOID Context)
{
BYTE thisKey;
BOOL isDown;
static BYTE lastKey;
CHECKPOINT;
// Read scan code
thisKey=inb_p(KBD_DATA_PORT);
if ((thisKey==0xE0)||(thisKey==0xE1)) // Extended key
{
extKey=1; // Wait for next byte
lastKey=thisKey;
return FALSE;
}
isDown=!(thisKey & 0x80);
thisKey&=0x7F;
// The keyboard maintains its own internal caps lock and num lock
// statuses. In caps lock mode E0 AA precedes make code and
// E0 2A follow break code. In num lock mode, E0 2A precedes
// make code and E0 AA follow break code. We maintain our own caps lock
// and num lock statuses, so we will just ignore these.
// Some keyboards have L-Shift/R-Shift modes instead of caps lock
// mode. If right shift pressed, E0 B6 / E0 36 pairs generated.
if (extKey & ((thisKey==0x2A)||(thisKey==0x36)))
{
extKey=0;
return FALSE;
}
// Check for PAUSE sequence
if (extKey && (lastKey==0xE1))
{
if (thisKey==0x1D)
lastKey=0xFF; // Sequence is OK
else
extKey=0;
return FALSE;
}
if (extKey && (lastKey==0xFF))
{
if (thisKey!=0x45)
{
extKey=0; // Bad sequence
return FALSE;
}
thisKey=0x7F; // Pseudo-code for PAUSE
}
ProcessScanCode(thisKey,isDown);
// DbgPrint("Key: %c\n",VirtualToAscii(ScanToVirtual(thisKey),isDown));
// DbgPrint("Key: %x\n",ScanToVirtual(thisKey));
if (ScanToVirtual(thisKey)==0x2a)
{
KeBugCheck(0);
}
if (CurrentIrp!=NULL)
{
KEY_EVENT_RECORD* rec = (KEY_EVENT_RECORD *)
CurrentIrp->AssociatedIrp.SystemBuffer;
PIO_STACK_LOCATION stk = IoGetCurrentIrpStackLocation(CurrentIrp);
CHECKPOINT;
rec[KeysRead].bKeyDown=isDown;
rec[KeysRead].wRepeatCount=1;
rec[KeysRead].wVirtualKeyCode=ScanToVirtual(thisKey);
rec[KeysRead].wVirtualScanCode=thisKey;
rec[KeysRead].uChar.AsciiChar=VirtualToAscii(rec->wVirtualKeyCode,isDown);
rec[KeysRead].dwControlKeyState=ctrlKeyState;
if (extKey)
{
rec[KeysRead].dwControlKeyState|=ENHANCED_KEY;
}
KeysRead++;
DPRINT("KeysRequired %d KeysRead %x\n",KeysRequired,KeysRead);
if (KeysRead==KeysRequired)
{
KeInsertQueueDpc(&KbdDpc,stk->DeviceObject,CurrentIrp);
CurrentIrp=NULL;
}
CHECKPOINT;
return TRUE;
}
// Buffer is full ?
if (keysInBuffer==KBD_BUFFER_SIZE) // Buffer is full
{
extKey=0;
return(TRUE);
}
kbdBuffer[bufHead].bKeyDown=isDown;
kbdBuffer[bufHead].wRepeatCount=1;
kbdBuffer[bufHead].wVirtualKeyCode=ScanToVirtual(thisKey);
kbdBuffer[bufHead].wVirtualScanCode=thisKey;
kbdBuffer[bufHead].uChar.UnicodeChar=0;
// kbdBuffer[bufHead].uChar.AsciiChar=TranslateScanCode(thisKey);
kbdBuffer[bufHead].uChar.AsciiChar=VirtualToAscii(kbdBuffer[bufHead].wVirtualKeyCode,isDown);
kbdBuffer[bufHead].dwControlKeyState=ctrlKeyState;
if (extKey)
kbdBuffer[bufHead].dwControlKeyState|=ENHANCED_KEY;
bufHead++;
bufHead&=KBD_WRAP_MASK; // Modulo KBD_BUFFER_SIZE
keysInBuffer++;
extKey=0;
return TRUE;
}
//
// Initialize keyboard
//
static void KeyboardConnectInterrupt(void)
{
ULONG MappedIrq;
KIRQL Dirql;
KAFFINITY Affinity;
NTSTATUS Status;
MappedIrq = HalGetInterruptVector(Internal,
0,
0,
KEYBOARD_IRQ,
&Dirql,
&Affinity);
Status = IoConnectInterrupt(&KbdInterrupt,
KeyboardHandler,
NULL,
NULL,
MappedIrq,
Dirql,
Dirql,
0,
FALSE,
Affinity,
FALSE);
}
static int InitializeKeyboard(void)
{
// Initialize variables
bufHead=0;
bufTail=0;
keysInBuffer=0;
ledStatus=0;
capsDown=0;
numDown=0;
scrollDown=0;
ctrlKeyState=0;
extKey=0;
KeyboardConnectInterrupt();
KeInitializeDpc(&KbdDpc,KbdDpcRoutine,NULL);
return 0;
}
/*
* Read data from keyboard buffer
*/
BOOLEAN KbdSynchronizeRoutine(PVOID Context)
{
PIRP Irp = (PIRP)Context;
KEY_EVENT_RECORD* rec = (KEY_EVENT_RECORD *)Irp->AssociatedIrp.SystemBuffer;
PIO_STACK_LOCATION stk = IoGetCurrentIrpStackLocation(Irp);
ULONG NrToRead = stk->Parameters.Read.Length/sizeof(KEY_EVENT_RECORD);
int i;
DPRINT("NrToRead %d keysInBuffer %d\n",NrToRead,keysInBuffer);
NrToRead = min(NrToRead,keysInBuffer);
DPRINT("NrToRead %d stk->Parameters.Read.Length %d\n",
NrToRead,stk->Parameters.Read.Length);
DPRINT("sizeof(KEY_EVENT_RECORD) %d\n",sizeof(KEY_EVENT_RECORD));
for (i=0;i<NrToRead;i++)
{
memcpy(&rec[i],&kbdBuffer[bufTail],sizeof(KEY_EVENT_RECORD));
bufTail++;
bufTail&=KBD_WRAP_MASK;
keysInBuffer--;
}
if ((stk->Parameters.Read.Length/sizeof(KEY_EVENT_RECORD))==NrToRead)
{
return(TRUE);
}
KeysRequired=stk->Parameters.Read.Length/sizeof(KEY_EVENT_RECORD);
KeysRead=NrToRead;
CurrentIrp=Irp;
return(FALSE);
}
VOID KbdStartIo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
#ifndef NDEBUG
PIO_STACK_LOCATION stk = IoGetCurrentIrpStackLocation(Irp);
#endif
DPRINT("KeyboardStartIo(DeviceObject %x Irp %x)\n",DeviceObject,Irp);
if (KeSynchronizeExecution(KbdInterrupt, KbdSynchronizeRoutine, Irp))
{
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
IoStartNextPacket(DeviceObject, FALSE);
}
DPRINT("stk->Parameters.Read.Length %d\n",stk->Parameters.Read.Length);
DPRINT("KeysRequired %d\n",KeysRequired);
}
NTSTATUS KbdDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
PIO_STACK_LOCATION stk = IoGetCurrentIrpStackLocation(Irp);
NTSTATUS Status;
DPRINT("DeviceObject %x\n",DeviceObject);
DPRINT("Irp %x\n",Irp);
DPRINT("IRP_MJ_CREATE %d stk->MajorFunction %d\n",
IRP_MJ_CREATE, stk->MajorFunction);
DPRINT("AlreadyOpened %d\n",AlreadyOpened);
switch (stk->MajorFunction)
{
case IRP_MJ_CREATE:
if (AlreadyOpened == TRUE)
{
CHECKPOINT;
// Status = STATUS_UNSUCCESSFUL;
Status = STATUS_SUCCESS;
}
else
{
CHECKPOINT;
Status = STATUS_SUCCESS;
AlreadyOpened = TRUE;
}
break;
case IRP_MJ_CLOSE:
Status = STATUS_SUCCESS;
break;
case IRP_MJ_READ:
DPRINT("Handling Read request\n");
DPRINT("Queueing packet\n");
IoStartPacket(DeviceObject,Irp,NULL,NULL);
Status = STATUS_PENDING;
break;
default:
Status = STATUS_NOT_IMPLEMENTED;
break;
}
if (Status==STATUS_PENDING)
{
DPRINT("Marking irp pending\n");
IoMarkIrpPending(Irp);
}
else
{
Irp->IoStatus.Status = Status;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp,IO_NO_INCREMENT);
}
DPRINT("Status %d\n",Status);
return(Status);
}
NTSTATUS STDCALL DriverEntry(PDRIVER_OBJECT DriverObject,
PUNICODE_STRING RegistryPath)
/*
* FUNCTION: Module entry point
*/
{
PDEVICE_OBJECT DeviceObject;
UNICODE_STRING DeviceName;
UNICODE_STRING SymlinkName;
DbgPrint("Keyboard Driver 0.0.4\n");
InitializeKeyboard();
DriverObject->MajorFunction[IRP_MJ_CREATE] = KbdDispatch;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = KbdDispatch;
DriverObject->MajorFunction[IRP_MJ_READ] = KbdDispatch;
DriverObject->DriverStartIo = KbdStartIo;
RtlInitUnicodeString(&DeviceName, L"\\Device\\Keyboard");
IoCreateDevice(DriverObject,
0,
&DeviceName,
FILE_DEVICE_KEYBOARD,
0,
TRUE,
&DeviceObject);
DeviceObject->Flags = DeviceObject->Flags | DO_BUFFERED_IO;
RtlInitUnicodeString(&SymlinkName, L"\\??\\Keyboard");
IoCreateSymbolicLink(&SymlinkName, &DeviceName);
return(STATUS_SUCCESS);
}

Some files were not shown because too many files have changed in this diff Show More