Compare commits

..

317 Commits

Author SHA1 Message Date
Filip Navara
fa64e59142 Created pnpmgr_cleanup branch. The purpose of this branch is to do overall cleanup of the kernel mode part of PnP manager (particulary the device tree functions) and address some long-standing bugs like #262.
svn path=/branches/pnpmgr_cleanup/; revision=14332
2005-03-26 12:51:46 +00:00
Filip Navara
eec0877568 Created pnpmgr_cleanup branch
svn path=/branches/pnpmgr_cleanup/; revision=14331
2005-03-26 12:46:29 +00:00
Magnus Olsen
24a420afcf Fix a small bug I introdues and fix a old bug for tribes
svn path=/trunk/; revision=14330
2005-03-26 11:58:43 +00:00
Magnus Olsen
cb6b20b96e more bugfix for Tribes
but still choppy mouse but not equal as last time

svn path=/trunk/; revision=14329
2005-03-26 11:16:14 +00:00
Art Yerkes
614603eeb9 Added tools needed to build the ppc boot program.
svn path=/trunk/; revision=14328
2005-03-26 10:19:48 +00:00
Magnus Olsen
fdd9078191 Fix some bugs for Tirbes in GetDeivceData
remove to call for geting mouse data. That
are not need it. rest are bugs fix for Tirbes.

Left Todo
The mouse are bit choppy. The mouse area you 
can move the mouse are not being set up right.

svn path=/trunk/; revision=14327
2005-03-26 09:38:23 +00:00
Thomas Bluemel
00018abc54 always wake waiting threads when releasing the last recursion
svn path=/trunk/; revision=14326
2005-03-26 00:10:34 +00:00
Hervé Poussineau
f51f04e53e Implement IntChangeDisplaySettings in a crappy way. Feel free to improve it!
svn path=/trunk/; revision=14325
2005-03-25 23:23:35 +00:00
Hervé Poussineau
554ba464bc Call ChangeDisplaySettingsEx.
We need to implement a test phase to verify that new settings are correct.

svn path=/trunk/; revision=14324
2005-03-25 23:21:00 +00:00
Thomas Bluemel
f14bd21382 grant correct access rights when duplicating a handle
svn path=/trunk/; revision=14323
2005-03-25 23:11:20 +00:00
Thomas Bluemel
2cf86ba40d minor optimization fix for single linked lists
svn path=/trunk/; revision=14322
2005-03-25 22:53:57 +00:00
Eric Kohl
63fa5da683 Generate code without L-value casts. Fix remaining issues.
svn path=/trunk/; revision=14320
2005-03-25 21:29:11 +00:00
Royce Mitchell III
8ac9a09484 patch by Filip Navara:
IopCreateDeviceNode should allocate from NonPagedPool, not PagedPool... (the memory is accessed at DISPATCH_LEVEL)

svn path=/trunk/; revision=14319
2005-03-25 19:34:26 +00:00
Thomas Bluemel
71cda6ad2a only return the token handle if creating it succeeded
svn path=/trunk/; revision=14316
2005-03-25 18:13:31 +00:00
Filip Navara
e11896f814 Fix a typo.
svn path=/trunk/; revision=14313
2005-03-25 15:48:03 +00:00
Hartmut Birr
2b55bc2731 - Implemented NpfsCleanup.
- Moved most of the code from NpfsClose to NpfsCleanup.  
- If a pipe handle is closed, remove the fcb from the wait list and cancel a connecting irp if one is waiting.

svn path=/trunk/; revision=14310
2005-03-25 13:40:33 +00:00
Filip Navara
a106e5c2e0 Fix uninitialized variable warnings.
svn path=/trunk/; revision=14308
2005-03-25 12:00:56 +00:00
Hartmut Birr
0341276444 Reverted my last changes which allows to read from a listening pipe.
svn path=/trunk/; revision=14307
2005-03-25 11:45:48 +00:00
Hartmut Birr
bb8e4bcd9e Fixed the return value and last error in ConnectNamedPipe if a overlapped structure is given.
svn path=/trunk/; revision=14306
2005-03-25 11:25:44 +00:00
Hartmut Birr
79d1ef572c Added a missing unlock.
svn path=/trunk/; revision=14305
2005-03-25 11:05:10 +00:00
Filip Navara
97ae5f94b5 Fix compilation.
svn path=/trunk/; revision=14299
2005-03-24 13:17:23 +00:00
Art Yerkes
0ecfffa8a0 This is change 1 of 2.
AddIPAddress and DeleteIPAddress are now implemented all the way down.
Next we need the dhcp service live enough to assign the address from userland,
then we can remove the IP address setting from the kernel.

svn path=/trunk/; revision=14298
2005-03-24 10:46:52 +00:00
Hervé Poussineau
632a47580b - Add synchronization on input and output buffers
- Respect timeouts on IRP_MJ_READ
- Get right buffer in read/write routines

svn path=/trunk/; revision=14297
2005-03-24 07:50:41 +00:00
Hartmut Birr
974ee62e85 - Guarded the calls to IoSetCancelRoutine with IoAcquireCancelSpinLock/IoReleaseCancelSpinLock.
- Used a fastmutex as lock for the data queue.  
- Used paged pool for the data buffers.  
- Allowed the server to read (and to wait) on a listening pipe.  
- Implemented the non blocking read operations.

svn path=/trunk/; revision=14296
2005-03-23 22:11:20 +00:00
Hartmut Birr
7889b35088 Set the share disposition of an interrupt according to the value from the resource.
svn path=/trunk/; revision=14295
2005-03-23 21:51:40 +00:00
Emanuele Aliberti
b929be435f old Win9x drivers subsystem id
svn path=/trunk/; revision=14294
2005-03-23 21:51:08 +00:00
Hervé Poussineau
2a60fd0675 SUBLANG_NEUTRAL -> SUBLANG_ENGLISH_US because ReactOS searches for english/US if no more suitable langage is found
svn path=/trunk/; revision=14293
2005-03-23 21:06:02 +00:00
Hartmut Birr
1821eebb12 Fixed the calling convention of the cancel routine.
svn path=/trunk/; revision=14292
2005-03-23 19:05:42 +00:00
Thomas Bluemel
8e6267fd39 revert my changes
svn path=/trunk/; revision=14275
2005-03-23 13:26:38 +00:00
Emanuele Aliberti
58042e8e21 updated an absolete comment
svn path=/trunk/; revision=14274
2005-03-22 23:34:08 +00:00
Hervé Poussineau
64574d47b1 - Implement IOCTL_SERIAL_GET_COMMSTATUS, IOCTL_SERIAL_PURGE, IOCTL_SET_QUEUE_SIZE
- Add a hack in IOCTL_SERIAL_GET_BAUD_RATE to get it working with mode.exe

svn path=/trunk/; revision=14273
2005-03-22 22:10:44 +00:00
Hervé Poussineau
c75445a9d4 Christoph von Wittich <Christoph@ApiViewer.de>
- Extract hard-coded english sentences from settings.c and put them into resources
- Add corresponding german translations
- Correct some control locations in german and english resource files
- Show only resolutions >= 640x480

svn path=/trunk/; revision=14271
2005-03-22 20:16:41 +00:00
Gé van Geldorp
59904f6ca5 Forgotten file in r13928
svn path=/trunk/; revision=14270
2005-03-22 19:32:17 +00:00
Thomas Bluemel
7a236ead2e forgot this file
svn path=/trunk/; revision=14269
2005-03-22 17:46:44 +00:00
Thomas Bluemel
8d780ebc45 fixed a few race conditions during thread/process termination leading to dead-locks
svn path=/trunk/; revision=14268
2005-03-22 17:32:15 +00:00
Thomas Bluemel
c0b7a5108d improve readability by removing obsolete gotos and for loops where appropriate
svn path=/trunk/; revision=14267
2005-03-22 17:17:02 +00:00
Alex Ionescu
2700763b70 Fix really really big Mutex/APC bug. Killing GUI Threads from taskmanager should now work flawlessly, and gui apps should work better; the bug had probably tiny important impact in them
svn path=/trunk/; revision=14264
2005-03-22 03:06:03 +00:00
Thomas Bluemel
efa9275d99 forgot to remove debug messages
svn path=/trunk/; revision=14263
2005-03-22 03:05:46 +00:00
Thomas Bluemel
ef30b93924 silence obsolete debug message
svn path=/trunk/; revision=14262
2005-03-22 02:35:54 +00:00
Thomas Bluemel
a642687b55 fixed thread/process termination bugs that might have caused crashes. due to a apc bug gui threads terminating gui threads doesn't work. Alex is going to take care of it.
svn path=/trunk/; revision=14261
2005-03-22 02:32:14 +00:00
Hervé Poussineau
fe8ad2a13b Sylvain Petreolle <spetreolle@yahoo.fr>
- Translate sysdm.cpl into french
- Fix misplaced icons and text boxes
- Add default values into network identification

svn path=/trunk/; revision=14260
2005-03-21 23:37:02 +00:00
Aleksey Bragin
9cc07a82a9 Nice "About Explorer" icon, by Mindflyer.
svn path=/trunk/; revision=14259
2005-03-21 22:10:10 +00:00
Hervé Poussineau
725a3c2f57 Change REG_MULTI_SZ entry values to readable form.
svn path=/trunk/; revision=14258
2005-03-21 22:07:06 +00:00
Filip Navara
8c984877c4 Move the process object dereference from NtTerminateProcess to PspExitProcess (comments inside).
svn path=/trunk/; revision=14257
2005-03-21 21:33:31 +00:00
Filip Navara
49b1d66ec3 - Advance the CurrentEntry pointer before terminating thread in PspTerminateProcessThreads.
- Lock the process in NtTerminateProcess to prevent race conditions.

svn path=/trunk/; revision=14256
2005-03-21 20:11:52 +00:00
Gunnar Dalsnes
561b4db8e9 readd incorrectly removed access mapping
svn path=/trunk/; revision=14255
2005-03-21 17:13:55 +00:00
Gunnar Dalsnes
4dcc066ed7 CopyAcceleratorTableA: dont access lpAccelDst it its NULL (w3seek)
svn path=/trunk/; revision=14254
2005-03-21 17:11:48 +00:00
Gregor Anich
0ac49e9d42 Use a work item only for calling KdSystemDebugControl with code 10 (which is Tab + K, or "Enter Kernel Debugger") because sometimes when the system crashes work items do not work anymore. Thanks to Filip for pointing out the problem.
svn path=/trunk/; revision=14253
2005-03-21 17:09:06 +00:00
Hervé Poussineau
160084df80 Based on work by Saveliy Tretiakov (saveliyt@mail.ru)
Implement IOCTL_SERIAL_GET_PROPERTIES

svn path=/trunk/; revision=14252
2005-03-21 12:41:54 +00:00
Hervé Poussineau
28a24e8079 - Implement GetCommProperties (Saveliy Tretiakov <saveliyt@mail.ru>)
- Remove a test in GetCommState that shouldn't exist

svn path=/trunk/; revision=14251
2005-03-21 10:32:15 +00:00
Filip Navara
e5d49d1493 Fix a typo in write_function_stubs.
svn path=/trunk/; revision=14250
2005-03-21 08:43:01 +00:00
Filip Navara
07647a0b62 Specify correct access rights in NtOpenProcess when sending control events.
svn path=/trunk/; revision=14249
2005-03-21 08:32:22 +00:00
Filip Navara
fd19aa00e6 Correctly draw the titlebar as active or inactive during the processing of WM_NCACTIVATE message.
svn path=/trunk/; revision=14248
2005-03-21 01:59:21 +00:00
Filip Navara
2315100314 - Cleanup DefWndDoButton function.
- Fix some loops where GetMessage was inadvertently used.

svn path=/trunk/; revision=14247
2005-03-21 01:34:02 +00:00
Filip Navara
3a6ab460dd - Move WINDOWOBJECT_NEED_INTERNALPAINT flag handling to NtGdiBeginPaint.
- Fix IntGetPaintMessage to not return TRUE when no message was returned.
- IntIsWindowDirty shouldn't check for the WINDOWOBJECT_NEED_NCPAINT flag (at least not now).

svn path=/trunk/; revision=14246
2005-03-21 00:55:16 +00:00
Emanuele Aliberti
b1367292b1 cleaned a wrong comment (copy&paste)
svn path=/trunk/; revision=14245
2005-03-20 23:01:48 +00:00
Emanuele Aliberti
a90ec8327c SM: init system reading the registry
CSR: register with SM for IMAGE_SUBSYSTEM_WINDOWS_CUI

svn path=/trunk/; revision=14244
2005-03-20 22:55:05 +00:00
Filip Navara
8b0ad6b22f Minor correction to my r14237 commit. Forgot to delete "++".
svn path=/trunk/; revision=14239
2005-03-20 21:44:58 +00:00
Filip Navara
a9c2167a20 Reorder the source file lists so we, lousy people, building with DEPENDENCIES=no can also enjoy the blessing of the PnP gods.
svn path=/trunk/; revision=14238
2005-03-20 21:40:00 +00:00
Filip Navara
17a549a975 Generate code without L-value casts.
svn path=/trunk/; revision=14237
2005-03-20 21:35:12 +00:00
Thomas Bluemel
86a52339fb revert changes from CreateFileA
svn path=/trunk/; revision=14236
2005-03-20 20:46:16 +00:00
Eric Kohl
b718e3cc4e - Add stubs: CM_GetChild, CM_GetChild_Ex, CM_GetParent, CM_GetPaarent_Ex, CM_GetSibling, CM_GetSibling_Ex, CM_Locate_DevNodeA, CM_Locate_DevNodeW, CM_Locate_DevNode_ExA, CM_Locate_DevNode_ExW
- Implement:  CM_GetVersion, CM_GetVersion_Ex, CM_Connect_MachineA, CM_Connect_MachineW, CM_Disconnect_Machine.
- Implement RPC server in umpnpmgr.dll to reply to calls to CM_GetVersion/CM_GetVersion_Ex.

svn path=/trunk/; revision=14235
2005-03-20 20:43:46 +00:00
Filip Navara
a0da8855ea There's no need to call PropertySheet twice.
svn path=/trunk/; revision=14234
2005-03-20 20:28:19 +00:00
Thomas Bluemel
b407470ef1 added support for template directories (copy ntfs extended attributes) to CreateDirectoryEx()
svn path=/trunk/; revision=14233
2005-03-20 20:27:56 +00:00
Filip Navara
34484a48d9 Initialize the "toc" field in the pdb_lookup structure in order
to prevent pdb_free_lookup from trying to delete invalid pointers.

svn path=/trunk/; revision=14232
2005-03-20 19:11:52 +00:00
Thomas Bluemel
0f4cfdb301 - added support for template files (copy ntfs extended attributes) to CreateFile()
- mask out file flags from dwFlagsAndAttributes before passing them to NtCreateFile as file attributes

svn path=/trunk/; revision=14231
2005-03-20 18:55:54 +00:00
Filip Navara
b4d371d7d2 Don't use uninitialized variable in _SHExpandEnvironmentStrings.
svn path=/trunk/; revision=14230
2005-03-20 18:40:57 +00:00
Hervé Poussineau
e8ecbebd7d Based on work by Mark Junker <mjscod@gmx.de>
- Detect UART type
- Clear transmit/receive FIFO if applicable

svn path=/trunk/; revision=14229
2005-03-20 18:30:09 +00:00
Magnus Olsen
0936234d7d LPUNKNOWN pUnkOuter did check it was NULL and return
forget it should be not equal with NULL it return 
thx to mifritscher did the first test to find my mistake

svn path=/trunk/; revision=14228
2005-03-20 18:20:59 +00:00
Gunnar Dalsnes
124f38a790 GetBinaryTypeA, CopyFileExA, CreateFileA, DeleteFileA, MoveFileWithProgressA: Use common A2W conv. routines
svn path=/trunk/; revision=14227
2005-03-20 17:39:11 +00:00
Gunnar Dalsnes
de75c774c3 removed faulty FilenameA2U (returned ptr to stack var)
remove faulty init of StaticUnicodeString (now done in ntdll)

svn path=/trunk/; revision=14226
2005-03-20 17:26:58 +00:00
Magnus Olsen
08482c30b1 start add hardware interface to hal
we now map the hal to directdraw 

follow api are implement in the ddraw for hal
but all hal api are not implement in the kernel
if you got louky it maby working with nvida driver now. 

untested yet. 

svn path=/trunk/; revision=14225
2005-03-20 17:24:11 +00:00
Gunnar Dalsnes
bab510233f init StaticUnicodeString
svn path=/trunk/; revision=14224
2005-03-20 17:22:24 +00:00
Thomas Bluemel
de138c3bb4 - fixed access rights and shared access checks in IoSetShareAccess()
- remove obsolete checks in IoCheckShareAccess() and IoUpdateShareAccess() to simplify them

svn path=/trunk/; revision=14223
2005-03-20 15:54:22 +00:00
Thomas Bluemel
8b9646ca2a - only mask out the generic rights flags in RtlMapGenericMask()
- only deny access when requested rights can't be granted in IoCheckDesiredAccess()

svn path=/trunk/; revision=14222
2005-03-20 13:53:54 +00:00
Magnus Olsen
fb157f301a this waring break the head for me
pnp.c:141: warning: 'Affinity' might be used uninitialized in this function
{standard input}: Assembler messages:

initialized it with Affinity = 0;

svn path=/trunk/; revision=14221
2005-03-20 13:32:27 +00:00
Filip Navara
d73103f0f2 Fix a cut & paste error.
svn path=/trunk/; revision=14220
2005-03-20 13:10:57 +00:00
Filip Navara
2d8afa8978 Allow the lpTemplateDirectory parameter to be NULL in CreateDirectoryExA.
svn path=/trunk/; revision=14219
2005-03-20 13:10:11 +00:00
Eric Kohl
439e6fd789 Improve error messages.
Don't start counting the type_offset for each new fuction. It is a global offset.
Use only basic types in type- and proc-strings (e.g. unsigned long -> long).


svn path=/trunk/; revision=14218
2005-03-20 13:06:11 +00:00
Filip Navara
05bc884b35 - Rename bitblt.c to more generic bitmap.c.
- Normalize BITMAPINFO structure in CreateDIBSection before sending it to win32k.

svn path=/trunk/; revision=14217
2005-03-20 12:30:06 +00:00
Hervé Poussineau
abb9dfec3b Add legacy detection of COM3 and COM4
Be ready for PnP serial ports
Don't hardcode base addresses and irq twice

svn path=/trunk/; revision=14216
2005-03-20 12:15:51 +00:00
Hervé Poussineau
fcc7d2acc7 Implement IoReportDetectedDevice
svn path=/trunk/; revision=14215
2005-03-20 12:15:33 +00:00
Filip Navara
4cae592ec2 Fix nasty condition when we were subtracting AlignedAddress (which happened to be aligned to 0x80000000) from HighestAddress (which is MmSystemRangeStart - 1 == 0x7fffffff) and then using it for length comparsion.
svn path=/trunk/; revision=14214
2005-03-20 12:04:30 +00:00
Filip Navara
b0fb19733c Fix the AdjustTokenPrivileges call once more.
svn path=/trunk/; revision=14213
2005-03-20 11:35:39 +00:00
Thomas Bluemel
0e847f36a6 fixed AdjustTokenPrivileges() call
svn path=/trunk/; revision=14212
2005-03-20 11:22:50 +00:00
Magnus Olsen
a98111e50f Complete the dummy of HAL.
CreateDirectDraw and CreateDirectDrawEx
will return a pointer of ddraw object.
only hardware acclration support are being add.
noting real working yet. 

svn path=/trunk/; revision=14211
2005-03-20 09:58:10 +00:00
Hartmut Birr
f0e4451f31 Fixed the required access rights for formating a disk.
svn path=/trunk/; revision=14210
2005-03-20 09:46:13 +00:00
Filip Navara
572aa1faf4 Minor correction to NtAdjustPrivilegesToken to keep it from returning total junk.
svn path=/trunk/; revision=14209
2005-03-20 01:58:54 +00:00
Filip Navara
c29c8b9124 Revert the last change to device stack attaching.
svn path=/trunk/; revision=14208
2005-03-20 00:53:24 +00:00
Filip Navara
621ded7636 Attach the PDOs to device stack and report device unique IDs if available.
svn path=/trunk/; revision=14207
2005-03-20 00:33:36 +00:00
Magnus Olsen
e7f2044681 did forget these two file
svn path=/trunk/; revision=14206
2005-03-19 23:52:04 +00:00
Magnus Olsen
8b29e58251 update directx d3d and draw header to Wine-20050310
so the work on ddraw dll can continue. 



svn path=/trunk/; revision=14205
2005-03-19 23:47:52 +00:00
Filip Navara
edda3944bc Forgot to add this file in revision 14203.
svn path=/trunk/; revision=14204
2005-03-19 22:50:11 +00:00
Filip Navara
1e7a5224aa - Replace the ColorMap pointer in BITMAPOBJ with palette handle and
correctly free it when the bitmap is about to be destroyed. Also
  get rid of some palette leaks when DIBs were selected into device
  context.
- Refine GDI32 -> Win32k interface for creating and managing brushes.
  Remove NtGdiCreateBrushIndirect, NtGdiCreateDIBPatternBrush,
  NtGdiCreateDIBPatternBrushPt and NtGdiFixBrushOrgEx syscalls and
  add NtGdiCreateDIBBrush.
- Implement basic support for DIB pattern brushes.
- Add user mode helper routine for "normalizing" BITMAPINFO structure.
- Add definition for BITMAPV5HEADER.

svn path=/trunk/; revision=14203
2005-03-19 22:15:02 +00:00
Filip Navara
db3d786f03 Specify correct buffer size in GetPrivateProfileStringW calls.
svn path=/trunk/; revision=14202
2005-03-19 21:48:33 +00:00
Magnus Olsen
8da44c3750 add more code.
start create a protype of hal, that can be use also for
software emulation mode. 

svn path=/trunk/; revision=14201
2005-03-19 20:39:25 +00:00
Alex Ionescu
a04bad112d Oops
svn path=/trunk/; revision=14200
2005-03-19 20:29:19 +00:00
Alex Ionescu
396ff5690c Correct NtW32call to call correct kernel function, add placeholder for SEH, implement KeUserModeCallback (right now a copy of the old code). Part I of an incomplete W32Callback rewrite, just to set up the groundwork to make testing easier. Might look ugly/messy now but it'll be clean soon
svn path=/trunk/; revision=14199
2005-03-19 20:26:46 +00:00
Filip Navara
52a70e745d Fix indentation.
svn path=/trunk/; revision=14198
2005-03-19 19:52:36 +00:00
Thomas Bluemel
6c8fad94ac - correctly deny access to handles when rights requested can't be granted
- map generic rights correctly
- various fixes where handles with inappropriate access rights were created

svn path=/trunk/; revision=14197
2005-03-19 19:13:01 +00:00
Emanuele Aliberti
6f3c732b92 winsta.dll raw stubs
svn path=/trunk/; revision=14196
2005-03-19 18:31:14 +00:00
Magnus Olsen
9cb33ba90d geting update version of ddraw.h working with gdi32.h
thanks filip. 

svn path=/trunk/; revision=14195
2005-03-19 18:28:01 +00:00
Magnus Olsen
dd212d63c9 update the ddraw.h header ageinst Wine-20050310
so the work on ddraw dll can continue. 

this header file have been modify to geting reactos compile and add one struct and fix some protypes that was wrong.

svn path=/trunk/; revision=14194
2005-03-19 18:26:45 +00:00
Filip Navara
ee054cd0f4 Export the HOST variable even on Windows.
svn path=/trunk/; revision=14193
2005-03-19 17:22:02 +00:00
Aleksey Bragin
1ca3f8ce13 Fix a very small typo - "VfatFormat() done" to "VfatxFormat() done"
svn path=/trunk/; revision=14192
2005-03-19 17:11:15 +00:00
Magnus Olsen
229fed0315 lite more code.
nothing works yet. 
add some check see if the parama are right. 

svn path=/trunk/; revision=14191
2005-03-19 10:22:52 +00:00
Martin Fuchs
e24c42bb6b - unregister task manager window at termination
svn path=/trunk/; revision=14190
2005-03-19 09:37:46 +00:00
Martin Fuchs
cf95dc8b1b - remove old experimental shell hook code
svn path=/trunk/; revision=14189
2005-03-19 09:37:24 +00:00
Hartmut Birr
0692378689 Added two missing dereferencing calls in ObReferenceObjectByHandle.
Checked also for NtCurrentThread in NtDuplicateObject.  
Used the return value from InterlockedIncrement to check for a correct handle count.

svn path=/trunk/; revision=14188
2005-03-19 09:18:58 +00:00
Hartmut Birr
c2a04f5107 Added two missing dereferencing calls in NtTerminateThread.
svn path=/trunk/; revision=14187
2005-03-19 09:14:21 +00:00
Filip Navara
e54de54618 - Fix acpi_os_get_thread_id to return 1-based thread ids (instead of zero-based ones).
- Zero the owner_id field while initializing acpi_gbl_acpi_mutex_info.

svn path=/trunk/; revision=14186
2005-03-19 02:18:49 +00:00
Royce Mitchell III
8b3af26269 fix warning that is really a bug - from looking at the code, wDevID, is a UINT, not a UINT_16
svn path=/trunk/; revision=14185
2005-03-19 01:37:47 +00:00
Alex Ionescu
e389f0c999 Implement timer expiring too fast for KeDelayExecutionThread. Dedicated to filip
svn path=/trunk/; revision=14184
2005-03-18 23:26:44 +00:00
Martin Fuchs
0412c84cea register ourselved as task manager window to make the RegisterShellHookWindow() call working [thanks to Filip :)]
svn path=/trunk/; revision=14183
2005-03-18 23:00:54 +00:00
Martin Fuchs
a5b6da0234 cleanup of latest RegisterShellHookWindow() changes
svn path=/trunk/; revision=14182
2005-03-18 20:34:01 +00:00
Gunnar Dalsnes
846dc1aebe -remove incorrect handle count check when deleting files
-reformat code

svn path=/trunk/; revision=14181
2005-03-18 19:36:36 +00:00
Hervé Poussineau
f0bec76acd Fix a warning with some compilers about non-initialized variable.
This can't really happen in real execution, but let's be the compiler happy ;)

svn path=/trunk/; revision=14180
2005-03-18 19:00:48 +00:00
Hervé Poussineau
64944b49f7 Don't double-define STATUS_ARRAY_BOUNDS_EXCEEDED
svn path=/trunk/; revision=14179
2005-03-18 17:45:59 +00:00
Hervé Poussineau
301637bbde Implement partly IoReportResourceForDetection() and IoReportDetectedDevice(), just enough to support serial driver
svn path=/trunk/; revision=14178
2005-03-18 16:51:39 +00:00
Hervé Poussineau
08da4a07b0 Implement legacy detection (it should be able to detect the first two serial ports)
Implement reading by polling (expect lots of bugs!)
Use receive and send queues
Better handling of some IRPs
Lots of small bugs fixes

svn path=/trunk/; revision=14177
2005-03-18 16:01:35 +00:00
Thomas Bluemel
343e3f7bdc can't receive the cid from a KTHREAD structure, fixes compiling with debugging enabled
svn path=/trunk/; revision=14176
2005-03-18 13:52:21 +00:00
Alex Ionescu
c2c6049107 Update ETHREAD fields and termination port stucture to XP, and do necessary code changes. This makes reaping even faster. It's 2:30am, i hope there's no bugs ;-)
svn path=/trunk/; revision=14175
2005-03-18 07:19:30 +00:00
Alex Ionescu
eb54434d27 Thread/Process Termination/Repeaing Rewrite + Fixes
---------------------------------------------------

    - ps/cid.c: 
            * Moved CID Lookup functions here
            
    - ps/security.c: 
            * Moved all security related functions here. Makes other files neater and security functions
              easier to locate.
              
    - ps/thread.c: 
            * Moved most of the Thread Scheduling/Dispatching code that belongs in the Kernel to /ke and
              renamed functions from Ps to Ki.
            * Implemented PsIsSystemThread.
            * Removed Reaper Thread Init (now obsolete).
            * Renamed PiDeleteThread to PspDeleteThread.
            * Moved Thread State functions from tinfo.c to here.
            
    - ps/process.c:
            * Removed Query/Set Process functions and moved to ps/query.c
            * Renamed PiDeletePRocess to PspDeleteProcess
            * Removed obsoleted Process Termination functions, moved persistent one to kill.c
    
    - ps/create.c:
            * Moved the security APIs to security.c
            * Correctly implemented PsCreateSystemThread to actually create system threads.
        
            
    - ps/suspend.c
            * Rewrote Nt Executive functions to use Kernel functions.
            * Moved Ps* Routines into ke/kthread.c and fixed them. The implementation was wrong in
              some aspects, especially the issue of the APC looping around the KeWaitXxx call and the
              fact that the routines excluded/ignored the FreezeCount.
            
    - ps/debug.c
            * Fixed completely broken implementation of Get/SetThreadContext. The old version crashed
              when called and did not work at all. Suspend Regression test now works.
            * Moved Context<->TrapFrame functions to ke/i386/
            * Combined Set/GetThreadContext APCs into a single one, and used special context structure.
            
    - ps/query.c:
            * Moved Thread/Process Query/Set Routines here.
            
    - ps/tinfo.c:
            * Removed.
            
    - ps/kill.c
            * Removed complicated Process Termination semantics and useless Attach/Detach in favor for
              a much more lightweight function which performs the same tasks as before and actually works.
              TaskManager can now terminate foreign processes.
            * Rewrote Thread Reaping to use the HyperCritical Work Queue instead of manually controlled
              thread. This results in much less code as well as an increase in speed and less micro
              management. The reaper is PspReapRoutine. Closing CMD.EXE now works properly without
              requiring masks that were added as hacks to allow it.
            * Renamed PiTerminateProcessThreads to PspTerminateProcessThreads. Fixed it to work with new
              termination code.
            * Added PspDeleteProcess to handle Process Object deletion. Kills the CID Handle here as done
              by Hartmut.
            * Added PspDeletethread here.
            * Renamed and rewrote PsTerminateCurrentThread to PspExitThread. Used NT Implementation out-
              lined in Windows Internals, Chapter 13. Uses less locks, a more concise order of actions,
              actually parses the Termination Ports, handles Dbgk notification. Timers are now rundown,
              and Mutex rundown is in a dedicated Kernel function. Final termination handled by KeTerminate
              Thread as documented.
            * Renamed PsTerminateOtherThread to PspTerminateThreadByPointer and modified implementation to
              be compatible with the changes above.
            * Renamed and regrouped Process Termination into PspExitProcess. Also implemented as described
              above, and moved each subsystem specific termination helper into its own subsytem.
            * Improved NtTerminateProcess and added more debugging messages.
            * Improved NtTerminateThread and added check against System Thread and made it compatible with
              new implementation.
            * Corrected PsTerminateSystemThread now that we support System Threads.
            * Corrected NtRegisterThreadTerminatePort to use same structure name as on windows for the 
              port, and added tag to pool allocation (documented in pooltag.txt)
    
    include/internal/*.h:
    
            * Defined Scheduler Functions and misc new functions or renamed functions.
            
    ke/apc.c:
    
            * Fixed critical bug where APCs were not delivered at all if the thread wastion and cancels any timers that are associated
              to a thread, as well as their APCs and DPCs.
      
    REGRESSIONS FOUND: NONE
    
    BUGS/REGRESSIOSN FIXED:
                * Thread/Get Set Context now works.
                * Suspend Regression test now works.
                * Task manager can now kill foreign processes, even hung ones (like it should).
                * ExitProcess/closing cmd.exe with the 'x' button now works correctly without hacks.
      KNOWN ISSUES: I left a bit of a mess in the headers and some stuff still needs to be moved into the right 
                  places. I just wanted to have this first part ready first, so that it won't get too big.

svn path=/trunk/; revision=14174
2005-03-18 05:53:04 +00:00
Art Yerkes
604f4f13c1 Added simple dword OID query to lan.
Correct oper status, admin status and type settings in iinfo.
Small fixes in lan.c for adapter name.

svn path=/trunk/; revision=14173
2005-03-18 03:26:12 +00:00
Art Yerkes
59c145b801 Don't let sign extension mess us up here.
svn path=/trunk/; revision=14172
2005-03-18 02:56:29 +00:00
Filip Navara
e52a450d86 - Correctly initialize the standard handles for console-less applications.
- Simplify _isatty and fix it to not set the errno for "invalid" handles.

svn path=/trunk/; revision=14171
2005-03-18 02:10:50 +00:00
Steven Edwards
b4e1db6c92 Lined up Buttons.
Removed my broken attempt at understaind comboboxes.
Cleaned up WM_INITDIALOG.

svn path=/trunk/; revision=14170
2005-03-18 00:56:34 +00:00
Filip Navara
e995509c26 It's not exactly wise to call GetFileTime and CloseHandle with invalid handle, so don't do it.
svn path=/trunk/; revision=14169
2005-03-17 23:52:28 +00:00
Filip Navara
b8419654bd Don't try to release mutex with NULL handle. Also prevent releasing the same mutex twice.
svn path=/trunk/; revision=14168
2005-03-17 23:16:12 +00:00
Filip Navara
310a5bcfb7 Don't try to duplicate NULL handles.
svn path=/trunk/; revision=14167
2005-03-17 22:40:19 +00:00
Filip Navara
a384c6e670 (GDIOBJ_SetOwnership): Don't try to decrease the GDI object counter for global handles since they're not associated with process.
svn path=/trunk/; revision=14166
2005-03-17 22:00:19 +00:00
Magnus Olsen
02755a61f0 more stuff for ddraw.dll not tested yet.
svn path=/trunk/; revision=14165
2005-03-17 20:15:44 +00:00
Hartmut Birr
eabbaacd53 Don't close the handle if the write back does fail (in NtOpenProcessTokenEx).
svn path=/trunk/; revision=14164
2005-03-17 19:35:16 +00:00
Steven Edwards
fc4c441263 Dedicated to Alex.
I give to you "The ReactOS License Manager"

No its just a dummy dialog I wrote to learn how to make
Control Panel Applets. Please don't implement this.

svn path=/trunk/; revision=14163
2005-03-17 19:03:55 +00:00
Hartmut Birr
100f53e3ab - Moved the deleting of the process id from PiTerminateProcess to PiDeleteProcessWorker.
- Checked the status at the end of NtOpenProcessTokenEx.

svn path=/trunk/; revision=14162
2005-03-17 18:51:20 +00:00
Aleksey Bragin
a392c38668 One more assert added, but unfortunately it isn't triggered currently...
svn path=/trunk/; revision=14161
2005-03-17 16:09:12 +00:00
Filip Navara
f60f345d30 - Don't try to kill non-existing timers.
- Close dialog using EndDialog instead of DestroyWindow.

svn path=/trunk/; revision=14160
2005-03-17 13:17:05 +00:00
Filip Navara
643a182dd0 Now that CSRSS is getting unloaded we must unregister the primitive message queue when it's about to be destroyed.
svn path=/trunk/; revision=14159
2005-03-17 13:07:28 +00:00
Gunnar Dalsnes
cd4a8585a8 scanf: fix handling of %n token
svn path=/trunk/; revision=14157
2005-03-17 00:31:40 +00:00
Gunnar Dalsnes
9019d252be scanf: fix handling of %n token
svn path=/trunk/; revision=14154
2005-03-16 23:59:41 +00:00
Robert Kopferl
847aa89893 To do once more a little piece os2ss
svn path=/trunk/; revision=14153
2005-03-16 23:51:26 +00:00
Magnus Olsen
1020ee4805 add regsvr.c from wine as frist implement of ddraw.
so it can registrate it selv into the register. 

svn path=/trunk/; revision=14152
2005-03-16 23:23:44 +00:00
Magnus Olsen
c72257a26f small change to start to implement ddraw.dll
svn path=/trunk/; revision=14151
2005-03-16 23:21:00 +00:00
Magnus Olsen
d1274928bb small change to start to implement ddraw.dll
svn path=/trunk/; revision=14150
2005-03-16 23:17:33 +00:00
Gé van Geldorp
8753158ddb Add riched20.dll, msi.dll and msiexec.exe to bootcd
svn path=/trunk/; revision=14149
2005-03-16 22:52:55 +00:00
Hervé Poussineau
b6ef4c6ee6 Better NtUserEnumDisplayDevices stub
svn path=/trunk/; revision=14148
2005-03-16 22:27:47 +00:00
Hervé Poussineau
96b374677d Implement resolution and color depth selection.
Applying new settings doesn't work due to unimplemented NtUserChangeDisplaySettings

svn path=/trunk/; revision=14147
2005-03-16 22:19:12 +00:00
Gé van Geldorp
4dde3a1c21 Fix eol-style
svn path=/trunk/; revision=14146
2005-03-16 22:18:42 +00:00
Filip Navara
37c4d8279f Initialize the pGdiInfo->flRaster field to zero.
svn path=/trunk/; revision=14145
2005-03-16 21:28:21 +00:00
Klemens Friedl
c79360a933 Mindflyer, a.k.a. mf <mf@mufunyo.net>
alternative icon files
* mycomputer icon
* terminal icon

svn path=/trunk/; revision=14144
2005-03-16 21:18:33 +00:00
Filip Navara
baefc0115b Fix some logic in port management code.
svn path=/trunk/; revision=14143
2005-03-16 21:03:51 +00:00
Thomas Bluemel
d86736989a Rouven Wessling <rouven@rouvenwessling.de>:
calc:
- fixed spelling mistakes
ncpa, aclui:
- German translation

svn path=/trunk/; revision=14142
2005-03-16 20:36:02 +00:00
Filip Navara
11c6007bb9 Ulrich Czekalla <ulrich@codeweavers.com>
Set WS_EX_CONTROLPARENT when dialog has DS_CONTROL.
Mike McCormack <mike@codeweavers.com>
Strip WS_CAPTION and WS_SYSMENU for child dialogs.

svn path=/trunk/; revision=14141
2005-03-16 20:13:55 +00:00
Aleksey Bragin
31046fef6e Ivan Semenoff <ivans77@mail.ru>
Fixed a bug in RtlClearBits (asserting if startingindex+count is more than size, instead of silently continuing processing).

svn path=/trunk/; revision=14140
2005-03-16 19:27:45 +00:00
Hervé Poussineau
4d47498931 Saveliy Tretiakov <saveliyt@mail.ru>
- Only one file may be open on a port at any given time
- Implemented IOCTL_SERIAL_GET_STATS and IOCTL_SERIAL_CLEAR_STATS

svn path=/trunk/; revision=14139
2005-03-16 19:24:41 +00:00
Gé van Geldorp
ba0f1263e4 Reapply Wine-20050310 changes, this time with the changes
to the include files. Where's CIS when you need it :P

svn path=/trunk/; revision=14138
2005-03-16 17:30:11 +00:00
Gregor Anich
9577665661 Rename patch to binpatch in apps/utils
svn path=/trunk/; revision=14137
2005-03-16 16:25:54 +00:00
Gregor Anich
c165636757 Rename patch to binpatch.
svn path=/trunk/; revision=14136
2005-03-16 16:24:20 +00:00
Gregor Anich
a00d9b33dc Simple patch-creation tool (not much tested, but should work)
svn path=/trunk/; revision=14135
2005-03-16 14:01:52 +00:00
Hervé Poussineau
534636f9ce Revert revision 14118 changes
svn path=/trunk/; revision=14134
2005-03-16 12:33:26 +00:00
Magnus Olsen
9189284a9d implemnet NtGdiDdGetDriverInfo and NtGdiDdWaitForVerticalBlank
it is untested. 

svn path=/trunk/; revision=14133
2005-03-16 11:50:24 +00:00
Hervé Poussineau
89cc6c3c47 Christoph von Wittich <Christoph@ApiViewer.de>
Added Unicode support and fixes cannot compile problem

svn path=/trunk/; revision=14132
2005-03-16 11:26:14 +00:00
Gé van Geldorp
080bf05b6d Thomas Larsen <sikker2004@yahoo.com>
- Danish Translation

svn path=/trunk/; revision=14131
2005-03-16 09:45:26 +00:00
Gé van Geldorp
f07f87eb09 Thomas Larsen <sikker2004@yahoo.com>
- Danish translation

svn path=/trunk/; revision=14130
2005-03-16 09:42:40 +00:00
Gé van Geldorp
bb2b8992b4 Thomas Larsen <sikker2004@yahoo.com>
- updated danish language

svn path=/trunk/; revision=14129
2005-03-16 09:22:30 +00:00
Gé van Geldorp
53ac0de2ad Thomas Larsen <sikker2004@yahoo.com>
- added danish language

svn path=/trunk/; revision=14128
2005-03-16 09:19:12 +00:00
Gé van Geldorp
03cf4fc8db Thomas Larsen <sikker2004@yahoo.com>
- added danish language

svn path=/trunk/; revision=14127
2005-03-16 09:16:13 +00:00
Gé van Geldorp
6b116da4a1 Thomas Larsen <sikker2004@yahoo.com>
- added danish language

svn path=/trunk/; revision=14126
2005-03-16 09:13:28 +00:00
Gé van Geldorp
206cbe2545 Thomas Larsen <sikker2004@yahoo.com>
- added danish language

svn path=/trunk/; revision=14125
2005-03-16 09:10:23 +00:00
Art Yerkes
ff056457a2 consw has not been needed for a long time.
svn path=/trunk/; revision=14124
2005-03-16 09:02:07 +00:00
Gé van Geldorp
e95a8de179 Update status
svn path=/trunk/; revision=14120
2005-03-16 08:34:44 +00:00
Gé van Geldorp
23265de0b9 Sync to Wine-20050310:
Michael Jung <mjung@iss.tu-darmstadt.de>
- Beginning of a shell namespace extension to browse the unix
  filesystem.
- Fixed parsing of ITEMIDLIST in InitializeTreeView.
- Added some documentation.
- Fixed a crash occuring when the user double-clicks a leaf item.
Dimitrie O. Paun <dpaun@rogers.com>
- Add support for .exe's with exported functions.
Francois Gouget <fgouget@free.fr>
- Assorted spelling fixes.
- Add the -noname flag to match the Platform SDK.
- Don't hardcode ordinals if which are not hardcoded on Windows.
Juan Lang <juan_lang@yahoo.com>
- Convert more API calls to Unicode.
- Convert tabs to space, wrap long lines, make indenting consistent.
- Convert a few calls to Unicode.
Mike McCormack <mike@codeweavers.com>
- handle IFileSystemBindData in ISF_Desktop_fnParseDisplayName
- more Unicode conversion
- handle IFileSystemBindData in IShellFolder::ParseDisplayName
- convert IShellFolder::ParseDisplayName to use Unicode
- Remove tabs and make formatting consistent.
- Reindent some code to improve readability.
- Define some extra SHFGI values.
- Remove tabs and reformat.
- Use lstrcmpiA in preference to strcasecmp.
- Make lstr* functions inline inside Wine.
- implement loading and saving of MSI advertised shortcut info
- make more test cases pass
- read and write the location block
- improve the binary compatibility of lnk files
- Cleanup, create unicode versions of _ILCreateFromPath,
  _ILCreateGuidFromStr, and _ILCreateFromFindData.
Jon Griffiths <jon_p_griffiths@yahoo.com>
- Documentation spelling fixes.
Hans Leidekker <hans@it.vu.nl>
- Revert wrong -noname markup for Drag*, DoEnvironmentSubst and
  SHGetNewLinkInfo{A,W}.
- Also mark stub exports -noname when they are exported by ordinal
  only on win98/2k.
- Implementation level stubs for SheChangeDirA, SheGetDirA,
  SHHelpShortcuts_RunDLL{A,W}.
- New spec file stubs for Control_RunDLLAsUserW,
  FixupOptionalComponents, OCInstall, SHChangeNotifySuspendResume,
  SHCreateProcessAsUserW, SHExtractIconsW,
  SHInvokePrinterCommand{A,W}, SHIsFileAvailableOffline,
  SHLoadNonloadedIconOverlayIdentifiers, SHPathPrepareForWrite{A,W},
  ShellExec_RunDLL{,A,W}, SHGetIconOverlayIndex{A,W}.
- Mark exports -noname when they are exported by ordinal only on
  win98/2k.
Marcelo Duarte <wine-devel@bol.com.br>
- Update the resources for Portuguese.
Filip Navara <xnavara@volny.cz>
- Don't crash if ShellFolder doesn't implement the IID_ISFHelper
  interface.
Dmitry Timoshkov <dmitry@codeweavers.com>
- Fix prototypes of GetClassLongA/W, GetClassLongPtrA/W and
  SetClassLongA/W according to SDK definitions.
- Add prototypes for SetClassLongPtrA/W, protect some GWL_ and GCL_
  constants from using in Wine or in _WIN64 mode.
- Fix all places in Wine affected by the above changes.
- Convert winemenubuilder to unicode.
Alex Villacis Lasso <a_villacis@palosanto.com>
- Change SUBLANG_DEFAULT to SUBLANG_NEUTRAL for LANG_SPANISH in all
  resources, so that Spanish locales other than Spain also use Spanish
  resources.
Marcus Meissner <marcus@jet.franken.de>
- Output some more informations.
- Mark one global variable static.
Huw Davies <huw@codeweavers.com>
- SetPath("") should return S_OK.
  SetPath("nonexistent_path") should return S_FALSE.
- Don't prepend '\\' to the subkey name.
Joris Huizer <jorishuizer@planet.nl>
- renamed file_operation_delete and to shfileops_delete
- renamed file_operation_checkFlags to shfileops_check_flags
- added helper function shfileops_do_operation()
- added helper function shfileops_get_parent_attr()
- added helper function shfileops_get_parent_attr2()
- various cleanups in SHFileOperationW using these functions
Ge van Geldorp <gvg@reactos.com>
- Error numbers >= 32 are to be expected.

svn path=/trunk/; revision=14118
2005-03-16 07:51:01 +00:00
Alex Ionescu
4bf67aaf0f Fix dillo/vncviewer regressions (semaphore bug). thanks to art and waxdragon for notifying me of the regressions.
svn path=/trunk/; revision=14117
2005-03-16 03:12:32 +00:00
Gé van Geldorp
fbfe053b9b Don't crash when debugger asks for invalid memory location
svn path=/trunk/; revision=14116
2005-03-15 23:47:13 +00:00
Filip Navara
82c445e96b Accidently forgot to disable the debug messages.
svn path=/trunk/; revision=14115
2005-03-15 23:33:54 +00:00
Filip Navara
1fa5efe3d7 Don't use uninitialized variable in FdoQueryBusRelations.
svn path=/trunk/; revision=14114
2005-03-15 23:27:36 +00:00
Filip Navara
40b71ac19d Fix broken logic in PoInit.
svn path=/trunk/; revision=14113
2005-03-15 23:02:51 +00:00
Filip Navara
3f249a0a67 Set the ACPI flag in loader block *after* performing the ACPI detection.
svn path=/trunk/; revision=14112
2005-03-15 23:02:12 +00:00
Gregor Anich
d001f75197 Improve the WNDOBJ implementation a bit... There are still some problems with the visible area when a window is overlapped by another one...
svn path=/trunk/; revision=14111
2005-03-15 22:26:12 +00:00
Gé van Geldorp
d24e173122 Don't disable debugging just because we want the debug
prints to go to the screen or serial port

svn path=/trunk/; revision=14110
2005-03-15 22:14:22 +00:00
Gregor Anich
43bfb5dd4e Allow mapping of MDLs which describe I/O memory (device memory) into usermode. I hope the changes are correct :-/
svn path=/trunk/; revision=14109
2005-03-15 22:07:05 +00:00
Filip Navara
23475fc1f9 Don't access the Irp->User* fields in NpfsSignalAndRemoveListeningServerInstance. The I/O manager will safely do that for us.
svn path=/trunk/; revision=14108
2005-03-15 22:06:41 +00:00
Gé van Geldorp
cea2f0f1d2 Aric Stewart <aric@codeweavers.com>
- The values are quoted and spaces added, so having spaces in the
  properties results in spaces in the values which is incorrect.

svn path=/trunk/; revision=14107
2005-03-15 21:46:14 +00:00
Gé van Geldorp
67b97bc9ef Sync to Wine-20050310:
Jeremy White <jwhite@codeweavers.com>
- Aggressively round up to the proper alignment when reporting position
  on streams where we are converting up.
- When we are converting from one sample rate to another, we do have to
  adjust when calculating TIME_SAMPLES.
Alex Villacis Lasso <a_villacis@palosanto.com>
- Change SUBLANG_DEFAULT to SUBLANG_NEUTRAL for LANG_SPANISH in all
  resources, so that Spanish locales other than Spain also use Spanish
  resources.
Robert Reif <reif@earthlink.net>
- Added parameter checking to timeGetDevCaps.
- Added timer tests.
Christian Costa <titan.costa@wanadoo.fr>
- Added some more cases to MCI_MapMsgAtoW.
- Fixed offsets calculations.

svn path=/trunk/; revision=14106
2005-03-15 21:44:42 +00:00
Steven Edwards
f4ccfedf3e Use the new ReactOS icon for the boot cd.
svn path=/trunk/; revision=14105
2005-03-15 21:39:07 +00:00
Gé van Geldorp
aafd813531 Francois Gouget <fgouget@free.fr>
- Add a comment explaining why CDLGetLongPathName[AW] and
  IsJITInProgress have hardcoded ordinals.

svn path=/trunk/; revision=14104
2005-03-15 21:38:57 +00:00
Gé van Geldorp
33d7cd5d53 Sync to Wine-20050310:
Dmitry Timoshkov <dmitry@codeweavers.com>
- Fix prototypes of GetClassLongA/W, GetClassLongPtrA/W and
  SetClassLongA/W according to SDK definitions.
- Add prototypes for SetClassLongPtrA/W, protect some GWL_ and GCL_
  constants from using in Wine or in _WIN64 mode.
- Fix all places in Wine affected by the above changes.
Jon Griffiths <jon_p_griffiths@yahoo.com>
- Documentation spelling fixes.
Thomas Weidenmueller <wine-patches@reactsoft.com>
- Forward to user32 when appropriate.
Alex Villacis Lasso <a_villacis@palosanto.com>
- Change SUBLANG_DEFAULT to SUBLANG_NEUTRAL for LANG_SPANISH in all
  resources, so that Spanish locales other than Spain also use Spanish
  resources.

svn path=/trunk/; revision=14103
2005-03-15 21:36:47 +00:00
Gé van Geldorp
ef5b410045 Sync to Wine-20050310:
Jonathan Ernst <Jonathan@ErnstFamily.ch>
- Add French resources.
Henning Gerhardt <henning.gerhardt@web.de>
- Add/updated German resources.
Marcelo Duarte <wine-devel@bol.com.br>
- Update the resources for Portuguese.
- Use "MS Shell Dlg" everywhere except for Japanese.
Juan Lang <juan_lang@yahoo.com>
- Fix a crash if the Mozilla ActiveX control doesn't implement
  DllCanUnloadNow.

svn path=/trunk/; revision=14102
2005-03-15 21:30:32 +00:00
Gunnar Dalsnes
cb05e516a2 fixed GetTempFileNameA/W by ripping from wine
impl. GetLongPathNameA/W by ripping from wine
impl. EnumResourceNamesA/W by ripping from wine
Use common routines for filename A2W/W2A conversion (wine inspired)
impl. ReadDirectoryChangesW (kmode part is not workin yet)
fixed RtlSetCurrentDirectory_U (dont convert to long path)

svn path=/trunk/; revision=14101
2005-03-15 19:40:22 +00:00
Hartmut Birr
e035ce116b On smp machines, unmap all low memory pages (except page 2 and 3).
svn path=/trunk/; revision=14100
2005-03-15 17:38:54 +00:00
Hartmut Birr
2423a80b6b Prevent from accessing DpcEvent in the KPCR structure, because it is currently a NULL pointer.
svn path=/trunk/; revision=14099
2005-03-15 17:35:27 +00:00
Filip Navara
37ac253ad6 Fix debug messages.
svn path=/trunk/; revision=14098
2005-03-15 15:58:36 +00:00
Filip Navara
68ed284f6e Cleanup misleading code.
svn path=/trunk/; revision=14097
2005-03-15 15:57:45 +00:00
Hervé Poussineau
9b56503fc8 Disable serial driver as it is in conflit with sermouse and debug output
svn path=/trunk/; revision=14096
2005-03-15 14:47:41 +00:00
Gé van Geldorp
2850638aad Sync to Wine-20050310:
Americo Jose Melo <mmodem00@netvisao.pt>
Francois Gouget <fgouget@codeweavers.com>
- Translate the Wine resources to Portuguese.
Alex Villacfs Lasso <a_villacis@palosanto.com>
- Change SUBLANG_DEFAULT to SUBLANG_NEUTRAL for LANG_SPANISH in all
  resources, so that Spanish locales other than Spain also use Spanish
  resources.
Juan Lang <juan_lang@yahoo.com>
- Implement SetupDiGetClassDevsA/W, SetupDiEnumDeviceInterfaces,
  SetupDiDestroyDeviceInfoList, and SetupDiGetDeviceInterfaceDetailA for
  serial ports.
Hans Leidekker <hans@it.vu.nl>
- Don't use utf8 in rc files.
Ge van Geldorp <gvg@reactos.com>
- eol-style fixes

svn path=/trunk/; revision=14094
2005-03-15 11:38:15 +00:00
Gé van Geldorp
d4a5e08d97 Sync to Wine-20050310:
Alexandre Julliard <julliard@winehq.org>
- Avoid spaces before preprocessor directives, that's not portable.
Robert Shearman <rob@codeweavers.com>
- Add a stub implementation of RpcImpersonateClient.
- More tracing, particularly on error paths.
- ERROR_IO_PENDING is expected, so don't return an error.
Mike Hearn <mh@codeweavers.com>
- Suppress some useless warnings in the RPC runtime, and make a few
  TRACEs that were reporting problems into WARNs.

svn path=/trunk/; revision=14093
2005-03-15 09:22:34 +00:00
Gé van Geldorp
402686e69a Sync to Wine-20050310:
Mike McCormack <mike@codeweavers.com>
- Forward the RichEdit 1.0 control to the RichEdit 2.0 control.
- Don't clear ES_AUTO[HV]SCROLL in the edit control created by
  richedit.
- Remove unused declaration.
Francois Gouget <fgouget@free.fr>
- Assorted spelling fixes.
Jason Edmeades <us@the-edmeades.demon.co.uk>
- Make the edit field created from a richedit control which was created
  with ES_DISABLENOSCROLL, not have the ES_NUMBER style and hence accept
  alphanumeric input.

svn path=/trunk/; revision=14092
2005-03-15 09:08:16 +00:00
Gé van Geldorp
67347846ec Sync to Wine-20050310:
import

svn path=/trunk/; revision=14091
2005-03-15 09:04:29 +00:00
Gé van Geldorp
0eb4051a93 Make room for vendor import
svn path=/trunk/; revision=14090
2005-03-15 09:01:28 +00:00
Gé van Geldorp
f20f399309 Sync to Wine-20050310:
Alex Villacis Lasso <a_villacis@palosanto.com>
- Change SUBLANG_DEFAULT to SUBLANG_NEUTRAL for LANG_SPANISH in all
  resources, so that Spanish locales other than Spain also use Spanish
  resources.
- eol-style stuff

svn path=/trunk/; revision=14088
2005-03-15 08:10:52 +00:00
James Tabor
e7005a9352 eol-style native
svn path=/trunk/; revision=14086
2005-03-15 00:23:19 +00:00
Gé van Geldorp
f9279fd739 Sync to Wine-20050310:
Jacek Caban <jack@itma.pwr.wroc.pl>
- Implemented GetRecordInfoFromTypeInfo and GetRecordInfoFromGuid.
- Beginnig implementation of IRecordInfo.
- More implementation of IRecordInfo.
Maxime Bellenge <maxime.bellenge@laposte.net>
- Implements OleLoadPicturePath.
Jon Griffiths <jon_p_griffiths@yahoo.com>
- Use variant macros instead of accessing the union directly.
- Documentation spelling fixes.
Alex Villacis Lasso <a_villacis@palosanto.com>
- Implement OleFontImpl_QueryTextMetrics.
- Change SUBLANG_DEFAULT to SUBLANG_NEUTRAL for LANG_SPANISH in all
  resources, so that Spanish locales other than Spain also use Spanish
  resources.
Marcelo Duarte <wine-devel@bol.com.br>
- Update the resources for Portuguese.
Francois Gouget <fgouget@free.fr>
- Assorted spelling fixes.
Vincent Beron <vberon@mecano.gme.usherb.ca>
- Add a stub for OleLoadPicturePath().
Huw Davies <huw@codeweavers.com>
- The typelib cache should take the typelib resource index into
  account.
Mike Hearn <mh@codeweavers.com>
- Allow loading of builtin typelibs.
Marcus Meissner <marcus@jet.franken.de>
- Check for overflows with ClrUsed.

svn path=/trunk/; revision=14085
2005-03-14 23:44:13 +00:00
Gé van Geldorp
9bc71c43a2 Sync to Wine-20050310
svn path=/trunk/; revision=14084
2005-03-14 23:25:39 +00:00
Gé van Geldorp
9a10a39940 Sync to Wine-20050310:
Jon Griffiths <jon_p_griffiths@yahoo.com>
- Documentation spelling fixes.
Mike McCormack <mike@codeweavers.com>
- Implement and test IPropertySetStorage.
- Fix more incorrect uses of STGM_ enumerations.
- Add struct StorageBaseImpl at the start of derived structures instead
  of trying to keep the first members the same.
- StgOpenStorage shouldn't open zero length storage files.
- Shared reading of storage files requires STGM_TRANSACTED.
- Test and fix grfMode handling in StgOpenDocfile.
- Implement StgSetTimes.
Robert Shearman <rob@codeweavers.com>
- Better tracing.
- Small cleanup of creation functions.
- Rename apartment functions to become more object-oriented.
- Rename register_ifstub to marshal_object to more accurately describe
  what it does.
- Add new function, apartment_getoxid, to prepare for a possible
  future patch where remoting is started on demand.
- Move marshaling state machine into stub manager from ifstub.
- Add additional needed states for table-weak marshaling, as shown by
  tests.
- Protect external reference count from underflows/overflows.
- Make COM use the RPC runtime as the backend for RPC calls. Based on a
  patch by Ove Ksven.
- Invoke objects in STA's in the correct thread by sending messages to
  the hidden apartment window.
- Use I_RpcGetBuffer, instead of our own buffer routines to fix an
  occasional test crash caused by heap corruption.
- Zero the memory block passed to RpcServerRegisterIfEx so we don't
  pass garbage in some of the fields we don't fill in.
- Return the correct error code from create_server and fix two handle
  leaks.
- TODO update.
- Remove cruft left over from previous RPC backend implementation in
  the apartment structure.
- Don't pass an IPID by value for proxy_manager_create_ifproxy.
- Disable more of RPC_UnregisterInterface to prevent the RPC runtime
  using freed memory.
- Rename various external RPC backend functions so that they all have
  the same "RPC_" prefix.
- Reduce the timeout of the function that connects to a local server
  to 30s, like native.
- Make each ifproxy have its own channel buffer to fix a bug where a
  proxy with multiple interfaces could invoke the wrong stub buffer on
  the server.
- The Global Interface Table should do table-strong marshaling instead
  of normal marshaling so that an interface can be retrieved more than
  one time.
Mike Hearn <mh@codeweavers.com>
- Avoid infinite loop when doing a typelib marshalled
  IUnknown::QueryInterface by only doing an extra QI if requested IID is
  not equal to marshalled IID.
Rob Shearman <rob@codeweavers.com>
Mike Hearn <mh@codeweavers.com>
- Add re-entrancy tests to the test suite.
- Run RPCs on a new thread client side so we can pump the message
  loop.
Juan Lang <juan_lang@yahoo.com>
- Fix the calling convention of DllCanUnloadNow.
- Move vtbl to end of file and get rid of unnecessary prototypes.
- Implement StgCreatePropSetStg.
Joris Huizer <jorishuizer@planet.nl>
- A few memory checks avoiding memory leaks.
Francois Gouget <fgouget@free.fr>
- Assorted spelling fixes.
Paul Vriens <Paul.Vriens@xs4all.nl>
- Added some TRACE statements.

svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
Gé van Geldorp
8c43665c8d Sync to Wine-20050310
svn path=/trunk/; revision=14082
2005-03-14 22:56:02 +00:00
Gé van Geldorp
5df62c8577 Sync to Wine-20050310:
Ulrich Czekalla <ulrich@codeweavers.com>
- Add support for radio buttons.
- Allocate space for terminating null.
- Fix a memory leak.
- Prevent accessing freed memory in failure case.
Mike McCormack <mike@codeweavers.com>
- Add a border to the edit control, add some more controls.
- Implement SQL delete query.
- Move product, feature and component enumeration functions to
  registry.c.
- Make sure strings are null terminated.
- Fix up the summary information code a little.
- Allow MsiViewExecute to be called twice on the same query.
- Implement MsiDatabaseGetPrimaryKeys.
- MsiGetComponentPath should allow null pointers for pcchBuf and
  lpPathBuf.
- Remove const declaration from non-const function.
Jose Manuel Ferrer Ortiz <jmfo1982@yahoo.es>
- Added MSI Spanish resources.
Juan Lang <juan_lang@yahoo.com>
- Implement MsiEnumRelatedProducts.
- make sure msihandle2msiinfo is correctly matched with msiobj_release
- don't do redundant NULL checks
- Don't hardcode windows or system directories, correct a typo.
- Fix a regression in AppSearch.
Jonathan Ernst <Jonathan@ErnstFamily.ch>
- Add French resources.
Henning Gerhardt <henning.gerhardt@web.de>
- Add/updated German resources.
Marcelo Duarte <wine-devel@bol.com.br>
- Update the resources for Portuguese.
Francois Gouget <fgouget@free.fr>
- Assorted spelling fixes.
Alexandre Julliard <julliard@winehq.org>
- Avoid spaces before preprocessor directives, that's not portable.
Aric Stewart <aric@codeweavers.com>
- Text reformatting patch to clean up all the static strings.
- Implement the action RegisterFonts.
- Add the ExecuteAction handler.
- Store the keypath, and do refcounting and registration of SharedDLLs.
- Fix a bug with handing dword values in the registry.
- Fix bugs with writing registry keys where value == NULL.
- Make use of msidefs.h.
- Lay some groundwork for uninstalls.
- Update the installed state for components during CostFinalize. Laying
  groundwork to be able to start processing uninstall logic as well.
- Fixed problems with my code for finding the PackageCode.
- Stubs for MsiUseFeature.
- Do some basic work with registry component paths.
- Make sure formats like [\\]] and [\\[] work properly.
Steven Edwards <steven@codeweavers.com>
- Correct typo.
Marcus Meissner <marcus@jet.franken.de>
- Output some more informations.
- Mark one global variable static.

svn path=/trunk/; revision=14081
2005-03-14 22:54:57 +00:00
Emanuele Aliberti
9cc503a1b2 SMDLL + SMLIB (static code in SMSS.EXE)
SM now self registers for IMAGE_SUBSYSTEM_NATIVE.

svn path=/trunk/; revision=14080
2005-03-14 22:38:12 +00:00
Gé van Geldorp
f689818f82 Sync to Wine-20050310:
Marcelo Duarte <wine-devel@bol.com.br>
- Use "MS Shell Dlg" everywhere except for Japanese.
Alex Villacis Lasso <a_villacis@palosanto.com>
- Change SUBLANG_DEFAULT to SUBLANG_NEUTRAL for LANG_SPANISH in all
  resources, so that Spanish locales other than Spain also use Spanish
  resources.

svn path=/trunk/; revision=14079
2005-03-14 22:28:58 +00:00
Gé van Geldorp
cb8820f660 Sync to Wine-20050310:
Alexandre Julliard <julliard@winehq.org>
- Make sure to always pass valid QS_* flags to
  MsgWaitForMultipleObjects.
Christian Costa <titan.costa@wanadoo.fr>
- Implemented GetProperty method for keyboard device.

svn path=/trunk/; revision=14078
2005-03-14 22:24:35 +00:00
Gé van Geldorp
86f13a4752 Sync to Wine-20050310:
Marcelo Duarte <wine-devel@bol.com.br>
- Update the resources for Portuguese.
Dmitry Timoshkov <dmitry@codeweavers.com>
- Fix prototypes of GetClassLongA/W, GetClassLongPtrA/W and
  SetClassLongA/W according to SDK definitions.
- Add prototypes for SetClassLongPtrA/W, protect some GWL_ and GCL_
  constants from using in Wine or in _WIN64 mode.
- Fix all places in Wine affected by the above changes.
Jon Griffiths <jon_p_griffiths@yahoo.com>
- Documentation spelling fixes.
Alex Villacis Lasso <a_villacis@palosanto.com>
- Change SUBLANG_DEFAULT to SUBLANG_NEUTRAL for LANG_SPANISH in all
  resources, so that Spanish locales other than Spain also use Spanish
  resources.
Troy Rollo <wine@troy.rollo.name>
- Fix stack object overrun when an application calls ChooseFontA.
Mike Hearn <mh@codeweavers.com>
- Respect the flags member of the CHOOSEFONT structure, and don't
  attempt to process bogus strings.

svn path=/trunk/; revision=14077
2005-03-14 22:21:18 +00:00
Hervé Poussineau
78237daf70 Add registry entries for serial driver
svn path=/trunk/; revision=14075
2005-03-14 21:30:25 +00:00
Hervé Poussineau
df94eae35b Start of the serial driver:
Handle write support and some IOCTL codes
First serial port is mapped to COM3 and second serial port is mapped to COM4. This prevents conflicts with existing code.

svn path=/trunk/; revision=14074
2005-03-14 20:59:50 +00:00
Thomas Bluemel
42819f010e revert the changes i accidently made, sorry
svn path=/trunk/; revision=14065
2005-03-14 16:10:21 +00:00
Thomas Bluemel
9309c80c1b implemented the SystemInterruptInformation information class to fill the structure with empty data to make process explorer shut up
svn path=/trunk/; revision=14064
2005-03-14 16:04:12 +00:00
Thomas Bluemel
3f89e7fa88 ignore alignment checks for unimplemented information classes in NtQuery/SetInformationProcess(). This gets sysinternals' ProcessExplorer to run
svn path=/trunk/; revision=14063
2005-03-14 15:23:44 +00:00
Thomas Bluemel
5672781aa4 safely access buffers in NtReadVirtualMemory()
svn path=/trunk/; revision=14062
2005-03-14 15:22:46 +00:00
Thomas Bluemel
2f460387c0 fixed copy+paste mistake
svn path=/trunk/; revision=14061
2005-03-14 14:30:43 +00:00
Thomas Bluemel
666973de7f dereference processes when enumerating them was cancelled. Accidently removed that.
svn path=/trunk/; revision=14060
2005-03-14 13:42:38 +00:00
Thomas Bluemel
437f357dd1 report idling statistics from the idle process, not from the system process
svn path=/trunk/; revision=14059
2005-03-14 13:24:46 +00:00
Thomas Bluemel
009fddf0b2 group idle threads into the idle process
svn path=/trunk/; revision=14058
2005-03-14 13:18:29 +00:00
Gé van Geldorp
61c807a7ec Sync to Wine-20050310:
Martijn Vernooij <yuxdwa702@sneakemail.com>
- Scroll instead of repainting when expanding/collapsing trees.
- Don't repaint on hover if 'hot tracking' isn't on.
Francois Gouget <fgouget@free.fr>
- Add the -noname flag to match the Platform SDK.
- Assorted spelling fixes.
Maxime Bellenge <maxime.bellenge@laposte.net>
- Take into account the new size of a column when the header size
  change.
- Correctly displays the text with ellipsis when there is not enough
  room in a header item and an image from an imagelist is displayed on
  the right of the text.
- Fix SetItem so that items don't get wrongly re-ordered.
Dmitry Timoshkov <dmitry@codeweavers.com>
- Fix prototypes of GetClassLongA/W, GetClassLongPtrA/W and
  SetClassLongA/W according to SDK definitions.
- Add prototypes for SetClassLongPtrA/W, protect some GWL_ and GCL_
  constants from using in Wine or in _WIN64 mode.
- Fix all places in Wine affected by the above changes.
Jon Griffiths <jon_p_griffiths@yahoo.com>
- Documentation spelling fixes.
- Remove unneeded calls to TAB_GetInfoPtr(), const fixes, inline small
  funcs & remove unused parameters.
Dimitrie O. Paun <dpaun@rogers.com>
- Fix indentation for consistency with the rest of the file.
- Unicodification. Small cleanups.
Filip Navara <navaraf@reactos.com>
- Implement SB_SETBORDERS.
Alex Villacis Lasso <a_villacis@palosanto.com>
- Change SUBLANG_DEFAULT to SUBLANG_NEUTRAL for LANG_SPANISH in all
  resources, so that Spanish locales other than Spain also use Spanish
  resources.
Robert Shearman <rob@codeweavers.com>
- Fix one more place where the code assumes row indices are
  zero-based.
- Document a known bug in the layout code.
- Make row number be zero-based.
- Improvements to dumping functions to not dump out fields that may
  not have been filled in.
Michael Stefaniuc <mstefani@redhat.de>
- ImageList_LoadImage{A,W} were basicaly a cut'n'paste of each
  other. Removed the A variant and did a A->W translation.
- ImageList_LoadImageW: get the bitmap size from the image itself and
  not from the mask (ImageList_LoadImageA did that).

svn path=/trunk/; revision=14057
2005-03-14 11:34:02 +00:00
Gé van Geldorp
11039e6faf Sync to Wine-20050310:
Jon Griffiths <jon_p_griffiths@yahoo.com>
- Documentation spelling fixes.
Alexandre Julliard <julliard@winehq.org>
- Allow specifying extended control styles also in standard dialogs
  (reported by Michael Lin).
- Avoid spaces before preprocessor directives, that's not portable.
Francois Gouget <fgouget@free.fr>
- Assorted spelling fixes.

svn path=/trunk/; revision=14056
2005-03-14 11:01:02 +00:00
Gé van Geldorp
61dcda8178 Sync to Wine-20050310:
Merge back WineHQ commits

svn path=/trunk/; revision=14055
2005-03-14 10:44:46 +00:00
Gé van Geldorp
e51a2aab8f Re-import because of SVN problems
svn path=/trunk/; revision=14053
2005-03-14 10:36:02 +00:00
Gé van Geldorp
97445cc205 Sync to Wine-20050310:
Dimitrie O. Paun <dpaun@rogers.com>
- Add support for .exe's with exported functions.

svn path=/trunk/; revision=14052
2005-03-14 10:32:28 +00:00
James Tabor
4b9a323664 Fixed up rc file names.
svn path=/trunk/; revision=14050
2005-03-14 07:21:20 +00:00
Alex Ionescu
8b97b835f2 Support Priority Boosting during Wait Satisfaction and Thread Abortion, and use it where necessary. Should provide a bit more responsiveness.
svn path=/trunk/; revision=14049
2005-03-14 06:44:31 +00:00
Alex Ionescu
3d801bebec Forgot this file.
svn path=/trunk/; revision=14048
2005-03-14 05:54:58 +00:00
Alex Ionescu
6a7ba78c91 Dispatching & Queue Rewrite II:
- Rewrote wait code. It is now cleaner, more optimized and faster. All waiting
      functions are now clearly differentiated instead of sharing code. These functions
      are called up to a dozen times a second, so having dedicated code for each of
      them is a real boost in speed.
    - Fixed several queue issues, made a dedicated queue wait/wake function (you are not
      supposed to use KeWaitFor on a queue, and this is also a speed boost), and make it
      compatible with new wait code.
    - Optimized Work Queue code to be much smaller and better organized, by using an 
      array instead of hard-coded multiple static variables. Also, add support for the
      real NT structures and implementation, paving the road for Dynamic Work Items, which
      also have timeouts, and deadlock dection + debug info.
    - Simplified PsBlockThread and made it compatible with wait code.
    - Added support for priority boosting when unwaiting a thread; will use later, as well
      as put proper boosting for dispatch objects.
    - Inlined all dispatcher lock functions and header initialization for speed.
    - Moved executive wait code into ob.

svn path=/trunk/; revision=14047
2005-03-14 05:54:32 +00:00
Alex Ionescu
e33a78f93b Do not assume that a debugger is present only because we are debugging to a file or to the screen. This corrects bugchecks not to launch an INT3 where no debugger is actually there to catch it.
svn path=/trunk/; revision=14046
2005-03-14 04:51:51 +00:00
Thomas Bluemel
cfdb595cc6 Alex Ionescu <ionucu@videotron.ca>
Dispatcher Objects Rewrite (minus Queues, coming in next patch).
	Global Changes:
 
		- Use KOBJECT enumerations for all objects, remove obsoleted ros-internal enumeration.
		- Reformatting, commenting, and addition of Debug Prints for easier debugging
		- Properly create Executive Objects. They don't need a creation routine.
		- Make sure to properly lock and release the Dispatcher Database.
 
	Mutex/Mutant:
 
		- Correct MUTANT_BASIC_INFORMATION
		- Return previous state in Kernel Functions, intead of 1 or 0 all the time.
		- Initialize listhead properly
		- Removed code duplication between mutant and mutex release.
		- Fix bugs in release
		- Add proper exeption if the mutex is not owned.
 
	Kernel Queues:
 
		- Optimize the code
		- Use Inserted Flag
 
	Timers:
 
		- Some changes in setting the default data to allow KiInsertTimer to be called internally 
		  by the wait code in the next patch.
 
	Events:
 
		- Optimize and simplify KeInitializeEvent
		- Implement KeInitializeEventPair
		- Fix KePulseEvent. It was completely messed up and also used unneeded Interlocked function.
		- Fix KeResetEvent. It was not locking the dispatcher lock but using Interlocked.
		- Fix KeSetEvent. It was not differentiating between Notification and Sycronization events 
		  and also signaling the Event even if nobody was waiting on it.
 
	Semaphores:
 
		- Fix KeReleaseSemaphore. It was not checking if nobody was waiting on it before unwaiting the thread.
		- Fix not releasing dispatcher database before raising an exception.
		- Add check to NtCreateSemaphore to make sure the counts make sense.
 
	Event Pairs:
 
		- Remove Thread Event Pair. They are only used for NT4 QuickLPC which is obsoleted.
		- Use KeInitializeEventPair

svn path=/trunk/; revision=14045
2005-03-14 02:08:17 +00:00
Thomas Bluemel
865a496525 don't receive the previous mode before the current thread was created, this should finally fix the boot.
svn path=/trunk/; revision=14044
2005-03-14 01:47:18 +00:00
Magnus Olsen
78dbb934c2 GetDeviceData
fix the choppy mouse in UT and fix some other small bugs.
I can now use the mouse with out any problem in UT


svn path=/trunk/; revision=14043
2005-03-14 00:36:02 +00:00
Gé van Geldorp
05df4eff43 tinus <o112w8r02@sneakemail.com>:
Use RegisterShellHookWindow

svn path=/trunk/; revision=14042
2005-03-13 23:10:25 +00:00
Gé van Geldorp
fa4bd57bed tinus <o112w8r02@sneakemail.com>:
Implement RegisterShellHookWindow

svn path=/trunk/; revision=14041
2005-03-13 23:08:51 +00:00
Thomas Bluemel
f1fa92f6fc initialize the handle tables before creating them
svn path=/trunk/; revision=14040
2005-03-13 23:03:31 +00:00
Gé van Geldorp
c367070483 Allow cancelling of listen IRPs
svn path=/trunk/; revision=14037
2005-03-13 21:47:04 +00:00
Gé van Geldorp
6f699ce531 arty:
Always keep port numbers in network byte order

svn path=/trunk/; revision=14036
2005-03-13 21:41:44 +00:00
Thomas Bluemel
a8ea6a6ab4 don't use the current process' pid if no process specified.
svn path=/trunk/; revision=14035
2005-03-13 21:37:54 +00:00
Eric Kohl
a3e183bd64 Remove debug printf().
svn path=/trunk/; revision=14033
2005-03-13 21:34:15 +00:00
Eric Kohl
7019953f42 Remove debug printf().
svn path=/trunk/; revision=14031
2005-03-13 21:29:49 +00:00
Emanuele Aliberti
fd01d2046a LsaQueryInfoTrustedDomain stub added
svn path=/trunk/; revision=14028
2005-03-13 20:42:48 +00:00
Thomas Bluemel
57946d8a9a Alex Ionescu <ionucu@videotron.ca>
- Use optimized semantics as previously decided (OPTIMIZED = 1 if DBG = 0)

svn path=/trunk/; revision=14027
2005-03-13 18:55:01 +00:00
Royce Mitchell III
785ffdc0da set eol-style=native
svn path=/trunk/; revision=14026
2005-03-13 18:54:37 +00:00
James Tabor
e19f4b7bd9 Fix paste error.
svn path=/trunk/; revision=14025
2005-03-13 18:51:46 +00:00
James Tabor
7ac15d3bbf Fixup for *nix port
svn path=/trunk/; revision=14024
2005-03-13 18:47:13 +00:00
James Tabor
1bb6977546 Fixup for *nix port
svn path=/trunk/; revision=14023
2005-03-13 18:43:44 +00:00
Thomas Bluemel
b1ce653a14 Alex Ionescu <ionucu@videotron.ca>
- Fix implementation of NT Profile Objects. Structures are guesses, but seem pretty close to the NT ones... a lot of stuff based on David Welch's old implementation, but simplified the way profiles are managed extensively, and also using the same buckethash mechanism as NT, this is required for compatibility with Nt Native APIs that use Profile Objects.
- Removed KDBG internal profile management and associated files. I will re-write the Profiler to use NT Profile Objects, which will allow us more extensibilty while profiling and also greater compatibility with NT.

svn path=/trunk/; revision=14022
2005-03-13 18:41:59 +00:00
Thomas Bluemel
b607cb6445 fixed HANDLE_TABLE structure
svn path=/trunk/; revision=14021
2005-03-13 18:39:38 +00:00
Royce Mitchell III
3d00595df2 c version of wine's 'make_ctests' script
svn path=/trunk/; revision=14020
2005-03-13 18:08:10 +00:00
Royce Mitchell III
539c296fa7 -Wall -Werror and fix warnings
svn path=/trunk/; revision=14019
2005-03-13 17:24:17 +00:00
Royce Mitchell III
5751b32540 -Wall -Werror and fix warnings
svn path=/trunk/; revision=14018
2005-03-13 17:18:33 +00:00
Hartmut Birr
e9ae9105f5 Added a keep-alive reference to each key object.
Lock the registry while accessing sub keys of a key object.  
Implemented a worker thread which removes all unused key objects.  
Fixed a bug which shows keys twice if a key is already opened.

svn path=/trunk/; revision=14017
2005-03-13 17:03:42 +00:00
Emanuele Aliberti
2d250ad2a7 ea@reactos.com
- make SmExecuteProgram work
- implement SmCompleteSession (untested)

svn path=/trunk/; revision=14016
2005-03-13 17:01:59 +00:00
Emanuele Aliberti
12da975bfd ea@reactos.com
Make SmConnectApiPort more safe.

svn path=/trunk/; revision=14015
2005-03-13 17:00:19 +00:00
Hartmut Birr
779a7eeb41 Removed CloseInProcess from object header structure.
svn path=/trunk/; revision=14014
2005-03-13 16:44:15 +00:00
Hartmut Birr
aed77689d2 Added two missing calls to KeLeaveCriticalRegion.
svn path=/trunk/; revision=14013
2005-03-13 16:41:05 +00:00
Martin Fuchs
85fdc76fb2 launch display properties dialog via desktop context menu
svn path=/trunk/; revision=14012
2005-03-13 15:43:02 +00:00
Martin Fuchs
c9f8b0e7e0 remove temporary desktop context menu code from explorer
svn path=/trunk/; revision=14011
2005-03-13 15:30:29 +00:00
Martin Fuchs
0418e694e6 a little context menu code cleanup
svn path=/trunk/; revision=14010
2005-03-13 15:29:53 +00:00
Eric Kohl
28eb04c4db Fix gcc warnings in generated client stub.
svn path=/trunk/; revision=14009
2005-03-13 14:49:59 +00:00
Thomas Bluemel
29bd3ad1f9 revert changes to the config file. I accidently committed it, sorry.
svn path=/trunk/; revision=14008
2005-03-13 14:29:09 +00:00
Thomas Bluemel
d288e05d38 - fixed handle table structures
- implement generic executive handle tables (since there don't exist documents that describe the parameters of most of these functions (which are kernel internal only), i made them up as required)
- adjusted OB's handle manager to use ex handle tables
- adjusted the client id manager to use ex handle tables

svn path=/trunk/; revision=14007
2005-03-13 14:21:47 +00:00
Aleksey Bragin
a3c3364289 Removed excess copy of accidently inserted twice russian language resources.
svn path=/trunk/; revision=14006
2005-03-13 13:59:06 +00:00
Aleksey Bragin
27f383b70d Fixed typos, removed excess copy of accidently inserted twice russian language resources, also fixed "To add new program, click Install" (was cut, so now height increased to 16).
svn path=/trunk/; revision=14005
2005-03-13 13:47:45 +00:00
Magnus Olsen
84a36613f5 getdevicedata
Make the mouse less choopy. 
But it still choopy. It need implement real buffer.
instead it being fild when it is call.

Fix the buffer seq are in right order.


 

svn path=/trunk/; revision=14004
2005-03-13 10:45:23 +00:00
Eric Kohl
53170a9c19 Implement [string] attribute for pointers to char and wchar_t.
svn path=/trunk/; revision=14002
2005-03-13 10:24:34 +00:00
Hartmut Birr
d6c9cf0a41 Use KeGetCurrentPrcb instead of KeGetCurrentKPCR.
svn path=/trunk/; revision=14001
2005-03-13 09:19:33 +00:00
Hartmut Birr
e6bf69e0ae Use only one access to the spinlock in the assertion, because the value may change between two access' on smp machines.
svn path=/trunk/; revision=14000
2005-03-13 09:14:59 +00:00
Hartmut Birr
0d216dc91a Ignore exception 15 in KiTrapHandler.
svn path=/trunk/; revision=13999
2005-03-13 09:10:36 +00:00
Hartmut Birr
0618186aa6 Initialized the key name before each call to ZwCreateKey in IopCreateDeviceKeyPath.
svn path=/trunk/; revision=13998
2005-03-13 09:08:26 +00:00
Hartmut Birr
154d6c64f8 Define IPI_REQUEST_FREEZE.
svn path=/trunk/; revision=13997
2005-03-13 09:06:14 +00:00
Royce Mitchell III
fbff6fe0f0 don't end a string if the last character outputted was an escape, will cause output file to be invalid
svn path=/trunk/; revision=13996
2005-03-13 07:38:40 +00:00
James Tabor
b2f5efa2cf Fix up opps.
svn path=/trunk/; revision=13992
2005-03-13 04:25:09 +00:00
James Tabor
29f3606a01 Fix up Linux port.
svn path=/trunk/; revision=13991
2005-03-13 04:23:35 +00:00
Steven Edwards
bf89d5df7d added winetest gui program. Does not interact with server yet and requires advapi32 and comctl32 tests to be built.
svn path=/trunk/; revision=13989
2005-03-13 01:54:53 +00:00
Magnus Olsen
0bf2971d1a getmousedevice buffer
UT2004 the mouse are less choopy on my computer now.
and small bug fix. it maby still exists some bug left.

svn path=/trunk/; revision=13988
2005-03-13 01:10:46 +00:00
Magnus Olsen
bc1cb8bf6e Fix the mouse for Unreal tormnet 2004, it is working now
have not test it to 100%. But hoppfull it is last fix, geting games that need dinput working now with opengl.

svn path=/trunk/; revision=13987
2005-03-13 00:13:07 +00:00
Gé van Geldorp
108b495229 Allow inter-thread timer setting but not inter-process
svn path=/trunk/; revision=13986
2005-03-12 22:42:38 +00:00
Thomas Bluemel
2a13486746 Alex Ionescu <ionucu@videotron.ca>
- Remove ke/critical.c and move its functions into ke/apc.c
- Reformat ke/apc.c code which I had written messed up (due to MSVC)
- Add a bit more commenting.

svn path=/trunk/; revision=13985
2005-03-12 22:31:22 +00:00
Thomas Bluemel
322dbd6fba Thomas Weidenmueller <w3seek@reactos.com>
- Fix various security structures and constants
- Add code to capture quality of service structures and ACLs
- Secure buffer access in NtQueryInformationToken, NtSetInformationToken, NtNotifyChangeDirectoryFile and NtQueryDirectoryFile

svn path=/trunk/; revision=13984
2005-03-12 22:16:02 +00:00
Magnus Olsen
6830474b06 Now UT2004 start, but the mouse does not work or ?
Still some problem with the mouse buffer on getdevicedata.But it does not freze any longer.

svn path=/trunk/; revision=13983
2005-03-12 22:10:11 +00:00
Thomas Bluemel
7bc94f8976 Alex Ionescu <ionucu@videotron.ca>
- Remove ke/error.c and add its functions into ke/catch.c where they belong.
- Create ex/error.c and move Executive functions present in ke/error.c to it.
- Implement NtRaiseHardError and move it from ke/error.c to ex/error.c.
- Increase Exceptions Dispatched count in dispatch code and comment code more throughly.

svn path=/trunk/; revision=13982
2005-03-12 21:26:29 +00:00
Thomas Bluemel
566c2840b9 Alex Ionescu <ionucu@videotron.ca>
- Reorganized Bootup code. Most of the Executive initialization is now in ex/init.c
- Remove ExPostSystemEvent.
- Sped up Command-line parasing and wrote a function specificalyl for it, to ease extensibility
- Sped up and optimized loading modules from FreeLoader. The data is only looked up once and then the pointers are cached for easy re-use.
- Moved KeGetRecommendedSharedDataAlignmented to ke/main.c and implemented it.
- Moved subsystem-specific intialization to their own subsystem, like Io in ioinit and Cm in CmInit.

svn path=/trunk/; revision=13981
2005-03-12 21:08:29 +00:00
Klemens Friedl
523d77cc92 resource icon added
svn path=/trunk/; revision=13980
2005-03-12 20:59:36 +00:00
Klemens Friedl
0c969fe931 add icon (flags)
svn path=/trunk/; revision=13979
2005-03-12 20:36:23 +00:00
Magnus Olsen
0aa810f5e1 Small bug fix
do not crash UT2004 any longer, but it freze ut2004 
screen. still some problem with getdevicedata for
the mouse. it is the mouse buffer problem. more
apps will work better now. 

svn path=/trunk/; revision=13978
2005-03-12 20:29:51 +00:00
Thomas Bluemel
7fd17a9a85 Alex Ionescu <ionucu@videotron.ca>
- Clean up IO Completion Code
- Properly delete an IO Completion. The IRPs were not freed, resulting in memory leaks

Thomas Weidenmueller <w3seek@reactos.com>
- Add SEH to IO Completion Code

svn path=/trunk/; revision=13977
2005-03-12 19:58:53 +00:00
Klemens Friedl
b21f552e3b * add combobox (select language/region)
* german & english resource files

svn path=/trunk/; revision=13976
2005-03-12 19:46:27 +00:00
Thomas Bluemel
fd962e2f04 Alex Ionescu <ionucu@videotron.ca>
- Fixed formatting mess in ke/dpc.c (which I had made when I wrote it due to MSVC).
- Add more comments where needed.
- Properly Initialize a Threaded DPC.

Thomas Weidenmueller <w3seek@reactos.com>
- Use Prcb directly in KeInitDpc.

svn path=/trunk/; revision=13975
2005-03-12 19:45:37 +00:00
Thomas Bluemel
b2a42182ef Alex Ionescu <ionucu@videotron.ca>
- Removed ke/alert.c and moved its functions where they belong.
- Commented and organized KeInitializeThread.
- Began switch to true KOBJECT enumeration used in NT.
- Implemented KeAlertResumeThread and NtAlertResumeThread.
- Harmonized Formatting in ke/kthread.c

svn path=/trunk/; revision=13974
2005-03-12 19:23:04 +00:00
Klemens Friedl
a8f6850b9f Add registry keys for language support
svn path=/trunk/; revision=13973
2005-03-12 19:22:30 +00:00
Thomas Bluemel
64c70941d3 Alex Ionescu <ionucu@videotron.ca>
- Remove branch leftover in debug message.
- Uncondtionally enable setting the Window Station Atom Table.

svn path=/trunk/; revision=13972
2005-03-12 18:15:54 +00:00
Thomas Bluemel
052a86b641 Alex Ionescu <ionucu@videotron.ca>
- Clean up formatting of ke/process.c (which I had messed up at the time due to MSVC)
- Acknowledge Blight's work
- Implement KeRemoveServiceDescriptorTable
- Remove ex/napi.c and move the Tables into ke/process.c

svn path=/trunk/; revision=13971
2005-03-12 18:10:03 +00:00
Thomas Bluemel
62fe406292 Alex Ionescu <ionucu@videotron.ca>
Fix wrong assertion.

svn path=/trunk/; revision=13970
2005-03-12 17:02:43 +00:00
Filip Navara
f954a88f34 Alex Ionescu <ionucu@videotron.ca>
Various bugcheck code improvements:
- Fix bugcheck code and make debugging easier for unhandled exceptions/spinlocks.
- Fix a race condition with TAB+B,
- Fix irql to be high_level.
- Fix calling unsafe function by caching bugcode data.
- Fix support for smp by using IPI.
- Fix not-breakpointing when no debugger is there.
- Implement KeBugCheck callbacks with reason.
- Fix callbacks not being called.
- Fix proper breakpoint during bugcheck.
Filip Navara <xnavara@volny.cz>
- Move the bugcheck initialization code into Ke (was in Ex on Alex's branch).

svn path=/trunk/; revision=13969
2005-03-12 16:01:30 +00:00
Filip Navara
5307ffb9c6 Alex Ionescu <ionucu@videotron.ca>
Move win32k callbacks to win32k where they belong. Registration is done with Ps function just like on XP+. Also allows non-win32k stuff to manage their own desktops and window stations.

svn path=/trunk/; revision=13968
2005-03-12 14:15:49 +00:00
Thomas Bluemel
510dc740a5 include ctype.h for isalpha()
svn path=/trunk/; revision=13967
2005-03-12 13:50:48 +00:00
Eric Kohl
8871c0355a Implement [in], [out] and [in, out] support for pointers to basic types.
svn path=/trunk/; revision=13966
2005-03-12 13:23:09 +00:00
Filip Navara
466b206539 Alex Ionescu <ionucu@videotron.ca>
- Add KeGetCurrentPrcb function and use it where appropriate.
- Fix returning of values in ExGetCurrentProcessorCpuUsage and ExGetCurrentProcessorCounts.
- Move ExIsProcessorFeaturePresent from ex/init.c to ex/sysinfo.c.

svn path=/trunk/; revision=13965
2005-03-12 09:40:07 +00:00
Gé van Geldorp
17f773cb7d Fix htons
svn path=/trunk/; revision=13964
2005-03-12 09:21:59 +00:00
Hartmut Birr
653d79d129 Lock the kernel address space instead the process' one, if the pages are located in kernel space.
Unlock the address space on error.


svn path=/trunk/; revision=13963
2005-03-12 09:14:38 +00:00
Filip Navara
57787bb881 Thomas Weidenmueller <w3seek@reactos.com>
- Implement support for vectored exception handlers.
- Add code for querying process cookie.

svn path=/trunk/; revision=13962
2005-03-12 08:54:41 +00:00
Art Yerkes
724d399a3f Some improvements I've been sitting on.
Set SEL_FIN if we need to in TCPReceiveData.
Clear out pending IRP queues properly when shutting down.
Lock the tcp when getting or setting the address.

svn path=/trunk/; revision=13961
2005-03-12 07:52:16 +00:00
Art Yerkes
e58c615243 Changed bare words to strings so we don't get complaints about unterminated
char constants.

svn path=/trunk/; revision=13957
2005-03-12 05:46:45 +00:00
Steven Edwards
3db0384e86 added Wine tests for advapi32. (untested)
svn path=/trunk/; revision=13954
2005-03-12 04:32:00 +00:00
Royce Mitchell III
0e37d806a5 detect windows instead of assuming it
svn path=/trunk/; revision=13953
2005-03-12 04:20:35 +00:00
Steven Edwards
3ed09e40d9 Should be winetests not winetest.
svn path=/trunk/; revision=13951
2005-03-12 04:11:24 +00:00
Steven Edwards
e8451b25d5 Added Wine regression tests for comctl32. (Untested)
svn path=/trunk/; revision=13950
2005-03-12 04:09:57 +00:00
Filip Navara
eab893a17c Minor touch ups to the tools version check to get it working on Linux.
svn path=/trunk/; revision=13949
2005-03-12 02:04:08 +00:00
Filip Navara
7c7a235e5f Steven Edwards <steven_ed4153@yahoo.com>
Revert incorrect change - KD_DEBUG_BOOTLOG => KD_DEBUG_FILELOG, /DEBUGPORT=BOOTLOG => /DEBUGPORT=FILE.

svn path=/trunk/; revision=13948
2005-03-12 01:11:06 +00:00
Filip Navara
5bbfa0aa1d Don't use intermediate objects linked with "ld -r". There's a bug in binutils that causes the data section relocations to be stripped.
svn path=/trunk/; revision=13947
2005-03-12 00:54:06 +00:00
Filip Navara
fe2a7b4489 Alex Ionescu <ionucu@videotron.ca>
Add definitions for WORKER_THREAD_RETURNED_AT_BAD_IRQL, MANUALLY_INITIATED_CRASH and IMPERSONATING_WORKER_THREAD bug check codes.

svn path=/trunk/; revision=13946
2005-03-12 00:51:55 +00:00
Filip Navara
94066e01ef Alex Ionescu <ionucu@videotron.ca>
Pass an ACPI flag from FreeLdr to the kernel and replace the usage of ACPI compile time option with it.

svn path=/trunk/; revision=13945
2005-03-12 00:49:18 +00:00
Art Yerkes
b89e71762d Changed sizeof(RemoteAddress) to sizeof(*RemoteAddress). Now address
returns work in accept.

svn path=/trunk/; revision=13943
2005-03-12 00:02:24 +00:00
Filip Navara
b6926c02fc Alex Ionescu <ionucu@videotron.ca>
Relocate kernel if the /3GB switch is supplied in kernel parameters.

svn path=/trunk/; revision=13941
2005-03-11 23:38:59 +00:00
Art Yerkes
6cc6c8571b Swap the port part of the address so it's reported correctly.
svn path=/trunk/; revision=13937
2005-03-11 21:13:11 +00:00
656 changed files with 81966 additions and 38571 deletions

View File

@@ -61,8 +61,8 @@ DLLS_SHELLEXT = shellext
DLLS = acledit aclui advapi32 advpack cabinet cards comctl32 crtdll comdlg32 d3d8thk dbghelp expat fmifs freetype \
gdi32 gdiplus glu32 hid imagehlp imm32 iphlpapi kernel32 lzexpand mesa32 midimap mmdrv mpr msacm msafd \
msgina msi msimg32 msvcrt20 msvideo mswsock netapi32 ntdll ole32 oleaut32 oledlg olepro32 opengl32 \
packet psapi riched20 richedit rpcrt4 samlib secur32 setupapi shell32 shlwapi smdll snmpapi syssetup \
twain user32 userenv version wininet winmm winspool ws2help ws2_32 wsock32 wshirda dnsapi \
packet psapi riched20 richedit rpcrt4 samlib secur32 setupapi shell32 shlwapi smlib smdll snmpapi \
syssetup twain user32 userenv version wininet winmm winspool ws2help ws2_32 wsock32 wshirda dnsapi \
urlmon shdocvw dinput dinput8 dxdiagn devenum dsound lsasrv $(DLLS_KBD) $(DLLS_CPL) $(DLLS_SHELLEXT)
SUBSYS = smss win32k csrss ntvdm

View File

@@ -9,7 +9,7 @@ include $(PATH_TO_TOP)/rules.mak
# Console system utilities
# cabman cat net objdir partinfo pice ps sc stats
UTIL_APPS = cat objdir partinfo pnpdump sc shutdown stats tickcount consw ps
UTIL_APPS = cat objdir partinfo pnpdump sc shutdown stats tickcount ps
UTIL_NET_APPS = arp finger ftp ipconfig netstat ping route telnet whois

View File

@@ -1,23 +1,21 @@
# $Id$
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = consw
TARGET_SDKLIBS = ntdll.a kernel32.a
TARGET_OBJECTS = $(TARGET_NAME).o
TARGET_CFLAGS = -Wall -Werror
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = binpatch
TARGET_SDKLIBS =
TARGET_OBJECTS = patch.o
TARGET_CFLAGS += -Wall -Werror
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -0,0 +1,615 @@
#include <conio.h>
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
/** DEFINES *******************************************************************/
#define PATCH_BUFFER_SIZE 4096 /* Maximum size of a patch */
#define PATCH_BUFFER_MAGIC "\xde\xad\xbe\xef MaGiC MaRk "
#define SIZEOF_PATCH_BUFFER_MAGIC (sizeof (PATCH_BUFFER_MAGIC) - 1)
/** TYPES *********************************************************************/
typedef struct _PatchedByte
{
int offset; /*!< File offset of the patched byte. */
unsigned char expected; /*!< Expected (original) value of the byte. */
unsigned char patched; /*!< Patched (new) value for the byte. */
} PatchedByte;
typedef struct _PatchedFile
{
const char *name; /*!< Name of the file to be patched. */
int fileSize; /*!< Size of the file in bytes. */
int patchCount; /*!< Number of patches for the file. */
PatchedByte *patches; /*!< Patches for the file. */
} PatchedFile;
typedef struct _Patch
{
const char *name; /*!< Name of the patch. */
int fileCount; /*!< Number of files in the patch. */
PatchedFile *files; /*!< Files for the patch. */
} Patch;
/** FUNCTION PROTOTYPES *******************************************************/
static void printUsage();
/** GLOBALS *******************************************************************/
static Patch m_patch = { NULL, 0, NULL };
static int m_argc = 0;
static char **m_argv = NULL;
/* patch buffer where we put the patch info into */
static unsigned char m_patchBuffer[SIZEOF_PATCH_BUFFER_MAGIC + PATCH_BUFFER_SIZE] =
PATCH_BUFFER_MAGIC;
/** HELPER FUNCTIONS **********************************************************/
static void *
loadFile(const char *fileName, int *fileSize_)
{
FILE *f;
struct stat sb;
int fileSize;
void *p;
/* Open the file */
f = fopen(fileName, "rb");
if (f == NULL)
{
printf("Couldn't open file %s for reading!\n", fileName);
return NULL;
}
/* Get file size */
if (fstat(fileno(f), &sb) < 0)
{
fclose(f);
printf("Couldn't get size of file %s!\n", fileName);
return NULL;
}
fileSize = sb.st_size;
/* Load file */
p = malloc(fileSize);
if (p == NULL)
{
fclose(f);
printf("Couldn't allocate %d bytes for file %s!\n", fileSize, fileName);
return NULL;
}
if (fread(p, fileSize, 1, f) != 1)
{
fclose(f);
free(p);
printf("Couldn't read file %s into memory!\n", fileName);
return NULL;
}
/* Close file */
fclose(f);
*fileSize_ = fileSize;
return p;
}
static int
saveFile(const char *fileName, void *file, int fileSize)
{
FILE *f;
/* Open the file */
f = fopen(fileName, "wb");
if (f == NULL)
{
printf("Couldn't open file %s for writing!\n", fileName);
return -1;
}
/* Write file */
if (fwrite(file, fileSize, 1, f) != 1)
{
fclose(f);
printf("Couldn't write file %s!\n", fileName);
return -1;
}
/* Close file */
fclose(f);
return 0;
}
static int
compareFiles(
PatchedFile *patchedFile,
const char *originalFileName)
{
const char *patchedFileName = patchedFile->name;
unsigned char *origChunk, *patchedChunk;
int origSize, patchedSize, i, patchCount;
PatchedByte *patches = NULL;
int patchesArrayCount = 0;
/* Load both files */
origChunk = loadFile(originalFileName, &origSize);
if (origChunk == NULL)
return -1;
patchedChunk = loadFile(patchedFileName, &patchedSize);
if (patchedChunk == NULL)
{
free(origChunk);
return -1;
}
if (origSize != patchedSize)
{
free(origChunk);
free(patchedChunk);
printf("File size of %s and %s differs (%d != %d)\n",
originalFileName, patchedFileName,
origSize, patchedSize);
return -1;
}
/* Compare the files and record any differences */
printf("Comparing %s to %s", originalFileName, patchedFileName);
for (i = 0, patchCount = 0; i < origSize; i++)
{
if (origChunk[i] != patchedChunk[i])
{
patchCount++;
/* Resize patches array if needed */
if (patchesArrayCount < patchCount)
{
PatchedByte *newPatches;
newPatches = realloc(patches, patchCount * sizeof (PatchedByte));
if (newPatches == NULL)
{
if (patches != NULL)
free(patches);
free(origChunk);
free(patchedChunk);
printf("\nOut of memory (tried to allocated %d bytes)\n",
patchCount * sizeof (PatchedByte));
return -1;
}
patches = newPatches;
}
/* Fill in patch info */
patches[patchCount - 1].offset = i;
patches[patchCount - 1].expected = origChunk[i];
patches[patchCount - 1].patched = patchedChunk[i];
}
if ((i % (origSize / 40)) == 0)
printf(".");
}
printf(" %d changed bytes found.\n", patchCount);
/* Unload the files */
free(origChunk);
free(patchedChunk);
/* Save patch info */
patchedFile->fileSize = patchedSize;
patchedFile->patchCount = patchCount;
patchedFile->patches = patches;
return 0;
}
static int
outputPatch(const char *outputFileName)
{
unsigned char *patchExe, *patchBuffer;
int i, size, patchExeSize, patchSize, stringSize, stringOffset, patchOffset;
Patch *patch;
PatchedFile *files;
printf("Putting patch into %s...\n", outputFileName);
/* Calculate size of the patch */
patchSize = sizeof (Patch) + sizeof (PatchedFile) * m_patch.fileCount;
stringSize = strlen(m_patch.name) + 1;
for (i = 0; i < m_patch.fileCount; i++)
{
stringSize += strlen(m_patch.files[i].name) + 1;
patchSize += sizeof (PatchedByte) * m_patch.files[i].patchCount;
}
if ((stringSize + patchSize) > PATCH_BUFFER_SIZE)
{
printf("Patch is too big - %d bytes maximum, %d bytes needed\n",
PATCH_BUFFER_SIZE, stringSize + patchSize);
return -1;
}
/* Load patch.exe file into memory... */
patchExe = loadFile(m_argv[0], &patchExeSize);
if (patchExe == NULL)
{
return -1;
}
/* Try to find the magic mark for the patch buffer */
for (i = 0; i < (patchExeSize - SIZEOF_PATCH_BUFFER_MAGIC); i++)
{
if (memcmp(patchExe + i, m_patchBuffer, SIZEOF_PATCH_BUFFER_MAGIC) == 0)
{
patchBuffer = patchExe + i + SIZEOF_PATCH_BUFFER_MAGIC;
break;
}
}
if (!(i < (patchExeSize - SIZEOF_PATCH_BUFFER_MAGIC)))
{
free(patchExe);
printf("Couldn't find patch buffer magic in file %s - this shouldn't happen!!!\n", m_argv[0]);
return -1;
}
/* Pack patch together and replace string pointers by offsets */
patch = (Patch *)patchBuffer;
files = (PatchedFile *)(patchBuffer + sizeof (Patch));
patchOffset = sizeof (Patch) + sizeof (PatchedFile) * m_patch.fileCount;
stringOffset = patchSize;
patch->fileCount = m_patch.fileCount;
patch->files = (PatchedFile *)sizeof (Patch);
patch->name = (const char *)stringOffset;
strcpy(patchBuffer + stringOffset, m_patch.name);
stringOffset += strlen(m_patch.name) + 1;
for (i = 0; i < m_patch.fileCount; i++)
{
files[i].fileSize = m_patch.files[i].fileSize;
files[i].patchCount = m_patch.files[i].patchCount;
files[i].name = (const char *)stringOffset;
strcpy(patchBuffer + stringOffset, m_patch.files[i].name);
stringOffset += strlen(m_patch.files[i].name) + 1;
size = files[i].patchCount * sizeof (PatchedByte);
files[i].patches = (PatchedByte *)patchOffset;
memcpy(patchBuffer + patchOffset, m_patch.files[i].patches, size);
patchOffset += size;
}
size = patchSize + stringSize;
memset(patchBuffer + size, 0, PATCH_BUFFER_SIZE - size);
/* Save file */
if (saveFile(outputFileName, patchExe, patchExeSize) < 0)
{
free(patchExe);
return -1;
}
free(patchExe);
printf("Patch saved!\n");
return 0;
}
static int
loadPatch()
{
char *p;
Patch *patch;
int i;
p = m_patchBuffer + SIZEOF_PATCH_BUFFER_MAGIC;
patch = (Patch *)p;
if (patch->name == NULL)
{
return -1;
}
m_patch.name = p + (int)patch->name;
m_patch.fileCount = patch->fileCount;
m_patch.files = (PatchedFile *)(p + (int)patch->files);
for (i = 0; i < m_patch.fileCount; i++)
{
m_patch.files[i].name = p + (int)m_patch.files[i].name;
m_patch.files[i].patches = (PatchedByte *)(p + (int)m_patch.files[i].patches);
}
printf("Patch %s loaded...\n", m_patch.name);
return 0;
}
/** MAIN FUNCTIONS ************************************************************/
static int
createPatch()
{
int i, status;
const char *outputFileName;
/* Check argument count */
if (m_argc < 6 || (m_argc % 2) != 0)
{
printUsage();
return -1;
}
outputFileName = m_argv[3];
m_patch.name = m_argv[2];
/* Allocate PatchedFiles array */
m_patch.fileCount = (m_argc - 4) / 2;
m_patch.files = malloc(m_patch.fileCount * sizeof (PatchedFile));
if (m_patch.files == NULL)
{
printf("Out of memory!\n");
return -1;
}
memset(m_patch.files, 0, m_patch.fileCount * sizeof (PatchedFile));
/* Compare original to patched files and fill m_patch.files array */
for (i = 0; i < m_patch.fileCount; i++)
{
m_patch.files[i].name = m_argv[4 + (i * 2) + 1];
status = compareFiles(m_patch.files + i, m_argv[4 + (i * 2) + 0]);
if (status < 0)
{
for (i = 0; i < m_patch.fileCount; i++)
{
if (m_patch.files[i].patches != NULL)
free(m_patch.files[i].patches);
}
free(m_patch.files);
m_patch.files = NULL;
m_patch.fileCount = 0;
return status;
}
}
/* Output patch */
return outputPatch(outputFileName);
}
static int
applyPatch()
{
int c, i, j, fileSize, makeBackup;
unsigned char *file;
char *p;
const char *fileName;
char buffer[MAX_PATH];
if (m_argc > 1 && strcmp(m_argv[1], "-d") != 0)
{
printUsage();
return -1;
}
/* Load patch */
if (loadPatch() < 0)
{
printf("This executable doesn't contain a patch, use -c to create one.\n");
return -1;
}
if (m_argc > 1)
{
/* Dump patch */
printf("Patch name: %s\n", m_patch.name);
printf("File count: %d\n", m_patch.fileCount);
for (i = 0; i < m_patch.fileCount; i++)
{
printf("----------------------\n"
"File name: %s\n"
"File size: %d bytes\n",
m_patch.files[i].name, m_patch.files[i].fileSize);
printf("Patch count: %d\n", m_patch.files[i].patchCount);
for (j = 0; j < m_patch.files[i].patchCount; j++)
{
printf(" Offset 0x%x 0x%02x -> 0x%02x\n",
m_patch.files[i].patches[j].offset,
m_patch.files[i].patches[j].expected,
m_patch.files[i].patches[j].patched);
}
}
}
else
{
/* Apply patch */
printf("Applying patch...\n");
for (i = 0; i < m_patch.fileCount; i++)
{
/* Load original file */
fileName = m_patch.files[i].name;
applyPatch_retry_file:
file = loadFile(fileName, &fileSize);
if (file == NULL)
{
printf("File %s not found! ", fileName);
applyPatch_file_open_error:
printf("(S)kip, (R)etry, (A)bort, (M)anually enter filename");
do
{
c = getch();
}
while (c != 's' && c != 'r' && c != 'a' && c != 'm');
printf("\n");
if (c == 's')
{
continue;
}
else if (c == 'r')
{
goto applyPatch_retry_file;
}
else if (c == 'a')
{
return 0;
}
else if (c == 'm')
{
if (fgets(buffer, sizeof (buffer), stdin) == NULL)
{
printf("fgets() failed!\n");
return -1;
}
p = strchr(buffer, '\r');
if (p != NULL)
*p = '\0';
p = strchr(buffer, '\n');
if (p != NULL)
*p = '\0';
fileName = buffer;
goto applyPatch_retry_file;
}
}
/* Check file size */
if (fileSize != m_patch.files[i].fileSize)
{
free(file);
printf("File %s has unexpected filesize of %d bytes (%d bytes expected)\n",
fileName, fileSize, m_patch.files[i].fileSize);
if (fileName != m_patch.files[i].name) /* manually entered filename */
{
goto applyPatch_file_open_error;
}
return -1;
}
/* Ask for backup */
printf("Do you want to make a backup of %s? (Y)es, (N)o, (A)bort", fileName);
do
{
c = getch();
}
while (c != 'y' && c != 'n' && c != 'a');
printf("\n");
if (c == 'y')
{
char buffer[MAX_PATH];
snprintf(buffer, MAX_PATH, "%s.bak", fileName);
buffer[MAX_PATH-1] = '\0';
makeBackup = 1;
if (access(buffer, 0) >= 0) /* file exists */
{
printf("File %s already exists, overwrite? (Y)es, (N)o, (A)bort", buffer);
do
{
c = getch();
}
while (c != 'y' && c != 'n' && c != 'a');
printf("\n");
if (c == 'n')
makeBackup = 0;
else if (c == 'a')
{
free(file);
return 0;
}
}
if (makeBackup && saveFile(buffer, file, fileSize) < 0)
{
free(file);
return -1;
}
}
else if (c == 'a')
{
free(file);
return 0;
}
/* Patch file */
for (j = 0; j < m_patch.files[i].patchCount; j++)
{
int offset = m_patch.files[i].patches[j].offset;
if (file[offset] != m_patch.files[i].patches[j].expected)
{
printf("Unexpected value in file %s at offset 0x%x: expected = 0x%02x, found = 0x%02x\n",
fileName, offset, m_patch.files[i].patches[j].expected, file[offset]);
free(file);
return -1;
}
file[offset] = m_patch.files[i].patches[j].patched;
}
/* Save file */
if (saveFile(fileName, file, fileSize) < 0)
{
free(file);
return -1;
}
free(file);
}
printf("Patch applied sucessfully!\n");
}
return 0;
}
static void
printUsage()
{
printf("Usage:\n"
"%s -c - Create patch\n"
"%s -d - Dump patch\n"
"%s - Apply patch\n"
"\n"
"A patch can be created like this:\n"
"%s -c \"patch name\" output.exe file1.orig file1.patched[ file2.orig file2.patched[ ...]]\n",
m_argv[0], m_argv[0], m_argv[0], m_argv[0]);
}
int
main(
int argc,
char *argv[])
{
m_argc = argc;
m_argv = argv;
if (argc >= 2 && (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0))
{
printUsage();
return 0;
}
else if (argc >= 2 && argv[1][0] == '-')
{
if (strcmp(argv[1], "-c") == 0)
{
return createPatch();
}
else if (strcmp(argv[1], "-d") == 0)
{
return applyPatch();
}
else
{
printf("Unknown option: %s\n"
"Use -h for help.\n",
argv[1]);
return -1;
}
}
return applyPatch();
}

View File

@@ -1,30 +0,0 @@
/* $Id$
*
* DESCRIPTION: Console mode switcher
* PROGRAMMER: Art Yerkes
* REVISIONS
* 2003-07-26 (arty)
*/
#include <windows.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
void STDCALL SetConsoleHardwareState( HANDLE conhandle,
DWORD flags,
DWORD state );
int main(int argc, char* argv[])
{
if( argc > 1 ) {
SetConsoleHardwareState( GetStdHandle( STD_INPUT_HANDLE ),
0,
!strcmp( argv[1], "hw" ) );
}
return 0;
}
/* EOF */

View File

@@ -1,5 +0,0 @@
@echo off
rem Turn off cosole, run a program, turn console on
\reactos\bin\consw sw
"%1" "%2" "%3" "%4" "%5" "%6" "%7" "%8" "%9"
\reactos\bin\consw hw

View File

@@ -0,0 +1,949 @@
/* include/config.h. Generated by configure. */
/* include/config.h.in. Generated from configure.ac by autoheader. */
#define __WINE_CONFIG_H
/* Specifies the compiler flag that forces a short wchar_t */
#define CC_FLAG_SHORT_WCHAR "-fshort-wchar"
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
/* #undef CRAY_STACKSEG_END */
/* Define to 1 if using `alloca.c'. */
/* #undef C_ALLOCA */
/* Define to 1 if you have `alloca', as a function or macro. */
#define HAVE_ALLOCA 1
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
/* #undef HAVE_ALLOCA_H */
/* Define if you have ALSA 1.x including devel headers */
/* #undef HAVE_ALSA */
/* Define to 1 if you have the <alsa/asoundlib.h> header file. */
/* #undef HAVE_ALSA_ASOUNDLIB_H */
/* Define to 1 if you have the <arpa/inet.h> header file. */
/* #undef HAVE_ARPA_INET_H */
/* Define to 1 if you have the <arpa/nameser.h> header file. */
/* #undef HAVE_ARPA_NAMESER_H */
/* Define if you have ARTS sound server */
/* #undef HAVE_ARTS */
/* Define if the assembler keyword .size is accepted */
/* #undef HAVE_ASM_DOT_SIZE */
/* Define to 1 if you have the <audio/audiolib.h> header file. */
/* #undef HAVE_AUDIO_AUDIOLIB_H */
/* Define to 1 if you have the <audio/soundlib.h> header file. */
/* #undef HAVE_AUDIO_SOUNDLIB_H */
/* Define to 1 if you have the <capi20.h> header file. */
/* #undef HAVE_CAPI20_H */
/* Define if you have capi4linux libs and headers */
/* #undef HAVE_CAPI4LINUX */
/* Define to 1 if you have the `chsize' function. */
#define HAVE_CHSIZE 1
/* Define to 1 if you have the `clone' function. */
/* #undef HAVE_CLONE */
/* Define to 1 if you have the `connect' function. */
/* #undef HAVE_CONNECT */
/* Define if we have linux/input.h AND it contains the INPUT event API */
/* #undef HAVE_CORRECT_LINUXINPUT_H */
/* Define to 1 if you have the <cups/cups.h> header file. */
/* #undef HAVE_CUPS_CUPS_H */
/* Define to 1 if you have the <curses.h> header file. */
/* #undef HAVE_CURSES_H */
/* Define to 1 if you have the <direct.h> header file. */
#define HAVE_DIRECT_H 1
/* Define to 1 if you have the <dlfcn.h> header file. */
/* #undef HAVE_DLFCN_H */
/* Define if you have dlopen */
/* #undef HAVE_DLOPEN */
/* Define to 1 if you have the <elf.h> header file. */
/* #undef HAVE_ELF_H */
/* Define to 1 if you have the `epoll_create' function. */
/* #undef HAVE_EPOLL_CREATE */
/* Define to 1 if you have the `ffs' function. */
/* #undef HAVE_FFS */
/* Define to 1 if you have the `finite' function. */
#define HAVE_FINITE 1
/* Define to 1 if you have the <float.h> header file. */
#define HAVE_FLOAT_H 1
/* Define to 1 if you have the <fontconfig/fontconfig.h> header file. */
/* #undef HAVE_FONTCONFIG_FONTCONFIG_H */
/* Define to 1 if you have the `fork' function. */
/* #undef HAVE_FORK */
/* Define to 1 if you have the `fpclass' function. */
#define HAVE_FPCLASS 1
/* Define if FreeType 2 is installed */
/* #undef HAVE_FREETYPE */
/* Define to 1 if you have the <freetype/freetype.h> header file. */
/* #undef HAVE_FREETYPE_FREETYPE_H */
/* Define to 1 if you have the <freetype/ftglyph.h> header file. */
/* #undef HAVE_FREETYPE_FTGLYPH_H */
/* Define to 1 if you have the <freetype/ftnames.h> header file. */
/* #undef HAVE_FREETYPE_FTNAMES_H */
/* Define to 1 if you have the <freetype/ftoutln.h> header file. */
/* #undef HAVE_FREETYPE_FTOUTLN_H */
/* Define to 1 if you have the <freetype/ftsnames.h> header file. */
/* #undef HAVE_FREETYPE_FTSNAMES_H */
/* Define if you have the <freetype/fttrigon.h> header file. */
/* #undef HAVE_FREETYPE_FTTRIGON_H */
/* Define to 1 if you have the <freetype/ftwinfnt.h> header file. */
/* #undef HAVE_FREETYPE_FTWINFNT_H */
/* Define to 1 if you have the <freetype/internal/sfnt.h> header file. */
/* #undef HAVE_FREETYPE_INTERNAL_SFNT_H */
/* Define to 1 if you have the <freetype/ttnameid.h> header file. */
/* #undef HAVE_FREETYPE_TTNAMEID_H */
/* Define to 1 if you have the <freetype/tttables.h> header file. */
/* #undef HAVE_FREETYPE_TTTABLES_H */
/* Define to 1 if the system has the type `fsblkcnt_t'. */
/* #undef HAVE_FSBLKCNT_T */
/* Define to 1 if the system has the type `fsfilcnt_t'. */
/* #undef HAVE_FSFILCNT_T */
/* Define to 1 if you have the `fstatfs' function. */
/* #undef HAVE_FSTATFS */
/* Define to 1 if you have the `fstatvfs' function. */
/* #undef HAVE_FSTATVFS */
/* Define to 1 if you have the <ft2build.h> header file. */
/* #undef HAVE_FT2BUILD_H */
/* Define to 1 if you have the `ftruncate' function. */
#define HAVE_FTRUNCATE 1
/* Define to 1 if you have the `futimes' function. */
/* #undef HAVE_FUTIMES */
/* Define to 1 if you have the `gethostbyname' function. */
/* #undef HAVE_GETHOSTBYNAME */
/* Define to 1 if you have the `getnetbyname' function. */
/* #undef HAVE_GETNETBYNAME */
/* Define to 1 if you have the <getopt.h> header file. */
#define HAVE_GETOPT_H 1
/* Define to 1 if you have the `getopt_long' function. */
#define HAVE_GETOPT_LONG 1
/* Define to 1 if you have the `getpagesize' function. */
#define HAVE_GETPAGESIZE 1
/* Define to 1 if you have the `getprotobyname' function. */
/* #undef HAVE_GETPROTOBYNAME */
/* Define to 1 if you have the `getprotobynumber' function. */
/* #undef HAVE_GETPROTOBYNUMBER */
/* Define to 1 if you have the `getpwuid' function. */
/* #undef HAVE_GETPWUID */
/* Define to 1 if you have the `getservbyport' function. */
/* #undef HAVE_GETSERVBYPORT */
/* Define to 1 if you have the `gettid' function. */
/* #undef HAVE_GETTID */
/* Define to 1 if you have the `gettimeofday' function. */
/* #undef HAVE_GETTIMEOFDAY */
/* Define to 1 if you have the `getuid' function. */
/* #undef HAVE_GETUID */
/* Define to 1 if you have the <gif_lib.h> header file. */
/* #undef HAVE_GIF_LIB_H */
/* Define to 1 if you have the <GL/glext.h> header file. */
/* #undef HAVE_GL_GLEXT_H */
/* Define to 1 if you have the <GL/glx.h> header file. */
/* #undef HAVE_GL_GLX_H */
/* Define to 1 if you have the <GL/gl.h> header file. */
/* #undef HAVE_GL_GL_H */
/* Define to 1 if the ICU libraries are installed */
/* #undef HAVE_ICU */
/* Define to 1 if you have the <ieeefp.h> header file. */
/* #undef HAVE_IEEEFP_H */
/* Define to 1 if you have the `inet_aton' function. */
/* #undef HAVE_INET_ATON */
/* Define to 1 if you have the `inet_network' function. */
/* #undef HAVE_INET_NETWORK */
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <io.h> header file. */
#define HAVE_IO_H 1
/* Define if IPX should use netipx/ipx.h from libc */
/* #undef HAVE_IPX_GNU */
/* Define if IPX includes are taken from Linux kernel */
/* #undef HAVE_IPX_LINUX */
/* Define to 1 if you have the `iswalnum' function. */
#define HAVE_ISWALNUM 1
/* Define to 1 if you have the <jack/jack.h> header file. */
/* #undef HAVE_JACK_JACK_H */
/* Define to 1 if you have the <jpeglib.h> header file. */
/* #undef HAVE_JPEGLIB_H */
/* Define to 1 if you have the <lcms.h> header file. */
/* #undef HAVE_LCMS_H */
/* Define to 1 if you have the <lcms/lcms.h> header file. */
/* #undef HAVE_LCMS_LCMS_H */
/* Define if you have libaudioIO */
/* #undef HAVE_LIBAUDIOIO */
/* Define to 1 if you have the <libaudioio.h> header file. */
/* #undef HAVE_LIBAUDIOIO_H */
/* Define if you have the curses library (-lcurses) */
/* #undef HAVE_LIBCURSES */
/* Define to 1 if you have the `i386' library (-li386). */
/* #undef HAVE_LIBI386 */
/* Define if you have the ncurses library (-lncurses) */
/* #undef HAVE_LIBNCURSES */
/* Define to 1 if you have the `nsl' library (-lnsl). */
/* #undef HAVE_LIBNSL */
/* Define to 1 if you have the `ossaudio' library (-lossaudio). */
/* #undef HAVE_LIBOSSAUDIO */
/* Define to 1 if you have the `poll' library (-lpoll). */
/* #undef HAVE_LIBPOLL */
/* Define to 1 if you have the `resolv' library (-lresolv). */
/* #undef HAVE_LIBRESOLV */
/* Define to 1 if you have the `socket' library (-lsocket). */
/* #undef HAVE_LIBSOCKET */
/* Define to 1 if you have the `w' library (-lw). */
/* #undef HAVE_LIBW */
/* Define to 1 if you have the `xpg4' library (-lxpg4). */
/* #undef HAVE_LIBXPG4 */
/* Define if you have the Xrandr library */
/* #undef HAVE_LIBXRANDR */
/* Define if you have the X Shape extension */
/* #undef HAVE_LIBXSHAPE */
/* Define if you have the Xxf86dga library version 2 */
/* #undef HAVE_LIBXXF86DGA2 */
/* Define if you have the Xxf86vm library */
/* #undef HAVE_LIBXXF86VM */
/* Define if you have the X Shm extension */
/* #undef HAVE_LIBXXSHM */
/* Define to 1 if you have the <link.h> header file. */
/* #undef HAVE_LINK_H */
/* Define if <linux/joystick.h> defines the Linux 2.2 joystick API */
/* #undef HAVE_LINUX_22_JOYSTICK_API */
/* Define to 1 if you have the <linux/capi.h> header file. */
/* #undef HAVE_LINUX_CAPI_H */
/* Define to 1 if you have the <linux/cdrom.h> header file. */
/* #undef HAVE_LINUX_CDROM_H */
/* Define to 1 if you have the <linux/compiler.h> header file. */
/* #undef HAVE_LINUX_COMPILER_H */
/* Define if Linux-style gethostbyname_r and gethostbyaddr_r are available */
/* #undef HAVE_LINUX_GETHOSTBYNAME_R_6 */
/* Define to 1 if you have the <linux/hdreg.h> header file. */
/* #undef HAVE_LINUX_HDREG_H */
/* Define to 1 if you have the <linux/input.h> header file. */
/* #undef HAVE_LINUX_INPUT_H */
/* Define to 1 if you have the <linux/ioctl.h> header file. */
/* #undef HAVE_LINUX_IOCTL_H */
/* Define to 1 if you have the <linux/joystick.h> header file. */
/* #undef HAVE_LINUX_JOYSTICK_H */
/* Define to 1 if you have the <linux/major.h> header file. */
/* #undef HAVE_LINUX_MAJOR_H */
/* Define to 1 if you have the <linux/param.h> header file. */
/* #undef HAVE_LINUX_PARAM_H */
/* Define to 1 if you have the <linux/serial.h> header file. */
/* #undef HAVE_LINUX_SERIAL_H */
/* Define to 1 if you have the <linux/ucdrom.h> header file. */
/* #undef HAVE_LINUX_UCDROM_H */
/* Define to 1 if the system has the type `long long'. */
#define HAVE_LONG_LONG 1
/* Define to 1 if you have the `lstat' function. */
/* #undef HAVE_LSTAT */
/* Define to 1 if you have the <machine/cpu.h> header file. */
/* #undef HAVE_MACHINE_CPU_H */
/* Define to 1 if you have the <machine/soundcard.h> header file. */
/* #undef HAVE_MACHINE_SOUNDCARD_H */
/* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `mmap' function. */
/* #undef HAVE_MMAP */
/* Define to 1 if you have the <mntent.h> header file. */
/* #undef HAVE_MNTENT_H */
/* Define to 1 if the system has the type `mode_t'. */
#define HAVE_MODE_T 1
/* Define if you have NAS including devel headers */
/* #undef HAVE_NAS */
/* Define to 1 if you have the <ncurses.h> header file. */
/* #undef HAVE_NCURSES_H */
/* Define to 1 if you have the <netdb.h> header file. */
/* #undef HAVE_NETDB_H */
/* Define to 1 if you have the <netinet/in.h> header file. */
/* #undef HAVE_NETINET_IN_H */
/* Define to 1 if you have the <netinet/in_systm.h> header file. */
/* #undef HAVE_NETINET_IN_SYSTM_H */
/* Define to 1 if you have the <netinet/tcp_fsm.h> header file. */
/* #undef HAVE_NETINET_TCP_FSM_H */
/* Define to 1 if you have the <netinet/tcp.h> header file. */
/* #undef HAVE_NETINET_TCP_H */
/* Define to 1 if you have the <net/if_arp.h> header file. */
/* #undef HAVE_NET_IF_ARP_H */
/* Define to 1 if you have the <net/if_dl.h> header file. */
/* #undef HAVE_NET_IF_DL_H */
/* Define to 1 if you have the <net/if.h> header file. */
/* #undef HAVE_NET_IF_H */
/* Define to 1 if you have the <net/if_types.h> header file. */
/* #undef HAVE_NET_IF_TYPES_H */
/* Define to 1 if you have the <net/route.h> header file. */
/* #undef HAVE_NET_ROUTE_H */
/* Define to 1 if the system has the type `off_t'. */
#define HAVE_OFF_T 1
/* Define if OpenGL is present on the system */
/* #undef HAVE_OPENGL */
/* Define to 1 if you have the <openssl/ssl.h> header file. */
/* #undef HAVE_OPENSSL_SSL_H */
/* Define if you have the Open Sound system */
/* #undef HAVE_OSS */
/* Define if you have the Open Sound system (MIDI interface) */
/* #undef HAVE_OSS_MIDI */
/* Define to 1 if you have the `pclose' function. */
#define HAVE_PCLOSE 1
/* Define to 1 if the system has the type `pid_t'. */
#define HAVE_PID_T 1
/* Define to 1 if you have the `popen' function. */
#define HAVE_POPEN 1
/* Define if we can use ppdev.h for parallel port access */
/* #undef HAVE_PPDEV */
/* Define to 1 if you have the `pread' function. */
/* #undef HAVE_PREAD */
/* Define to 1 if you have the <process.h> header file. */
#define HAVE_PROCESS_H 1
/* Define to 1 if you have the `pthread_getattr_np' function. */
/* #undef HAVE_PTHREAD_GETATTR_NP */
/* Define to 1 if you have the `pthread_get_stackaddr_np' function. */
/* #undef HAVE_PTHREAD_GET_STACKADDR_NP */
/* Define to 1 if you have the `pthread_get_stacksize_np' function. */
/* #undef HAVE_PTHREAD_GET_STACKSIZE_NP */
/* Define to 1 if you have the <pthread.h> header file. */
/* #undef HAVE_PTHREAD_H */
/* Define to 1 if the system has the type `pthread_rwlockattr_t'. */
/* #undef HAVE_PTHREAD_RWLOCKATTR_T */
/* Define to 1 if the system has the type `pthread_rwlock_t'. */
/* #undef HAVE_PTHREAD_RWLOCK_T */
/* Define to 1 if you have the <pwd.h> header file. */
/* #undef HAVE_PWD_H */
/* Define to 1 if you have the `pwrite' function. */
/* #undef HAVE_PWRITE */
/* Define to 1 if you have the `readlink' function. */
/* #undef HAVE_READLINK */
/* Define to 1 if you have the <regex.h> header file. */
/* #undef HAVE_REGEX_H */
/* Define to 1 if you have the <resolv.h> header file. */
/* #undef HAVE_RESOLV_H */
/* Define to 1 if you have the `rfork' function. */
/* #undef HAVE_RFORK */
/* Define if we have SANE development environment */
/* #undef HAVE_SANE */
/* Define to 1 if you have the <sched.h> header file. */
/* #undef HAVE_SCHED_H */
/* Define to 1 if you have the `sched_yield' function. */
/* #undef HAVE_SCHED_YIELD */
/* Define to 1 if you have the <scsi/scsi.h> header file. */
/* #undef HAVE_SCSI_SCSI_H */
/* Define to 1 if you have the <scsi/scsi_ioctl.h> header file. */
/* #undef HAVE_SCSI_SCSI_IOCTL_H */
/* Define to 1 if you have the <scsi/sg.h> header file. */
/* #undef HAVE_SCSI_SG_H */
/* Define to 1 if you have the `select' function. */
/* #undef HAVE_SELECT */
/* Define to 1 if you have the `sendmsg' function. */
/* #undef HAVE_SENDMSG */
/* Define to 1 if you have the `settimeofday' function. */
/* #undef HAVE_SETTIMEOFDAY */
/* Define if sigaddset is supported */
/* #undef HAVE_SIGADDSET */
/* Define to 1 if you have the `sigaltstack' function. */
/* #undef HAVE_SIGALTSTACK */
/* Define to 1 if `si_fd' is member of `siginfo_t'. */
/* #undef HAVE_SIGINFO_T_SI_FD */
/* Define to 1 if you have the `sigprocmask' function. */
/* #undef HAVE_SIGPROCMASK */
/* Define to 1 if you have the sigsetjmp (and siglongjmp) function */
/* #undef HAVE_SIGSETJMP */
/* Define to 1 if the system has the type `sigset_t'. */
/* #undef HAVE_SIGSET_T */
/* Define to 1 if the system has the type `size_t'. */
#define HAVE_SIZE_T 1
/* Define to 1 if you have the `snprintf' function. */
#define HAVE_SNPRINTF 1
/* Define to 1 if you have the <soundcard.h> header file. */
/* #undef HAVE_SOUNDCARD_H */
/* Define to 1 if you have the `spawnvp' function. */
#define HAVE_SPAWNVP 1
/* Define to 1 if the system has the type `ssize_t'. */
#define HAVE_SSIZE_T 1
/* Define to 1 if you have the `statfs' function. */
/* #undef HAVE_STATFS */
/* Define to 1 if you have the `statvfs' function. */
/* #undef HAVE_STATVFS */
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strcasecmp' function. */
#define HAVE_STRCASECMP 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strncasecmp' function. */
#define HAVE_STRNCASECMP 1
/* Define to 1 if `msg_accrights' is member of `struct msghdr'. */
/* #undef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */
/* Define to 1 if `name' is member of `struct option'. */
#define HAVE_STRUCT_OPTION_NAME 1
/* Define to 1 if `sa_len' is member of `struct sockaddr'. */
/* #undef HAVE_STRUCT_SOCKADDR_SA_LEN */
/* Define to 1 if `sun_len' is member of `struct sockaddr_un'. */
/* #undef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN */
/* Define to 1 if `f_bavail' is member of `struct statfs'. */
/* #undef HAVE_STRUCT_STATFS_F_BAVAIL */
/* Define to 1 if `f_bfree' is member of `struct statfs'. */
/* #undef HAVE_STRUCT_STATFS_F_BFREE */
/* Define to 1 if `f_favail' is member of `struct statfs'. */
/* #undef HAVE_STRUCT_STATFS_F_FAVAIL */
/* Define to 1 if `f_ffree' is member of `struct statfs'. */
/* #undef HAVE_STRUCT_STATFS_F_FFREE */
/* Define to 1 if `f_frsize' is member of `struct statfs'. */
/* #undef HAVE_STRUCT_STATFS_F_FRSIZE */
/* Define to 1 if `f_namelen' is member of `struct statfs'. */
/* #undef HAVE_STRUCT_STATFS_F_NAMELEN */
/* Define to 1 if `f_blocks' is member of `struct statvfs'. */
/* #undef HAVE_STRUCT_STATVFS_F_BLOCKS */
/* Define to 1 if `st_blocks' is member of `struct stat'. */
/* #undef HAVE_STRUCT_STAT_ST_BLOCKS */
/* Define to 1 if you have the <syscall.h> header file. */
/* #undef HAVE_SYSCALL_H */
/* Define to 1 if you have the <sys/asoundlib.h> header file. */
/* #undef HAVE_SYS_ASOUNDLIB_H */
/* Define to 1 if you have the <sys/cdio.h> header file. */
/* #undef HAVE_SYS_CDIO_H */
/* Define to 1 if you have the <sys/elf32.h> header file. */
/* #undef HAVE_SYS_ELF32_H */
/* Define to 1 if you have the <sys/epoll.h> header file. */
/* #undef HAVE_SYS_EPOLL_H */
/* Define to 1 if you have the <sys/errno.h> header file. */
/* #undef HAVE_SYS_ERRNO_H */
/* Define to 1 if you have the <sys/exec_elf.h> header file. */
/* #undef HAVE_SYS_EXEC_ELF_H */
/* Define to 1 if you have the <sys/filio.h> header file. */
/* #undef HAVE_SYS_FILIO_H */
/* Define to 1 if you have the <sys/ioctl.h> header file. */
/* #undef HAVE_SYS_IOCTL_H */
/* Define to 1 if you have the <sys/ipc.h> header file. */
/* #undef HAVE_SYS_IPC_H */
/* Define to 1 if you have the <sys/link.h> header file. */
/* #undef HAVE_SYS_LINK_H */
/* Define to 1 if you have the <sys/lwp.h> header file. */
/* #undef HAVE_SYS_LWP_H */
/* Define to 1 if you have the <sys/mman.h> header file. */
/* #undef HAVE_SYS_MMAN_H */
/* Define to 1 if you have the <sys/modem.h> header file. */
/* #undef HAVE_SYS_MODEM_H */
/* Define to 1 if you have the <sys/mount.h> header file. */
/* #undef HAVE_SYS_MOUNT_H */
/* Define to 1 if you have the <sys/msg.h> header file. */
/* #undef HAVE_SYS_MSG_H */
/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/poll.h> header file. */
/* #undef HAVE_SYS_POLL_H */
/* Define to 1 if you have the <sys/ptrace.h> header file. */
/* #undef HAVE_SYS_PTRACE_H */
/* Define to 1 if you have the <sys/reg.h> header file. */
/* #undef HAVE_SYS_REG_H */
/* Define to 1 if you have the <sys/scsiio.h> header file. */
/* #undef HAVE_SYS_SCSIIO_H */
/* Define to 1 if you have the <sys/shm.h> header file. */
/* #undef HAVE_SYS_SHM_H */
/* Define to 1 if you have the <sys/signal.h> header file. */
/* #undef HAVE_SYS_SIGNAL_H */
/* Define to 1 if you have the <sys/socket.h> header file. */
/* #undef HAVE_SYS_SOCKET_H */
/* Define to 1 if you have the <sys/sockio.h> header file. */
/* #undef HAVE_SYS_SOCKIO_H */
/* Define to 1 if you have the <sys/soundcard.h> header file. */
/* #undef HAVE_SYS_SOUNDCARD_H */
/* Define to 1 if you have the <sys/statfs.h> header file. */
/* #undef HAVE_SYS_STATFS_H */
/* Define to 1 if you have the <sys/statvfs.h> header file. */
/* #undef HAVE_SYS_STATVFS_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/strtio.h> header file. */
/* #undef HAVE_SYS_STRTIO_H */
/* Define to 1 if you have the <sys/syscall.h> header file. */
/* #undef HAVE_SYS_SYSCALL_H */
/* Define to 1 if you have the <sys/sysctl.h> header file. */
/* #undef HAVE_SYS_SYSCTL_H */
/* Define to 1 if you have the <sys/times.h> header file. */
/* #undef HAVE_SYS_TIMES_H */
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/uio.h> header file. */
/* #undef HAVE_SYS_UIO_H */
/* Define to 1 if you have the <sys/un.h> header file. */
/* #undef HAVE_SYS_UN_H */
/* Define to 1 if you have the <sys/user.h> header file. */
/* #undef HAVE_SYS_USER_H */
/* Define to 1 if you have the <sys/vfs.h> header file. */
/* #undef HAVE_SYS_VFS_H */
/* Define to 1 if you have the <sys/vm86.h> header file. */
/* #undef HAVE_SYS_VM86_H */
/* Define to 1 if you have the <sys/wait.h> header file. */
/* #undef HAVE_SYS_WAIT_H */
/* Define to 1 if you have the `tcgetattr' function. */
/* #undef HAVE_TCGETATTR */
/* Define to 1 if you have the <termios.h> header file. */
/* #undef HAVE_TERMIOS_H */
/* Define to 1 if you have the `timegm' function. */
/* #undef HAVE_TIMEGM */
/* Define to 1 if you have the <ucontext.h> header file. */
/* #undef HAVE_UCONTEXT_H */
/* Define to 1 if you have the <unicode/ubidi.h> header file. */
/* #undef HAVE_UNICODE_UBIDI_H */
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `usleep' function. */
/* #undef HAVE_USLEEP */
/* Define to 1 if you have the <utime.h> header file. */
#define HAVE_UTIME_H 1
/* Define to 1 if you have the <valgrind/memcheck.h> header file. */
/* #undef HAVE_VALGRIND_MEMCHECK_H */
/* Define if we have va_copy */
#define HAVE_VA_COPY 1
/* Define to 1 if you have the `vsnprintf' function. */
#define HAVE_VSNPRINTF 1
/* Define to 1 if you have the `wait4' function. */
/* #undef HAVE_WAIT4 */
/* Define to 1 if you have the `waitpid' function. */
/* #undef HAVE_WAITPID */
/* Define to 1 if you have the <X11/extensions/shape.h> header file. */
/* #undef HAVE_X11_EXTENSIONS_SHAPE_H */
/* Define to 1 if you have the <X11/extensions/xf86dga.h> header file. */
/* #undef HAVE_X11_EXTENSIONS_XF86DGA_H */
/* Define to 1 if you have the <X11/extensions/xf86vmode.h> header file. */
/* #undef HAVE_X11_EXTENSIONS_XF86VMODE_H */
/* Define to 1 if you have the <X11/extensions/XInput.h> header file. */
/* #undef HAVE_X11_EXTENSIONS_XINPUT_H */
/* Define to 1 if you have the <X11/extensions/Xrandr.h> header file. */
/* #undef HAVE_X11_EXTENSIONS_XRANDR_H */
/* Define to 1 if you have the <X11/extensions/Xrender.h> header file. */
/* #undef HAVE_X11_EXTENSIONS_XRENDER_H */
/* Define to 1 if you have the <X11/extensions/XShm.h> header file. */
/* #undef HAVE_X11_EXTENSIONS_XSHM_H */
/* Define to 1 if you have the <X11/XKBlib.h> header file. */
/* #undef HAVE_X11_XKBLIB_H */
/* Define to 1 if you have the <X11/Xlib.h> header file. */
/* #undef HAVE_X11_XLIB_H */
/* Define to 1 if you have the <X11/Xutil.h> header file. */
/* #undef HAVE_X11_XUTIL_H */
/* Define if you have the XKB extension */
/* #undef HAVE_XKB */
/* Define if Xrender has the XRenderSetPictureTransform function */
/* #undef HAVE_XRENDERSETPICTURETRANSFORM */
/* Define to 1 if you have the `_lwp_create' function. */
/* #undef HAVE__LWP_CREATE */
/* Define to 1 if you have the `_lwp_self' function. */
/* #undef HAVE__LWP_SELF */
/* Define to 1 if you have the `_pclose' function. */
#define HAVE__PCLOSE 1
/* Define to 1 if you have the `_popen' function. */
#define HAVE__POPEN 1
/* Define to 1 if you have the `_snprintf' function. */
#define HAVE__SNPRINTF 1
/* Define to 1 if you have the `_spawnvp' function. */
#define HAVE__SPAWNVP 1
/* Define to 1 if you have the `_stricmp' function. */
#define HAVE__STRICMP 1
/* Define to 1 if you have the `_strnicmp' function. */
#define HAVE__STRNICMP 1
/* Define to 1 if you have the `_vsnprintf' function. */
#define HAVE__VSNPRINTF 1
/* Define if we have __va_copy */
#define HAVE___VA_COPY 1
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "wine-devel@winehq.org"
/* Define to the full name of this package. */
#define PACKAGE_NAME "Wine"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "Wine 20050211"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "wine"
/* Define to the version of this package. */
#define PACKAGE_VERSION "20050211"
/* Define to the soname of the libcapi20 library. */
/* #undef SONAME_LIBCAPI20 */
/* Define to the soname of the libcrypto library. */
/* #undef SONAME_LIBCRYPTO */
/* Define to the soname of the libcups library. */
/* #undef SONAME_LIBCUPS */
/* Define to the soname of the libcurses library. */
/* #undef SONAME_LIBCURSES */
/* Define to the soname of the libfontconfig library. */
/* #undef SONAME_LIBFONTCONFIG */
/* Define to the soname of the libfreetype library. */
/* #undef SONAME_LIBFREETYPE */
/* Define to the soname of the libgif library. */
/* #undef SONAME_LIBGIF */
/* Define to the soname of the libGL library. */
/* #undef SONAME_LIBGL */
/* Define to the soname of the libjack library. */
/* #undef SONAME_LIBJACK */
/* Define to the soname of the libjpeg library. */
/* #undef SONAME_LIBJPEG */
/* Define to the soname of the liblcms library. */
/* #undef SONAME_LIBLCMS */
/* Define to the soname of the libncurses library. */
/* #undef SONAME_LIBNCURSES */
/* Define to the soname of the libssl library. */
/* #undef SONAME_LIBSSL */
/* Define to the soname of the libtxc_dxtn library. */
/* #undef SONAME_LIBTXC_DXTN */
/* Define to the soname of the libungif library. */
/* #undef SONAME_LIBUNGIF */
/* Define to the soname of the libX11 library. */
/* #undef SONAME_LIBX11 */
/* Define to the soname of the libXext library. */
/* #undef SONAME_LIBXEXT */
/* Define to the soname of the libXi library. */
/* #undef SONAME_LIBXI */
/* Define to the soname of the libXrandr library. */
/* #undef SONAME_LIBXRANDR */
/* Define to the soname of the libXrender library. */
/* #undef SONAME_LIBXRENDER */
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
/* #undef STACK_DIRECTION */
/* Define if the struct statfs is defined by <sys/mount.h> */
/* #undef STATFS_DEFINED_BY_SYS_MOUNT */
/* Define if the struct statfs is defined by <sys/statfs.h> */
/* #undef STATFS_DEFINED_BY_SYS_STATFS */
/* Define if the struct statfs is defined by <sys/vfs.h> */
/* #undef STATFS_DEFINED_BY_SYS_VFS */
/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
/* #undef STAT_MACROS_BROKEN */
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if the X Window System is missing or not being used. */
#define X_DISPLAY_MISSING 1
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
#define YYTEXT_POINTER 1
/* Set this to 64 to enable 64-bit file support on Linux */
/* #undef _FILE_OFFSET_BITS */
/* Define to a macro to generate an assembly function directive */
#define __ASM_FUNC(name) ".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef"
/* Define to a macro to generate an assembly name from a C symbol */
#define __ASM_NAME(name) "_" name
/* Define to the assembler keyword used to specify a word value */
#define __ASM_SHORT ".short"
/* Define to the assembler keyword used to specify an ASCII string */
#define __ASM_STRING ".string"
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif

View File

@@ -1,35 +1,25 @@
/*
* Ritch Edit 20 class extra info
*
* Copyright 2004 CodeWeavers (Aric Stewart)
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_RICHED20_H
#define __WINE_RICHED20_H
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "richedit.h"
extern VOID RICHED20_Register (VOID);
extern VOID RICHED20_Unregister (VOID);
#endif /* __WINE_RICHED20_H */
/*
* Resources for the binary we distribute to testers
*
* Copyright 2004 Ferenc Wagner
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "winetest.rc"
WINE_BUILD STRINGRES "build.id"
BUILD_INFO STRINGRES "build.nfo"
TESTS_URL STRINGRES "tests.url"

View File

@@ -0,0 +1,473 @@
/*
* GUI support
*
* Copyright 2004 Ferenc Wagner
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <windows.h>
#include <commctrl.h>
#include "resource.h"
#include "winetest.h"
/* Event object to signal successful window creation to main thread.
*/
HANDLE initEvent;
/* Dialog handle
*/
HWND dialog;
/* Progress data for the text* functions and for scaling.
*/
unsigned int progressMax, progressCurr;
double progressScale;
/* Progress group counter for the gui* functions.
*/
int progressGroup;
char *
renderString (va_list ap)
{
const char *fmt = va_arg (ap, char*);
static char buffer[128];
vsnprintf (buffer, sizeof buffer, fmt, ap);
return buffer;
}
int
MBdefault (int uType)
{
static const int matrix[][4] = {{IDOK, 0, 0, 0},
{IDOK, IDCANCEL, 0, 0},
{IDABORT, IDRETRY, IDIGNORE, 0},
{IDYES, IDNO, IDCANCEL, 0},
{IDYES, IDNO, 0, 0},
{IDRETRY, IDCANCEL, 0, 0}};
int type = uType & MB_TYPEMASK;
int def = (uType & MB_DEFMASK) / MB_DEFBUTTON2;
return matrix[type][def];
}
/* report (R_STATUS, fmt, ...) */
int
textStatus (va_list ap)
{
char *str = vstrmake (NULL, ap);
fputs (str, stderr);
fputc ('\n', stderr);
free (str);
return 0;
}
int
guiStatus (va_list ap)
{
size_t len;
char *str = vstrmake (&len, ap);
if (len > 128) str[129] = 0;
SetDlgItemText (dialog, IDC_SB, str);
free (str);
return 0;
}
/* report (R_PROGRESS, barnum, steps) */
int
textProgress (va_list ap)
{
progressGroup = va_arg (ap, int);
progressMax = va_arg (ap, int);
progressCurr = 0;
return 0;
}
int
guiProgress (va_list ap)
{
unsigned int max;
HWND pb;
progressGroup = va_arg (ap, int);
progressMax = max = va_arg (ap, int);
progressCurr = 0;
if (max > 0xffff) {
progressScale = (double)0xffff / max;
max = 0xffff;
}
else progressScale = 1;
pb = GetDlgItem (dialog, IDC_PB0 + progressGroup * 2);
SendMessage (pb, PBM_SETRANGE, 0, MAKELPARAM (0, max));
SendMessage (pb, PBM_SETSTEP, (WPARAM)1, 0);
return 0;
}
/* report (R_STEP, fmt, ...) */
int
textStep (va_list ap)
{
char *str = vstrmake (NULL, ap);
progressCurr++;
fputs (str, stderr);
fprintf (stderr, " (%d of %d)\n", progressCurr, progressMax);
free (str);
return 0;
}
int
guiStep (va_list ap)
{
const int pgID = IDC_ST0 + progressGroup * 2;
char *str = vstrmake (NULL, ap);
progressCurr++;
SetDlgItemText (dialog, pgID, str);
SendDlgItemMessage (dialog, pgID+1, PBM_SETPOS,
(WPARAM)(progressScale * progressCurr), 0);
free (str);
return 0;
}
/* report (R_DELTA, inc, fmt, ...) */
int
textDelta (va_list ap)
{
const int inc = va_arg (ap, int);
char *str = vstrmake (NULL, ap);
progressCurr += inc;
fputs (str, stderr);
fprintf (stderr, " (%d of %d)\n", progressCurr, progressMax);
free (str);
return 0;
}
int
guiDelta (va_list ap)
{
const int inc = va_arg (ap, int);
const int pgID = IDC_ST0 + progressGroup * 2;
char *str = vstrmake (NULL, ap);
progressCurr += inc;
SetDlgItemText (dialog, pgID, str);
SendDlgItemMessage (dialog, pgID+1, PBM_SETPOS,
(WPARAM)(progressScale * progressCurr), 0);
free (str);
return 0;
}
/* report (R_DIR, fmt, ...) */
int
textDir (va_list ap)
{
char *str = vstrmake (NULL, ap);
fputs ("Temporary directory: ", stderr);
fputs (str, stderr);
fputc ('\n', stderr);
free (str);
return 0;
}
int
guiDir (va_list ap)
{
char *str = vstrmake (NULL, ap);
SetDlgItemText (dialog, IDC_DIR, str);
free (str);
return 0;
}
/* report (R_OUT, fmt, ...) */
int
textOut (va_list ap)
{
char *str = vstrmake (NULL, ap);
fputs ("Log file: ", stderr);
fputs (str, stderr);
fputc ('\n', stderr);
free (str);
return 0;
}
int
guiOut (va_list ap)
{
char *str = vstrmake (NULL, ap);
SetDlgItemText (dialog, IDC_OUT, str);
free (str);
return 0;
}
/* report (R_WARNING, fmt, ...) */
int
textWarning (va_list ap)
{
fputs ("Warning: ", stderr);
textStatus (ap);
return 0;
}
int
guiWarning (va_list ap)
{
char *str = vstrmake (NULL, ap);
MessageBox (dialog, str, "Warning", MB_ICONWARNING | MB_OK);
free (str);
return 0;
}
/* report (R_ERROR, fmt, ...) */
int
textError (va_list ap)
{
fputs ("Error: ", stderr);
textStatus (ap);
return 0;
}
int
guiError (va_list ap)
{
char *str = vstrmake (NULL, ap);
MessageBox (dialog, str, "Error", MB_ICONERROR | MB_OK);
free (str);
return 0;
}
/* report (R_FATAL, fmt, ...) */
int
textFatal (va_list ap)
{
textError (ap);
exit (1);
}
int
guiFatal (va_list ap)
{
guiError (ap);
exit (1);
}
/* report (R_ASK, type, fmt, ...) */
int
textAsk (va_list ap)
{
int uType = va_arg (ap, int);
int ret = MBdefault (uType);
char *str = vstrmake (NULL, ap);
fprintf (stderr, "Question of type %d: %s\n"
"Returning default: %d\n", uType, str, ret);
free (str);
return ret;
}
int
guiAsk (va_list ap)
{
int uType = va_arg (ap, int);
char *str = vstrmake (NULL, ap);
int ret = MessageBox (dialog, str, "Question",
MB_ICONQUESTION | uType);
free (str);
return ret;
}
/* Quiet functions */
int
qNoOp (va_list ap)
{
return 0;
}
int
qFatal (va_list ap)
{
exit (1);
}
int
qAsk (va_list ap)
{
return MBdefault (va_arg (ap, int));
}
BOOL CALLBACK
AboutProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
case WM_COMMAND:
switch (LOWORD (wParam)) {
case IDCANCEL:
EndDialog (hwnd, IDCANCEL);
return TRUE;
}
}
return FALSE;
}
BOOL CALLBACK
DlgProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
case WM_INITDIALOG:
SendMessage (hwnd, WM_SETICON, ICON_SMALL,
(LPARAM)LoadIcon (GetModuleHandle (NULL),
MAKEINTRESOURCE (IDI_WINE)));
SendMessage (hwnd, WM_SETICON, ICON_BIG,
(LPARAM)LoadIcon (GetModuleHandle (NULL),
MAKEINTRESOURCE (IDI_WINE)));
dialog = hwnd;
if (!SetEvent (initEvent)) {
report (R_STATUS, "Can't signal main thread: %d",
GetLastError ());
EndDialog (hwnd, 2);
}
return TRUE;
case WM_CLOSE:
EndDialog (hwnd, 3);
return TRUE;
case WM_COMMAND:
switch (LOWORD (wParam)) {
case IDHELP:
DialogBox (GetModuleHandle (NULL),
MAKEINTRESOURCE (IDD_ABOUT), hwnd, AboutProc);
return TRUE;
case IDABORT:
report (R_WARNING, "Not implemented");
return TRUE;
}
}
return FALSE;
}
DWORD WINAPI
DlgThreadProc ()
{
int ret;
InitCommonControls ();
ret = DialogBox (GetModuleHandle (NULL),
MAKEINTRESOURCE (IDD_STATUS),
NULL, DlgProc);
switch (ret) {
case 0:
report (R_WARNING, "Invalid parent handle");
break;
case 1:
report (R_WARNING, "DialogBox failed: %d",
GetLastError ());
break;
case 3:
exit (0);
default:
report (R_STATUS, "Dialog exited: %d", ret);
}
return 0;
}
int
report (enum report_type t, ...)
{
typedef int r_fun_t (va_list);
va_list ap;
int ret = 0;
static r_fun_t * const text_funcs[] =
{textStatus, textProgress, textStep, textDelta,
textDir, textOut,
textWarning, textError, textFatal, textAsk};
static r_fun_t * const GUI_funcs[] =
{guiStatus, guiProgress, guiStep, guiDelta,
guiDir, guiOut,
guiWarning, guiError, guiFatal, guiAsk};
static r_fun_t * const quiet_funcs[] =
{qNoOp, qNoOp, qNoOp, qNoOp,
qNoOp, qNoOp,
qNoOp, qNoOp, qFatal, qAsk};
static r_fun_t * const * funcs = NULL;
switch (t) {
case R_TEXTMODE:
funcs = text_funcs;
return 0;
case R_QUIET:
funcs = quiet_funcs;
return 0;
default:
break;
}
if (!funcs) {
HANDLE DlgThread;
DWORD DlgThreadID;
funcs = text_funcs;
initEvent = CreateEvent (NULL, FALSE, FALSE, NULL);
if (!initEvent)
report (R_STATUS, "Can't create event object: %d",
GetLastError ());
else {
DlgThread = CreateThread (NULL, 0, DlgThreadProc,
NULL, 0, &DlgThreadID);
if (!DlgThread)
report (R_STATUS, "Can't create GUI thread: %d",
GetLastError ());
else {
DWORD ret = WaitForSingleObject (initEvent, INFINITE);
switch (ret) {
case WAIT_OBJECT_0:
funcs = GUI_funcs;
break;
case WAIT_TIMEOUT:
report (R_STATUS, "GUI creation timed out");
break;
case WAIT_FAILED:
report (R_STATUS, "Wait for GUI failed: %d",
GetLastError ());
break;
default:
report (R_STATUS, "Wait returned %d",
ret);
break;
}
}
}
}
va_start (ap, t);
if (t < sizeof text_funcs / sizeof text_funcs[0] &&
t < sizeof GUI_funcs / sizeof GUI_funcs[0] &&
t >= 0) ret = funcs[t](ap);
else report (R_WARNING, "unimplemented report type: %d", t);
va_end (ap);
return ret;
}

View File

@@ -0,0 +1,621 @@
/*
* Wine Conformance Test EXE
*
* Copyright 2003, 2004 Jakob Eriksson (for Solid Form Sweden AB)
* Copyright 2003 Dimitrie O. Paun
* Copyright 2003 Ferenc Wagner
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* This program is dedicated to Anna Lindh,
* Swedish Minister of Foreign Affairs.
* Anna was murdered September 11, 2003.
*
*/
#include "config.h"
#include "wine/port.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <errno.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <windows.h>
#include "winetest.h"
#include "resource.h"
struct wine_test
{
char *name;
int resource;
int subtest_count;
char **subtests;
char *exename;
};
struct rev_info
{
const char* file;
const char* rev;
};
static struct wine_test *wine_tests;
static struct rev_info *rev_infos = NULL;
static const char whitespace[] = " \t\r\n";
static int running_under_wine ()
{
HMODULE module = GetModuleHandleA("ntdll.dll");
if (!module) return 0;
return (GetProcAddress(module, "wine_server_call") != NULL);
}
static int running_on_visible_desktop ()
{
FARPROC pGetProcessWindowStation = GetProcAddress(GetModuleHandle("user32.dll"), "GetProcessWindowStation");
if (pGetProcessWindowStation)
{
DWORD len;
HWINSTA wstation;
USEROBJECTFLAGS uoflags;
FARPROC pGetUserObjectInformationA = GetProcAddress(GetModuleHandle("user32.dll"), "GetUserObjectInformationA");
wstation = (HWINSTA)pGetProcessWindowStation();
assert(pGetUserObjectInformationA(wstation, UOI_FLAGS, &uoflags, sizeof(uoflags), &len));
return (uoflags.dwFlags & WSF_VISIBLE) != 0;
}
else
return IsWindowVisible(GetDesktopWindow());
}
void print_version ()
{
OSVERSIONINFOEX ver;
BOOL ext;
ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
if (!(ext = GetVersionEx ((OSVERSIONINFO *) &ver)))
{
ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if (!GetVersionEx ((OSVERSIONINFO *) &ver))
report (R_FATAL, "Can't get OS version.");
}
xprintf (" bRunningUnderWine=%d\n", running_under_wine ());
xprintf (" bRunningOnVisibleDesktop=%d\n", running_on_visible_desktop ());
xprintf (" dwMajorVersion=%ld\n dwMinorVersion=%ld\n"
" dwBuildNumber=%ld\n PlatformId=%ld\n szCSDVersion=%s\n",
ver.dwMajorVersion, ver.dwMinorVersion, ver.dwBuildNumber,
ver.dwPlatformId, ver.szCSDVersion);
if (!ext) return;
xprintf (" wServicePackMajor=%d\n wServicePackMinor=%d\n"
" wSuiteMask=%d\n wProductType=%d\n wReserved=%d\n",
ver.wServicePackMajor, ver.wServicePackMinor, ver.wSuiteMask,
ver.wProductType, ver.wReserved);
}
static inline int is_dot_dir(const char* x)
{
return ((x[0] == '.') && ((x[1] == 0) || ((x[1] == '.') && (x[2] == 0))));
}
void remove_dir (const char *dir)
{
HANDLE hFind;
WIN32_FIND_DATA wfd;
char path[MAX_PATH];
size_t dirlen = strlen (dir);
/* Make sure the directory exists before going further */
memcpy (path, dir, dirlen);
strcpy (path + dirlen++, "\\*");
hFind = FindFirstFile (path, &wfd);
if (hFind == INVALID_HANDLE_VALUE) return;
do {
char *lp = wfd.cFileName;
if (!lp[0]) lp = wfd.cAlternateFileName; /* ? FIXME not (!lp) ? */
if (is_dot_dir (lp)) continue;
strcpy (path + dirlen, lp);
if (FILE_ATTRIBUTE_DIRECTORY & wfd.dwFileAttributes)
remove_dir(path);
else if (!DeleteFile (path))
report (R_WARNING, "Can't delete file %s: error %d",
path, GetLastError ());
} while (FindNextFile (hFind, &wfd));
FindClose (hFind);
if (!RemoveDirectory (dir))
report (R_WARNING, "Can't remove directory %s: error %d",
dir, GetLastError ());
}
const char* get_test_source_file(const char* test, const char* subtest)
{
static const char* special_dirs[][2] = {
{ "gdi32", "gdi"}, { "kernel32", "kernel" },
{ "msacm32", "msacm" },
{ "user32", "user" }, { "winspool.drv", "winspool" },
{ "ws2_32", "winsock" }, { 0, 0 }
};
static char buffer[MAX_PATH];
int i;
for (i = 0; special_dirs[i][0]; i++) {
if (strcmp(test, special_dirs[i][0]) == 0) {
test = special_dirs[i][1];
break;
}
}
snprintf(buffer, sizeof(buffer), "dlls/%s/tests/%s.c", test, subtest);
return buffer;
}
const char* get_file_rev(const char* file)
{
const struct rev_info* rev;
for(rev = rev_infos; rev->file; rev++) {
if (strcmp(rev->file, file) == 0) return rev->rev;
}
return "-";
}
void extract_rev_infos ()
{
char revinfo[256], *p;
int size = 0, i, len;
HMODULE module = GetModuleHandle (NULL);
for (i = 0; TRUE; i++) {
if (i >= size) {
size += 100;
rev_infos = xrealloc (rev_infos, size * sizeof (*rev_infos));
}
memset(rev_infos + i, 0, sizeof(rev_infos[i]));
len = LoadStringA (module, REV_INFO+i, revinfo, sizeof(revinfo));
if (len == 0) break; /* end of revision info */
if (len >= sizeof(revinfo) - 1)
report (R_FATAL, "Revision info too long.");
if(!(p = strrchr(revinfo, ':')))
report (R_FATAL, "Revision info malformed (i=%d)", i);
*p = 0;
rev_infos[i].file = strdup(revinfo);
rev_infos[i].rev = strdup(p + 1);
}
}
void* extract_rcdata (int id, int type, DWORD* size)
{
HRSRC rsrc;
HGLOBAL hdl;
LPVOID addr;
if (!(rsrc = FindResource (NULL, (LPTSTR)id, MAKEINTRESOURCE(type))) ||
!(*size = SizeofResource (0, rsrc)) ||
!(hdl = LoadResource (0, rsrc)) ||
!(addr = LockResource (hdl)))
return NULL;
return addr;
}
/* Fills in the name and exename fields */
void
extract_test (struct wine_test *test, const char *dir, int id)
{
BYTE* code;
DWORD size;
FILE* fout;
int strlen, bufflen = 128;
char *exepos;
code = extract_rcdata (id, TESTRES, &size);
if (!code) report (R_FATAL, "Can't find test resource %d: %d",
id, GetLastError ());
test->name = xmalloc (bufflen);
while ((strlen = LoadStringA (NULL, id, test->name, bufflen))
== bufflen - 1) {
bufflen *= 2;
test->name = xrealloc (test->name, bufflen);
}
if (!strlen) report (R_FATAL, "Can't read name of test %d.", id);
test->exename = strmake (NULL, "%s/%s", dir, test->name);
exepos = strstr (test->name, "_test.exe");
if (!exepos) report (R_FATAL, "Not an .exe file: %s", test->name);
*exepos = 0;
test->name = xrealloc (test->name, exepos - test->name + 1);
report (R_STEP, "Extracting: %s", test->name);
if (!(fout = fopen (test->exename, "wb")) ||
(fwrite (code, size, 1, fout) != 1) ||
fclose (fout)) report (R_FATAL, "Failed to write file %s.",
test->exename);
}
/* Run a command for MS milliseconds. If OUT != NULL, also redirect
stdout to there.
Return the exit status, -2 if can't create process or the return
value of WaitForSingleObject.
*/
int
run_ex (char *cmd, const char *out, DWORD ms)
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
int fd, oldstdout = -1;
DWORD wait, status;
GetStartupInfo (&si);
si.wShowWindow = SW_HIDE;
si.dwFlags = STARTF_USESHOWWINDOW;
if (out) {
fd = open (out, O_WRONLY | O_CREAT, 0666);
if (-1 == fd)
report (R_FATAL, "Can't open '%s': %d", out, errno);
oldstdout = dup (1);
if (-1 == oldstdout)
report (R_FATAL, "Can't save stdout: %d", errno);
if (-1 == dup2 (fd, 1))
report (R_FATAL, "Can't redirect stdout: %d", errno);
close (fd);
}
if (!CreateProcessA (NULL, cmd, NULL, NULL, TRUE, 0,
NULL, NULL, &si, &pi)) {
status = -2;
} else {
CloseHandle (pi.hThread);
wait = WaitForSingleObject (pi.hProcess, ms);
if (wait == WAIT_OBJECT_0) {
GetExitCodeProcess (pi.hProcess, &status);
} else {
switch (wait) {
case WAIT_FAILED:
report (R_ERROR, "Wait for '%s' failed: %d", cmd,
GetLastError ());
break;
case WAIT_TIMEOUT:
report (R_ERROR, "Process '%s' timed out.", cmd);
break;
default:
report (R_ERROR, "Wait returned %d", wait);
}
status = wait;
if (!TerminateProcess (pi.hProcess, 257))
report (R_ERROR, "TerminateProcess failed: %d",
GetLastError ());
wait = WaitForSingleObject (pi.hProcess, 5000);
switch (wait) {
case WAIT_FAILED:
report (R_ERROR,
"Wait for termination of '%s' failed: %d",
cmd, GetLastError ());
break;
case WAIT_OBJECT_0:
break;
case WAIT_TIMEOUT:
report (R_ERROR, "Can't kill process '%s'", cmd);
break;
default:
report (R_ERROR, "Waiting for termination: %d",
wait);
}
}
CloseHandle (pi.hProcess);
}
if (out) {
close (1);
if (-1 == dup2 (oldstdout, 1))
report (R_FATAL, "Can't recover stdout: %d", errno);
close (oldstdout);
}
return status;
}
void
get_subtests (const char *tempdir, struct wine_test *test, int id)
{
char *subname;
FILE *subfile;
size_t total;
char buffer[8192], *index;
static const char header[] = "Valid test names:";
int allocated;
test->subtest_count = 0;
subname = tempnam (0, "sub");
if (!subname) report (R_FATAL, "Can't name subtests file.");
extract_test (test, tempdir, id);
run_ex (test->exename, subname, 5000);
subfile = fopen (subname, "r");
if (!subfile) {
report (R_ERROR, "Can't open subtests output of %s: %d",
test->name, errno);
goto quit;
}
total = fread (buffer, 1, sizeof buffer, subfile);
fclose (subfile);
if (sizeof buffer == total) {
report (R_ERROR, "Subtest list of %s too big.",
test->name, sizeof buffer);
goto quit;
}
buffer[total] = 0;
index = strstr (buffer, header);
if (!index) {
report (R_ERROR, "Can't parse subtests output of %s",
test->name);
goto quit;
}
index += sizeof header;
allocated = 10;
test->subtests = xmalloc (allocated * sizeof(char*));
index = strtok (index, whitespace);
while (index) {
if (test->subtest_count == allocated) {
allocated *= 2;
test->subtests = xrealloc (test->subtests,
allocated * sizeof(char*));
}
test->subtests[test->subtest_count++] = strdup (index);
index = strtok (NULL, whitespace);
}
test->subtests = xrealloc (test->subtests,
test->subtest_count * sizeof(char*));
quit:
if (remove (subname))
report (R_WARNING, "Can't delete file '%s': %d",
subname, errno);
free (subname);
}
void
run_test (struct wine_test* test, const char* subtest)
{
int status;
const char* file = get_test_source_file(test->name, subtest);
const char* rev = get_file_rev(file);
char *cmd = strmake (NULL, "%s %s", test->exename, subtest);
xprintf ("%s:%s start %s %s\n", test->name, subtest, file, rev);
status = run_ex (cmd, NULL, 120000);
free (cmd);
xprintf ("%s:%s done (%d)\n", test->name, subtest, status);
}
BOOL CALLBACK
EnumTestFileProc (HMODULE hModule, LPCTSTR lpszType,
LPTSTR lpszName, LONG_PTR lParam)
{
(*(int*)lParam)++;
return TRUE;
}
char *
run_tests (char *logname, const char *tag)
{
int nr_of_files = 0, nr_of_tests = 0, i;
char *tempdir;
int logfile;
char *strres, *eol, *nextline;
DWORD strsize;
SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
if (!logname) {
logname = tempnam (0, "res");
if (!logname) report (R_FATAL, "Can't name logfile.");
}
report (R_OUT, logname);
logfile = open (logname, O_WRONLY | O_CREAT | O_EXCL | O_APPEND,
0666);
if (-1 == logfile) {
if (EEXIST == errno)
report (R_FATAL, "File %s already exists.", logname);
else report (R_FATAL, "Could not open logfile: %d", errno);
}
if (-1 == dup2 (logfile, 1))
report (R_FATAL, "Can't redirect stdout: %d", errno);
close (logfile);
tempdir = tempnam (0, "wct");
if (!tempdir)
report (R_FATAL, "Can't name temporary dir (check %%TEMP%%).");
report (R_DIR, tempdir);
if (!CreateDirectory (tempdir, NULL))
report (R_FATAL, "Could not create directory: %s", tempdir);
xprintf ("Version 3\n");
strres = extract_rcdata (WINE_BUILD, STRINGRES, &strsize);
xprintf ("Tests from build ");
if (strres) xprintf ("%.*s", strsize, strres);
else xprintf ("-\n");
strres = extract_rcdata (TESTS_URL, STRINGRES, &strsize);
xprintf ("Archive: ");
if (strres) xprintf ("%.*s", strsize, strres);
else xprintf ("-\n");
xprintf ("Tag: %s\n", tag?tag:"");
xprintf ("Build info:\n");
strres = extract_rcdata (BUILD_INFO, STRINGRES, &strsize);
while (strres) {
eol = memchr (strres, '\n', strsize);
if (!eol) {
nextline = NULL;
eol = strres + strsize;
} else {
strsize -= eol - strres + 1;
nextline = strsize?eol+1:NULL;
if (eol > strres && *(eol-1) == '\r') eol--;
}
xprintf (" %.*s\n", eol-strres, strres);
strres = nextline;
}
xprintf ("Operating system version:\n");
print_version ();
xprintf ("Test output:\n" );
report (R_STATUS, "Counting tests");
if (!EnumResourceNames (NULL, MAKEINTRESOURCE(TESTRES),
EnumTestFileProc, (LPARAM)&nr_of_files))
report (R_FATAL, "Can't enumerate test files: %d",
GetLastError ());
wine_tests = xmalloc (nr_of_files * sizeof wine_tests[0]);
report (R_STATUS, "Extracting tests");
report (R_PROGRESS, 0, nr_of_files);
for (i = 0; i < nr_of_files; i++) {
get_subtests (tempdir, wine_tests+i, i);
nr_of_tests += wine_tests[i].subtest_count;
}
report (R_DELTA, 0, "Extracting: Done");
report (R_STATUS, "Running tests");
report (R_PROGRESS, 1, nr_of_tests);
for (i = 0; i < nr_of_files; i++) {
struct wine_test *test = wine_tests + i;
int j;
for (j = 0; j < test->subtest_count; j++) {
report (R_STEP, "Running: %s:%s", test->name,
test->subtests[j]);
run_test (test, test->subtests[j]);
}
}
report (R_DELTA, 0, "Running: Done");
report (R_STATUS, "Cleaning up");
close (1);
remove_dir (tempdir);
free (tempdir);
free (wine_tests);
return logname;
}
void
usage ()
{
fprintf (stderr, "\
Usage: winetest [OPTION]...\n\n\
-c console mode, no GUI\n\
-e preserve the environment\n\
-h print this message and exit\n\
-q quiet mode, no output at all\n\
-o FILE put report into FILE, do not submit\n\
-s FILE submit FILE, do not run tests\n\
-t TAG include TAG of characters [-.0-9a-zA-Z] in the report\n");
}
int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
LPSTR cmdLine, int cmdShow)
{
char *logname = NULL;
const char *cp, *submit = NULL, *tag = NULL;
int reset_env = 1;
if (!running_on_visible_desktop ()) {
report (R_ERROR, "Tests must be run on a visible desktop");
exit (2);
}
/* initialize the revision information first */
extract_rev_infos();
cmdLine = strtok (cmdLine, whitespace);
while (cmdLine) {
if (cmdLine[0] != '-' || cmdLine[2]) {
report (R_ERROR, "Not a single letter option: %s", cmdLine);
usage ();
exit (2);
}
switch (cmdLine[1]) {
case 'c':
report (R_TEXTMODE);
break;
case 'e':
reset_env = 0;
break;
case 'h':
usage ();
exit (0);
case 'q':
report (R_QUIET);
break;
case 's':
submit = strtok (NULL, whitespace);
if (tag)
report (R_WARNING, "ignoring tag for submission");
send_file (submit);
break;
case 'o':
logname = strtok (NULL, whitespace);
break;
case 't':
tag = strtok (NULL, whitespace);
cp = badtagchar (tag);
if (cp) {
report (R_ERROR, "invalid char in tag: %c", *cp);
usage ();
exit (2);
}
break;
default:
report (R_ERROR, "invalid option: -%c", cmdLine[1]);
usage ();
exit (2);
}
cmdLine = strtok (NULL, whitespace);
}
if (!submit) {
if (reset_env && (putenv ("WINETEST_PLATFORM=windows") ||
putenv ("WINETEST_DEBUG=1") ||
putenv ("WINETEST_INTERACTIVE=0") ||
putenv ("WINETEST_REPORT_SUCCESS=0")))
report (R_FATAL, "Could not reset environment: %d", errno);
report (R_STATUS, "Starting up");
if (!logname) {
logname = run_tests (NULL, tag);
if (report (R_ASK, MB_YESNO, "Do you want to submit the "
"test results?") == IDYES)
if (!send_file (logname) && remove (logname))
report (R_WARNING, "Can't remove logfile: %d.", errno);
free (logname);
} else run_tests (logname, tag);
report (R_STATUS, "Finished");
}
exit (0);
}

View File

@@ -0,0 +1,23 @@
PATH_TO_TOP = ../../..
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = winetest
TARGET_SDKLIBS = comctl32.a comdlg32.a ws2_32.a
TARGET_OBJECTS = \
main.o \
send.o \
util.o \
gui.o
TARGET_CFLAGS = -Wall -Werror -D__USE_W32API
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -0,0 +1,469 @@
/*
* Wine porting definitions
*
* Copyright 1996 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_WINE_PORT_H
#define __WINE_WINE_PORT_H
#ifndef __WINE_CONFIG_H
# error You must include config.h to use this header
#endif
#define _GNU_SOURCE /* for pread/pwrite */
#include <fcntl.h>
#include <math.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_DIRECT_H
# include <direct.h>
#endif
#ifdef HAVE_IO_H
# include <io.h>
#endif
#ifdef HAVE_PROCESS_H
# include <process.h>
#endif
#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
/****************************************************************
* Type definitions
*/
#ifndef HAVE_MODE_T
typedef int mode_t;
#endif
#ifndef HAVE_OFF_T
typedef long off_t;
#endif
#ifndef HAVE_PID_T
typedef int pid_t;
#endif
#ifndef HAVE_SIZE_T
typedef unsigned int size_t;
#endif
#ifndef HAVE_SSIZE_T
typedef int ssize_t;
#endif
#ifndef HAVE_FSBLKCNT_T
typedef unsigned long fsblkcnt_t;
#endif
#ifndef HAVE_FSFILCNT_T
typedef unsigned long fsfilcnt_t;
#endif
#ifndef HAVE_STRUCT_STATVFS_F_BLOCKS
struct statvfs
{
unsigned long f_bsize;
unsigned long f_frsize;
fsblkcnt_t f_blocks;
fsblkcnt_t f_bfree;
fsblkcnt_t f_bavail;
fsfilcnt_t f_files;
fsfilcnt_t f_ffree;
fsfilcnt_t f_favail;
unsigned long f_fsid;
unsigned long f_flag;
unsigned long f_namemax;
};
#endif /* HAVE_STRUCT_STATVFS_F_BLOCKS */
/****************************************************************
* Macro definitions
*/
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#else
#define RTLD_LAZY 0x001
#define RTLD_NOW 0x002
#define RTLD_GLOBAL 0x100
#endif
#if !defined(HAVE_FTRUNCATE) && defined(HAVE_CHSIZE)
#define ftruncate chsize
#endif
#if !defined(HAVE_POPEN) && defined(HAVE__POPEN)
#define popen _popen
#endif
#if !defined(HAVE_PCLOSE) && defined(HAVE__PCLOSE)
#define pclose _pclose
#endif
#if !defined(HAVE_SNPRINTF) && defined(HAVE__SNPRINTF)
#define snprintf _snprintf
#endif
#if !defined(HAVE_VSNPRINTF) && defined(HAVE__VSNPRINTF)
#define vsnprintf _vsnprintf
#endif
#ifndef S_ISLNK
# define S_ISLNK(mod) (0)
#endif
#ifndef S_ISSOCK
# define S_ISSOCK(mod) (0)
#endif
#ifndef S_ISDIR
# define S_ISDIR(mod) (((mod) & _S_IFMT) == _S_IFDIR)
#endif
#ifndef S_ISCHR
# define S_ISCHR(mod) (((mod) & _S_IFMT) == _S_IFCHR)
#endif
#ifndef S_ISFIFO
# define S_ISFIFO(mod) (((mod) & _S_IFMT) == _S_IFIFO)
#endif
#ifndef S_ISREG
# define S_ISREG(mod) (((mod) & _S_IFMT) == _S_IFREG)
#endif
#ifndef S_IWUSR
# define S_IWUSR 0
#endif
/* So we open files in 64 bit access mode on Linux */
#ifndef O_LARGEFILE
# define O_LARGEFILE 0
#endif
#ifndef O_NONBLOCK
# define O_NONBLOCK 0
#endif
#ifndef O_BINARY
# define O_BINARY 0
#endif
#if !defined(S_IXUSR) && defined(S_IEXEC)
# define S_IXUSR S_IEXEC
#endif
#if !defined(S_IXGRP) && defined(S_IEXEC)
# define S_IXGRP S_IEXEC
#endif
#if !defined(S_IXOTH) && defined(S_IEXEC)
# define S_IXOTH S_IEXEC
#endif
/****************************************************************
* Constants
*/
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#ifndef M_PI_2
#define M_PI_2 1.570796326794896619
#endif
/* Macros to define assembler functions somewhat portably */
#if defined(__GNUC__) && !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(__APPLE__)
# define __ASM_GLOBAL_FUNC(name,code) \
__asm__( ".text\n\t" \
".align 4\n\t" \
".globl " __ASM_NAME(#name) "\n\t" \
__ASM_FUNC(#name) "\n" \
__ASM_NAME(#name) ":\n\t" \
code \
"\n\t.previous" );
#else /* defined(__GNUC__) && !defined(__MINGW32__) && !defined(__APPLE__) */
# define __ASM_GLOBAL_FUNC(name,code) \
void __asm_dummy_##name(void) { \
asm( ".align 4\n\t" \
".globl " __ASM_NAME(#name) "\n\t" \
__ASM_FUNC(#name) "\n" \
__ASM_NAME(#name) ":\n\t" \
code ); \
}
#endif /* __GNUC__ */
/* Constructor functions */
#ifdef __GNUC__
# define DECL_GLOBAL_CONSTRUCTOR(func) \
static void func(void) __attribute__((constructor)); \
static void func(void)
#elif defined(__i386__)
# define DECL_GLOBAL_CONSTRUCTOR(func) \
static void __dummy_init_##func(void) { \
asm(".section .init,\"ax\"\n\t" \
"call " #func "\n\t" \
".previous"); } \
static void func(void)
#elif defined(__sparc__)
# define DECL_GLOBAL_CONSTRUCTOR(func) \
static void __dummy_init_##func(void) { \
asm("\t.section \".init\",#alloc,#execinstr\n" \
"\tcall " #func "\n" \
"\tnop\n" \
"\t.section \".text\",#alloc,#execinstr\n" ); } \
static void func(void)
#else
# error You must define the DECL_GLOBAL_CONSTRUCTOR macro for your platform
#endif
/* Register functions */
#ifdef __i386__
#define DEFINE_REGS_ENTRYPOINT( name, fn, args, pop_args ) \
__ASM_GLOBAL_FUNC( name, \
"call " __ASM_NAME("__wine_call_from_32_regs") "\n\t" \
".long " __ASM_NAME(#fn) "\n\t" \
".byte " #args "," #pop_args )
/* FIXME: add support for other CPUs */
#endif /* __i386__ */
/****************************************************************
* Function definitions (only when using libwine_port)
*/
#ifndef NO_LIBWINE_PORT
#ifndef HAVE_FSTATVFS
int fstatvfs( int fd, struct statvfs *buf );
#endif
#ifndef HAVE_GETOPT_LONG
extern char *optarg;
extern int optind;
extern int opterr;
extern int optopt;
struct option;
#ifndef HAVE_STRUCT_OPTION_NAME
struct option
{
const char *name;
int has_arg;
int *flag;
int val;
};
#endif
extern int getopt_long (int ___argc, char *const *___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind);
extern int getopt_long_only (int ___argc, char *const *___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind);
#endif /* HAVE_GETOPT_LONG */
#ifndef HAVE_FFS
int ffs( int x );
#endif
#ifndef HAVE_FUTIMES
struct timeval;
int futimes(int fd, const struct timeval tv[2]);
#endif
#ifndef HAVE_GETPAGESIZE
size_t getpagesize(void);
#endif /* HAVE_GETPAGESIZE */
#ifndef HAVE_GETTID
pid_t gettid(void);
#endif /* HAVE_GETTID */
#ifndef HAVE_LSTAT
int lstat(const char *file_name, struct stat *buf);
#endif /* HAVE_LSTAT */
#ifndef HAVE_MEMMOVE
void *memmove(void *dest, const void *src, size_t len);
#endif /* !defined(HAVE_MEMMOVE) */
#ifndef HAVE_PREAD
ssize_t pread( int fd, void *buf, size_t count, off_t offset );
#endif /* HAVE_PREAD */
#ifndef HAVE_PWRITE
ssize_t pwrite( int fd, const void *buf, size_t count, off_t offset );
#endif /* HAVE_PWRITE */
#ifndef HAVE_READLINK
int readlink( const char *path, char *buf, size_t size );
#endif /* HAVE_READLINK */
#ifndef HAVE_SIGSETJMP
# include <setjmp.h>
typedef jmp_buf sigjmp_buf;
int sigsetjmp( sigjmp_buf buf, int savesigs );
void siglongjmp( sigjmp_buf buf, int val );
#endif /* HAVE_SIGSETJMP */
#ifndef HAVE_STATVFS
int statvfs( const char *path, struct statvfs *buf );
#endif
#ifndef HAVE_STRNCASECMP
# ifndef HAVE__STRNICMP
int strncasecmp(const char *str1, const char *str2, size_t n);
# else
# define strncasecmp _strnicmp
# endif
#endif /* !defined(HAVE_STRNCASECMP) */
#ifndef HAVE_STRERROR
const char *strerror(int err);
#endif /* !defined(HAVE_STRERROR) */
#ifndef HAVE_STRCASECMP
# ifndef HAVE__STRICMP
int strcasecmp(const char *str1, const char *str2);
# else
# define strcasecmp _stricmp
# endif
#endif /* !defined(HAVE_STRCASECMP) */
#ifndef HAVE_USLEEP
int usleep (unsigned int useconds);
#endif /* !defined(HAVE_USLEEP) */
#ifdef __i386__
static inline void *memcpy_unaligned( void *dst, const void *src, size_t size )
{
return memcpy( dst, src, size );
}
#else
extern void *memcpy_unaligned( void *dst, const void *src, size_t size );
#endif /* __i386__ */
extern int mkstemps(char *template, int suffix_len);
/* Process creation flags */
#ifndef _P_WAIT
# define _P_WAIT 0
# define _P_NOWAIT 1
# define _P_OVERLAY 2
# define _P_NOWAITO 3
# define _P_DETACH 4
#endif
#ifndef HAVE_SPAWNVP
extern int spawnvp(int mode, const char *cmdname, const char * const argv[]);
#endif
/* Interlocked functions */
#if defined(__i386__) && defined(__GNUC__)
extern inline long interlocked_cmpxchg( long *dest, long xchg, long compare );
extern inline void *interlocked_cmpxchg_ptr( void **dest, void *xchg, void *compare );
extern inline long interlocked_xchg( long *dest, long val );
extern inline void *interlocked_xchg_ptr( void **dest, void *val );
extern inline long interlocked_xchg_add( long *dest, long incr );
extern inline long interlocked_cmpxchg( long *dest, long xchg, long compare )
{
long ret;
__asm__ __volatile__( "lock; cmpxchgl %2,(%1)"
: "=a" (ret) : "r" (dest), "r" (xchg), "0" (compare) : "memory" );
return ret;
}
extern inline void *interlocked_cmpxchg_ptr( void **dest, void *xchg, void *compare )
{
void *ret;
__asm__ __volatile__( "lock; cmpxchgl %2,(%1)"
: "=a" (ret) : "r" (dest), "r" (xchg), "0" (compare) : "memory" );
return ret;
}
extern inline long interlocked_xchg( long *dest, long val )
{
long ret;
__asm__ __volatile__( "lock; xchgl %0,(%1)"
: "=r" (ret) : "r" (dest), "0" (val) : "memory" );
return ret;
}
extern inline void *interlocked_xchg_ptr( void **dest, void *val )
{
void *ret;
__asm__ __volatile__( "lock; xchgl %0,(%1)"
: "=r" (ret) : "r" (dest), "0" (val) : "memory" );
return ret;
}
extern inline long interlocked_xchg_add( long *dest, long incr )
{
long ret;
__asm__ __volatile__( "lock; xaddl %0,(%1)"
: "=r" (ret) : "r" (dest), "0" (incr) : "memory" );
return ret;
}
#else /* __i386___ && __GNUC__ */
extern long interlocked_cmpxchg( long *dest, long xchg, long compare );
extern void *interlocked_cmpxchg_ptr( void **dest, void *xchg, void *compare );
extern long interlocked_xchg( long *dest, long val );
extern void *interlocked_xchg_ptr( void **dest, void *val );
extern long interlocked_xchg_add( long *dest, long incr );
#endif /* __i386___ && __GNUC__ */
#else /* NO_LIBWINE_PORT */
#define __WINE_NOT_PORTABLE(func) func##_is_not_portable func##_is_not_portable
#define ffs __WINE_NOT_PORTABLE(ffs)
#define fstatvfs __WINE_NOT_PORTABLE(fstatvfs)
#define futimes __WINE_NOT_PORTABLE(futimes)
#define getopt_long __WINE_NOT_PORTABLE(getopt_long)
#define getopt_long_only __WINE_NOT_PORTABLE(getopt_long_only)
#define getpagesize __WINE_NOT_PORTABLE(getpagesize)
#define interlocked_cmpxchg __WINE_NOT_PORTABLE(interlocked_cmpxchg)
#define interlocked_cmpxchg_ptr __WINE_NOT_PORTABLE(interlocked_cmpxchg_ptr)
#define interlocked_xchg __WINE_NOT_PORTABLE(interlocked_xchg)
#define interlocked_xchg_ptr __WINE_NOT_PORTABLE(interlocked_xchg_ptr)
#define interlocked_xchg_add __WINE_NOT_PORTABLE(interlocked_xchg_add)
#define lstat __WINE_NOT_PORTABLE(lstat)
#define memcpy_unaligned __WINE_NOT_PORTABLE(memcpy_unaligned)
#define memmove __WINE_NOT_PORTABLE(memmove)
#define pread __WINE_NOT_PORTABLE(pread)
#define pwrite __WINE_NOT_PORTABLE(pwrite)
#define spawnvp __WINE_NOT_PORTABLE(spawnvp)
#define statvfs __WINE_NOT_PORTABLE(statvfs)
#define strcasecmp __WINE_NOT_PORTABLE(strcasecmp)
#define strerror __WINE_NOT_PORTABLE(strerror)
#define strncasecmp __WINE_NOT_PORTABLE(strncasecmp)
#define usleep __WINE_NOT_PORTABLE(usleep)
#endif /* NO_LIBWINE_PORT */
#endif /* !defined(__WINE_WINE_PORT_H) */

View File

@@ -0,0 +1,53 @@
/*
* Resource definitions
*
* Copyright 2004 Ferenc Wagner
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define IDI_WINE 1
#define IDD_STATUS 100
#define IDD_ABOUT 101
#define IDC_ST0 1000
#define IDC_PB0 1001
#define IDC_ST1 1002
#define IDC_PB1 1003
#define IDC_ST2 1004
#define IDC_PB2 1005
#define IDC_DIR 2000
#define IDC_OUT 2001
#define IDC_SB 3000
#define IDC_EDIT 4000
#define IDC_ABOUT 4001
/* Resource types */
#define TESTRES 1000
#define STRINGRES 1001
/* String resources */
#define WINE_BUILD 10000
#define BUILD_INFO 10001
#define TESTS_URL 10002
/* Revision info strings start from this index: */
#define REV_INFO 30000

View File

@@ -0,0 +1,223 @@
/*
* HTTP handling functions.
*
* Copyright 2003 Ferenc Wagner
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <winsock.h>
#include <stdio.h>
#include <errno.h>
#include "winetest.h"
SOCKET
open_http (const char *server)
{
WSADATA wsad;
struct sockaddr_in sa;
SOCKET s;
report (R_STATUS, "Opening HTTP connection to %s", server);
if (WSAStartup (MAKEWORD (2,2), &wsad)) return INVALID_SOCKET;
sa.sin_family = AF_INET;
sa.sin_port = htons (80);
sa.sin_addr.s_addr = inet_addr (server);
if (sa.sin_addr.s_addr == INADDR_NONE) {
struct hostent *host = gethostbyname (server);
if (!host) {
report (R_ERROR, "Hostname lookup failed for %s", server);
goto failure;
}
sa.sin_addr.s_addr = ((struct in_addr *)host->h_addr)->s_addr;
}
s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (s == INVALID_SOCKET) {
report (R_ERROR, "Can't open network socket: %d",
WSAGetLastError ());
goto failure;
}
if (!connect (s, (struct sockaddr*)&sa, sizeof (struct sockaddr_in)))
return s;
report (R_ERROR, "Can't connect: %d", WSAGetLastError ());
closesocket (s);
failure:
WSACleanup ();
return INVALID_SOCKET;
}
int
close_http (SOCKET s)
{
int ret;
ret = closesocket (s);
return (WSACleanup () || ret);
}
int
send_buf (SOCKET s, const char *buf, size_t length)
{
int sent;
while (length > 0) {
sent = send (s, buf, length, 0);
if (sent == SOCKET_ERROR) return 1;
buf += sent;
length -= sent;
}
return 0;
}
int
send_str (SOCKET s, ...)
{
va_list ap;
char *p;
int ret;
size_t len;
va_start (ap, s);
p = vstrmake (&len, ap);
va_end (ap);
if (!p) return 1;
ret = send_buf (s, p, len);
free (p);
return ret;
}
int
send_file (const char *name)
{
SOCKET s;
FILE *f;
#define BUFLEN 8192
unsigned char buffer[BUFLEN+1];
size_t bytes_read, total, filesize;
char *str;
int ret;
/* RFC 2616 */
#define SEP "--8<--cut-here--8<--"
static const char head[] = "POST /submit HTTP/1.0\r\n"
"Host: test.winehq.org\r\n"
"User-Agent: Winetest Shell\r\n"
"Content-Type: multipart/form-data; boundary=\"" SEP "\"\r\n"
"Content-Length: %u\r\n\r\n";
static const char body1[] = "--" SEP "\r\n"
"Content-Disposition: form-data; name=\"reportfile\"; filename=\"%s\"\r\n"
"Content-Type: application/octet-stream\r\n\r\n";
static const char body2[] = "\r\n--" SEP "\r\n"
"Content-Disposition: form-data; name=\"submit\"\r\n\r\n"
"Upload File\r\n"
"--" SEP "--\r\n";
s = open_http ("test.winehq.org");
if (s == INVALID_SOCKET) return 1;
f = fopen (name, "rb");
if (!f) {
report (R_WARNING, "Can't open file '%s': %d", name, errno);
goto abort1;
}
fseek (f, 0, SEEK_END);
filesize = ftell (f);
if (filesize > 1024*1024) {
report (R_WARNING,
"File too big (%.1f MB > 1 MB); submitting partial report.",
filesize/1024.0/1024);
filesize = 1024*1024;
}
fseek (f, 0, SEEK_SET);
report (R_STATUS, "Sending header");
str = strmake (&total, body1, name);
ret = send_str (s, head, filesize + total + sizeof body2 - 1) ||
send_buf (s, str, total);
free (str);
if (ret) {
report (R_WARNING, "Error sending header: %d, %d",
errno, WSAGetLastError ());
goto abort2;
}
report (R_STATUS, "Sending %u bytes of data", filesize);
report (R_PROGRESS, 2, filesize);
total = 0;
while (total < filesize && (bytes_read = fread (buffer, 1, BUFLEN/2, f))) {
if ((signed)bytes_read == -1) {
report (R_WARNING, "Error reading log file: %d", errno);
goto abort2;
}
total += bytes_read;
if (total > filesize) bytes_read -= total - filesize;
if (send_buf (s, buffer, bytes_read)) {
report (R_WARNING, "Error sending body: %d, %d",
errno, WSAGetLastError ());
goto abort2;
}
report (R_DELTA, bytes_read, "Network transfer: In progress");
}
fclose (f);
if (send_buf (s, body2, sizeof body2 - 1)) {
report (R_WARNING, "Error sending trailer: %d, %d",
errno, WSAGetLastError ());
goto abort2;
}
report (R_DELTA, 0, "Network transfer: Done");
total = 0;
while ((bytes_read = recv (s, buffer+total, BUFLEN-total, 0))) {
if ((signed)bytes_read == SOCKET_ERROR) {
report (R_WARNING, "Error receiving reply: %d, %d",
errno, WSAGetLastError ());
goto abort1;
}
total += bytes_read;
if (total == BUFLEN) {
report (R_WARNING, "Buffer overflow");
goto abort1;
}
}
if (close_http (s)) {
report (R_WARNING, "Error closing connection: %d, %d",
errno, WSAGetLastError ());
return 1;
}
str = strmake (&bytes_read, "Received %s (%d bytes).\n",
name, filesize);
ret = memcmp (str, buffer + total - bytes_read, bytes_read);
free (str);
if (ret) {
buffer[total] = 0;
str = strstr (buffer, "\r\n\r\n");
if (!str) str = buffer;
else str = str + 4;
report (R_ERROR, "Can't submit logfile '%s'. "
"Server response: %s", name, str);
}
return ret;
abort2:
fclose (f);
abort1:
close_http (s);
return 1;
}

View File

@@ -0,0 +1,20 @@
/* Automatically generated -- do not edit! */
#include "resource.h"
STRINGTABLE {
0 "advapi32_test.exe"
1 "comctl32_test.exe"
REV_INFO+0 "lib/advapi32/winetests/crypt_lmhash.c:1.1"
REV_INFO+1 "lib/advapi32/winetests/crypt_md4.c:1.1"
REV_INFO+2 "lib/advapi32/winetests/crypt_md5.c:1.1"
REV_INFO+3 "lib/advapi32/winetests/crypt_sha.c:1.1"
REV_INFO+4 "lib/advapi32/winetests/registry.c:1.1"
REV_INFO+5 "lib/advapi32/winetests/security.c:1."
REV_INFO+6 "lib/advapi32/winetests/crypt.c:1.1"
REV_INFO+7 "dlls/comctl32/tests/imagelist.c:1.1"
REV_INFO+8 "dlls/comctl32/tests/mru.c:1.1"
REV_INFO+9 "dlls/comctl32/tests/subclass.c:1.1"
REV_INFO+10 "dlls/comctl32/tests/tab.c:1.1"
}
0 TESTRES "../../../lib/advapi32/winetests/advapi32_test.exe"
1 TESTRES "../../../lib/comctl32/winetests/comctl32_test.exe"

View File

@@ -0,0 +1,118 @@
/*
* Utility functions.
*
* Copyright 2003 Dimitrie O. Paun
* Copyright 2003 Ferenc Wagner
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <unistd.h>
#include <errno.h>
#include "winetest.h"
void *xmalloc (size_t len)
{
void *p = malloc (len);
if (!p) report (R_FATAL, "Out of memory.");
return p;
}
void *xrealloc (void *op, size_t len)
{
void *p = realloc (op, len);
if (!p) report (R_FATAL, "Out of memory.");
return p;
}
char *vstrfmtmake (size_t *lenp, const char *fmt, va_list ap)
{
size_t size = 1000;
char *p, *q;
int n;
p = malloc (size);
if (!p) return NULL;
while (1) {
n = vsnprintf (p, size, fmt, ap);
if (n < 0) size *= 2; /* Windows */
else if ((unsigned)n >= size) size = n+1; /* glibc */
else break;
q = realloc (p, size);
if (!q) {
free (p);
return NULL;
}
p = q;
}
if (lenp) *lenp = n;
return p;
}
char *vstrmake (size_t *lenp, va_list ap)
{
const char *fmt;
fmt = va_arg (ap, const char*);
return vstrfmtmake (lenp, fmt, ap);
}
char *strmake (size_t *lenp, ...)
{
va_list ap;
char *p;
va_start (ap, lenp);
p = vstrmake (lenp, ap);
if (!p) report (R_FATAL, "Out of memory.");
va_end (ap);
return p;
}
void xprintf (const char *fmt, ...)
{
va_list ap;
size_t size;
ssize_t written;
char *buffer, *head;
va_start (ap, fmt);
buffer = vstrfmtmake (&size, fmt, ap);
head = buffer;
va_end (ap);
while ((written = write (1, head, size)) != size) {
if (written == -1)
report (R_FATAL, "Can't write logs: %d", errno);
head += written;
size -= written;
}
free (buffer);
}
const char *
badtagchar (const char *tag)
{
while (*tag)
if (('a'<=*tag && *tag<='z') ||
('A'<=*tag && *tag<='Z') ||
('0'<=*tag && *tag<='9') ||
*tag=='-' || *tag=='.')
tag++;
else return tag;
return NULL;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,61 @@
/*
* winetest definitions
*
* Copyright 2003 Dimitrie O. Paun
* Copyright 2003 Ferenc Wagner
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINETESTS_H
#define __WINETESTS_H
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
void fatal (const char* msg);
void warning (const char* msg);
void *xmalloc (size_t len);
void *xrealloc (void *op, size_t len);
void xprintf (const char *fmt, ...);
char *vstrmake (size_t *lenp, va_list ap);
char *strmake (size_t *lenp, ...);
const char *badtagchar (const char *tag);
int send_file (const char *name);
/* GUI definitions */
#include <windows.h>
enum report_type {
R_STATUS = 0,
R_PROGRESS,
R_STEP,
R_DELTA,
R_DIR,
R_OUT,
R_WARNING,
R_ERROR,
R_FATAL,
R_ASK,
R_TEXTMODE,
R_QUIET
};
int report (enum report_type t, ...);
#endif /* __WINETESTS_H */

View File

@@ -0,0 +1,132 @@
/*
* Winetest resources
*
* Copyright 2004 Ferenc Wagner
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <windows.h>
#include <winres.h>
#include "resource.h"
#include "tests.rc"
IDD_STATUS DIALOG 0, 0, 160, 140
STYLE WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX
CAPTION "Wine Test Shell"
BEGIN
LTEXT "Extracting:", IDC_ST0, 10, 5, 140, 10
CONTROL "PB0", IDC_PB0, PROGRESS_CLASS, 0, 5, 15, 150, 10
LTEXT "Running:", IDC_ST1, 10, 30, 140, 10
CONTROL "PB1", IDC_PB1, PROGRESS_CLASS, 0, 5, 40, 150, 15
LTEXT "Network transfer:", IDC_ST2, 10, 60, 140, 10
CONTROL "PB2", IDC_PB2, PROGRESS_CLASS, 0, 5, 70, 150, 10
LTEXT "Working directory:", IDC_STATIC, 10, 89, 100, 10
EDITTEXT IDC_DIR, 71, 88, 79, 10,
ES_READONLY | ES_AUTOHSCROLL
LTEXT "Output file:", IDC_STATIC, 10, 100, 100, 10
EDITTEXT IDC_OUT, 46, 99, 104, 10,
ES_READONLY | ES_AUTOHSCROLL
DEFPUSHBUTTON "About", IDHELP, 20, 113, 30, 14
PUSHBUTTON "Edit", IDCANCEL, 65, 113, 30, 14,
WS_DISABLED
PUSHBUTTON "Stop", IDABORT, 110, 113, 30, 14
CONTROL "Created", IDC_SB, STATUSCLASSNAME, 0, 0,0,0,0
END
IDD_ABOUT DIALOG 0, 0, 150, 60
STYLE WS_POPUP
CAPTION "About Wine Test Shell"
BEGIN
CTEXT "This program extracts and runs a series of tests which check Wine's conformance to the Windows API.",
IDC_STATIC, 10, 5, 130, 30
DEFPUSHBUTTON "Close", IDCANCEL, 55, 40, 40, 14
END
/* BINRES wine.ico */
IDI_WINE ICON "wine.ico"
/* {
'00 00 01 00 02 00 20 20 10 00 00 00 00 00 E8 02'
'00 00 26 00 00 00 10 10 10 00 00 00 00 00 28 01'
'00 00 0E 03 00 00 28 00 00 00 20 00 00 00 40 00'
'00 00 01 00 04 00 00 00 00 00 00 02 00 00 00 00'
'00 00 00 00 00 00 10 00 00 00 00 00 00 00 39 02'
'B1 00 23 02 6C 00 0F 03 29 00 1B 02 51 00 FF FF'
'FF 00 1B 1A 1B 00 1E 02 63 00 33 02 A1 00 08 08'
'08 00 14 03 3C 00 0C 04 1E 00 2E 02 8E 00 10 0F'
'10 00 2A 02 82 00 29 02 7D 00 03 02 04 00 44 44'
'44 44 44 44 44 44 55 44 44 44 44 44 44 44 44 44'
'44 44 44 44 8F FF 84 44 44 44 44 44 44 44 44 44'
'44 44 44 8F F8 F8 44 44 44 44 44 44 44 44 44 44'
'44 44 8F FF F5 44 44 44 44 44 44 44 44 44 44 44'
'44 5C F8 C8 F5 44 44 44 44 44 44 44 44 44 44 44'
'44 44 44 44 85 44 44 44 44 44 44 44 44 44 44 44'
'44 44 44 44 4C 44 44 44 44 44 44 44 44 44 44 44'
'44 44 44 44 4C 44 44 44 44 44 44 44 44 44 44 44'
'44 44 44 44 45 54 44 44 44 44 44 44 44 44 44 44'
'44 44 44 44 45 F4 44 44 44 44 44 44 44 44 44 44'
'44 44 44 44 45 FF 44 44 44 44 44 44 44 44 44 44'
'44 44 44 44 48 FF F4 44 44 44 44 44 44 44 44 44'
'44 44 44 44 48 23 9A 84 44 44 44 44 44 44 44 44'
'44 44 44 44 42 B7 7E AF 44 44 44 44 44 44 44 44'
'44 44 44 44 49 00 00 EA C4 44 44 44 44 44 44 44'
'44 44 44 44 46 00 00 01 F4 44 44 44 44 44 44 44'
'44 44 44 44 46 00 00 00 9F 44 44 44 44 44 44 44'
'44 44 44 44 46 00 70 00 EF 44 44 44 44 44 44 44'
'44 44 44 44 43 00 00 00 79 F4 44 44 44 44 44 44'
'44 44 44 44 49 00 00 00 0E F4 44 44 44 44 44 44'
'44 44 44 44 42 00 00 00 07 24 44 44 44 44 44 44'
'44 44 44 44 43 B0 00 00 00 34 44 44 44 44 44 44'
'44 44 44 44 4C 30 00 00 00 1F 44 44 44 44 44 44'
'44 44 44 44 48 27 E1 1D B1 2C 44 44 44 44 44 44'
'44 44 44 44 44 A9 CC CF F8 48 C4 44 44 44 44 44'
'44 44 44 44 44 58 44 44 44 45 C4 44 44 44 44 44'
'44 44 44 44 44 4C 44 44 44 44 84 44 44 44 44 44'
'44 44 44 44 44 48 44 44 44 44 C4 44 44 44 44 44'
'44 44 44 44 44 48 C4 44 44 44 C4 44 44 44 44 44'
'44 44 44 44 44 44 F4 44 44 4C C4 44 44 44 44 44'
'44 44 44 44 44 44 84 44 F8 84 44 44 44 44 44 44'
'44 44 44 44 44 44 48 F8 44 44 44 44 44 44 FF FF'
'3F FF FF F0 7F FF FF C0 FF FF FF 03 FF FF FC 03'
'FF FF FF F3 FF FF FF FB FF FF FF FB FF FF FF F9'
'FF FF FF F9 FF FF FF F8 FF FF FF F8 7F FF FF F8'
'1F FF FF F8 0F FF FF F8 07 FF FF F8 07 FF FF F8'
'03 FF FF F8 03 FF FF F8 01 FF FF F8 01 FF FF F8'
'01 FF FF F8 01 FF FF F8 00 FF FF F8 00 FF FF FC'
'02 7F FF FC FE 7F FF FE FF 7F FF FE FF 7F FF FE'
'7F 7F FF FF 7E 7F FF FF 71 FF FF FF 8F FF 28 00'
'00 00 10 00 00 00 20 00 00 00 01 00 04 00 00 00'
'00 00 80 00 00 00 00 00 00 00 00 00 00 00 10 00'
'00 00 00 00 00 00 3A 02 B1 00 0A 06 14 00 12 03'
'33 00 FF FF FF 00 12 12 12 00 0B 0B 0B 00 1B 1B'
'1B 00 25 02 6F 00 2E 02 92 00 1A 02 52 00 36 02'
'A6 00 15 03 3E 00 04 04 05 00 13 11 19 00 1E 02'
'62 00 2A 02 82 00 33 33 33 CC 43 33 33 33 33 33'
'CC 5C 33 33 33 33 33 36 C5 53 33 33 33 33 33 33'
'33 43 33 33 33 33 33 33 33 65 33 33 33 33 33 33'
'33 DC 33 33 33 33 33 33 33 17 EC 33 33 33 33 33'
'33 B0 07 53 33 33 33 33 33 90 00 B3 33 33 33 33'
'33 B0 00 FC 33 33 33 33 33 BA 00 A2 33 33 33 33'
'33 C7 88 82 33 33 33 33 33 3D D5 14 43 33 33 33'
'33 35 33 33 53 33 33 33 33 33 53 33 53 33 33 33'
'33 33 C5 5C 33 33 FC 7F 00 00 F0 FF 00 00 E1 FF'
'00 00 FD FF 00 00 FC FF 00 00 FC FF 00 00 FC 3F'
'00 00 FC 1F 00 00 FC 1F 00 00 FC 0F 00 00 FC 0F'
'00 00 FC 0F 00 00 FE 07 00 00 FE F7 00 00 FF 77'
'00 00 FF 0F 00 00'
} */

View File

@@ -21,7 +21,7 @@
* Limitations:
* - No support for compressed files.
* - No attribute list support.
* - May crash on currupted filesystem.
* - May crash on corrupted filesystem.
*/
#include <freeldr.h>

View File

@@ -578,9 +578,9 @@ LoadAndBootReactOS(PUCHAR OperatingSystemName)
PARTITION_TABLE_ENTRY PartitionTableEntry;
ULONG rosPartition;
extern ULONG PageDirectoryStart;
extern ULONG PageDirectoryEnd;
extern BOOLEAN AcpiPresent;
extern ULONG PageDirectoryStart;
extern ULONG PageDirectoryEnd;
extern BOOLEAN AcpiPresent;
//
// Open the operating system section
@@ -597,9 +597,8 @@ LoadAndBootReactOS(PUCHAR OperatingSystemName)
* Setup multiboot information structure
*/
LoaderBlock.Flags = MB_INFO_FLAG_MEM_SIZE | MB_INFO_FLAG_BOOT_DEVICE | MB_INFO_FLAG_COMMAND_LINE | MB_INFO_FLAG_MODULES;
if (AcpiPresent) LoaderBlock.Flags |= MB_INFO_FLAG_ACPI_TABLE;
LoaderBlock.PageDirectoryStart = (ULONG)&PageDirectoryStart;
LoaderBlock.PageDirectoryEnd = (ULONG)&PageDirectoryEnd;
LoaderBlock.PageDirectoryStart = (ULONG)&PageDirectoryStart;
LoaderBlock.PageDirectoryEnd = (ULONG)&PageDirectoryEnd;
LoaderBlock.BootDevice = 0xffffffff;
LoaderBlock.CommandLine = (unsigned long)multiboot_kernel_cmdline;
LoaderBlock.ModsCount = 0;
@@ -736,6 +735,7 @@ LoadAndBootReactOS(PUCHAR OperatingSystemName)
*/
MachHwDetect();
if (AcpiPresent) LoaderBlock.Flags |= MB_INFO_FLAG_ACPI_TABLE;
UiDrawStatusText("Loading...");
UiDrawProgressBarCenter(0, 100, "Loading ReactOS...");

View File

@@ -344,4 +344,133 @@ HKCR,"NDS\Clsid","",0x00000002,"{323991f0-7bad-11cf-b03d-00aa006e0975}"
HKCR,"WinNT\Clsid","",0x00000002,"{8b20cd60-0f29-11cf-abc4-02608c9e7553}"
; For language support:
HKCR,"MIME",,0x00000012
HKCR,"MIME\Database",,0x00000012
HKCR,"MIME\Database\Rfc1766",,0x00000012
HKCR,"MIME\Database\Rfc1766","0436",0x00000000,"af;Afrikaans"
HKCR,"MIME\Database\Rfc1766","041C",0x00000000,"sq;Albanian"
HKCR,"MIME\Database\Rfc1766","0001",0x00000000,"ar;Arabic"
HKCR,"MIME\Database\Rfc1766","0401",0x00000000,"ar-sa;Arabic (Saudi Arabia)"
HKCR,"MIME\Database\Rfc1766","0801",0x00000000,"ar-iq;Arabic (Iraq)"
HKCR,"MIME\Database\Rfc1766","0C01",0x00000000,"ar-eg;Arabic (Egypt)"
HKCR,"MIME\Database\Rfc1766","1001",0x00000000,"ar-ly;Arabic (Libya)"
HKCR,"MIME\Database\Rfc1766","1401",0x00000000,"ar-dz;Arabic (Algeria)"
HKCR,"MIME\Database\Rfc1766","1801",0x00000000,"ar-ma;Arabic (Morocco)"
HKCR,"MIME\Database\Rfc1766","1C01",0x00000000,"ar-tn;Arabic (Tunisia)"
HKCR,"MIME\Database\Rfc1766","2001",0x00000000,"ar-om;Arabic (Oman)"
HKCR,"MIME\Database\Rfc1766","2401",0x00000000,"ar-ye;Arabic (Yemen)"
HKCR,"MIME\Database\Rfc1766","2801",0x00000000,"ar-sy;Arabic (Syria)"
HKCR,"MIME\Database\Rfc1766","2C01",0x00000000,"ar-jo;Arabic (Jordan)"
HKCR,"MIME\Database\Rfc1766","3001",0x00000000,"ar-lb;Arabic (Lebanon)"
HKCR,"MIME\Database\Rfc1766","3401",0x00000000,"ar-kw;Arabic (Kuwait)"
HKCR,"MIME\Database\Rfc1766","3801",0x00000000,"ar-ae;Arabic (U.A.E.)"
HKCR,"MIME\Database\Rfc1766","3C01",0x00000000,"ar-bh;Arabic (Bahrain)"
HKCR,"MIME\Database\Rfc1766","4001",0x00000000,"ar-qa;Arabic (Qatar)"
HKCR,"MIME\Database\Rfc1766","042D",0x00000000,"eu;Basque"
HKCR,"MIME\Database\Rfc1766","0402",0x00000000,"bg;Bulgarian"
HKCR,"MIME\Database\Rfc1766","0423",0x00000000,"be;Belarusian"
HKCR,"MIME\Database\Rfc1766","0403",0x00000000,"ca;Catalan"
HKCR,"MIME\Database\Rfc1766","0004",0x00000000,"zh;Chinese"
HKCR,"MIME\Database\Rfc1766","0404",0x00000000,"zh-tw;Chinese (Taiwan)"
HKCR,"MIME\Database\Rfc1766","0804",0x00000000,"zh-cn;Chinese (China)"
HKCR,"MIME\Database\Rfc1766","0C04",0x00000000,"zh-hk;Chinese (Hong Kong SAR)"
HKCR,"MIME\Database\Rfc1766","1004",0x00000000,"zh-sg;Chinese (Singapore)"
HKCR,"MIME\Database\Rfc1766","041A",0x00000000,"hr;Croatian"
HKCR,"MIME\Database\Rfc1766","0405",0x00000000,"cs;Czech"
HKCR,"MIME\Database\Rfc1766","0406",0x00000000,"da;Danish"
HKCR,"MIME\Database\Rfc1766","0413",0x00000000,"nl;Dutch (Netherlands)"
HKCR,"MIME\Database\Rfc1766","0813",0x00000000,"nl-be;Dutch (Belgium)"
HKCR,"MIME\Database\Rfc1766","0009",0x00000000,"en;English"
HKCR,"MIME\Database\Rfc1766","0409",0x00000000,"en-us;English (United States)"
HKCR,"MIME\Database\Rfc1766","0809",0x00000000,"en-gb;English (United Kingdom)"
HKCR,"MIME\Database\Rfc1766","0C09",0x00000000,"en-au;English (Australia)"
HKCR,"MIME\Database\Rfc1766","1009",0x00000000,"en-ca;English (Canada)"
HKCR,"MIME\Database\Rfc1766","1409",0x00000000,"en-nz;English (New Zealand)"
HKCR,"MIME\Database\Rfc1766","1809",0x00000000,"en-ie;English (Ireland)"
HKCR,"MIME\Database\Rfc1766","1C09",0x00000000,"en-za;English (South Africa)"
HKCR,"MIME\Database\Rfc1766","2009",0x00000000,"en-jm;English (Jamaica)"
HKCR,"MIME\Database\Rfc1766","2809",0x00000000,"en-bz;English (Belize)"
HKCR,"MIME\Database\Rfc1766","2C09",0x00000000,"en-tt;English (Trinidad)"
HKCR,"MIME\Database\Rfc1766","0425",0x00000000,"et;Estonian"
HKCR,"MIME\Database\Rfc1766","0438",0x00000000,"fo;Faeroese"
HKCR,"MIME\Database\Rfc1766","0429",0x00000000,"fa;Farsi"
HKCR,"MIME\Database\Rfc1766","040B",0x00000000,"fi;Finnish"
HKCR,"MIME\Database\Rfc1766","040C",0x00000000,"fr;French (France)"
HKCR,"MIME\Database\Rfc1766","080C",0x00000000,"fr-be;French (Belgium)"
HKCR,"MIME\Database\Rfc1766","0C0C",0x00000000,"fr-ca;French (Canada)"
HKCR,"MIME\Database\Rfc1766","100C",0x00000000,"fr-ch;French (Switzerland)"
HKCR,"MIME\Database\Rfc1766","140C",0x00000000,"fr-lu;French (Luxembourg)"
HKCR,"MIME\Database\Rfc1766","043C",0x00000000,"gd;Gaelic"
HKCR,"MIME\Database\Rfc1766","0407",0x00000000,"de;German (Germany)"
HKCR,"MIME\Database\Rfc1766","0807",0x00000000,"de-ch;German (Switzerland)"
HKCR,"MIME\Database\Rfc1766","0C07",0x00000000,"de-at;German (Austria)"
HKCR,"MIME\Database\Rfc1766","1007",0x00000000,"de-lu;German (Luxembourg)"
HKCR,"MIME\Database\Rfc1766","1407",0x00000000,"de-li;German (Liechtenstein)"
HKCR,"MIME\Database\Rfc1766","0408",0x00000000,"el;Greek"
HKCR,"MIME\Database\Rfc1766","040D",0x00000000,"he;Hebrew"
HKCR,"MIME\Database\Rfc1766","0439",0x00000000,"hi;Hindi"
HKCR,"MIME\Database\Rfc1766","040E",0x00000000,"hu;Hungarian"
HKCR,"MIME\Database\Rfc1766","040F",0x00000000,"is;Icelandic"
HKCR,"MIME\Database\Rfc1766","0421",0x00000000,"in;Indonesian"
HKCR,"MIME\Database\Rfc1766","0410",0x00000000,"it;Italian (Italy)"
HKCR,"MIME\Database\Rfc1766","0810",0x00000000,"it-ch;Italian (Switzerland)"
HKCR,"MIME\Database\Rfc1766","0411",0x00000000,"ja;Japanese"
HKCR,"MIME\Database\Rfc1766","0412",0x00000000,"ko;Korean"
HKCR,"MIME\Database\Rfc1766","0426",0x00000000,"lv;Latvian"
HKCR,"MIME\Database\Rfc1766","0427",0x00000000,"lt;Lithuanian"
HKCR,"MIME\Database\Rfc1766","042F",0x00000000,"mk;FYRO Macedonian"
HKCR,"MIME\Database\Rfc1766","043E",0x00000000,"ms;Malay (Malaysia)"
HKCR,"MIME\Database\Rfc1766","043A",0x00000000,"mt;Maltese"
HKCR,"MIME\Database\Rfc1766","0414",0x00000000,"no;Norwegian (Bokmal)"
HKCR,"MIME\Database\Rfc1766","0814",0x00000000,"no;Norwegian (Nynorsk)"
HKCR,"MIME\Database\Rfc1766","0415",0x00000000,"pl;Polish"
HKCR,"MIME\Database\Rfc1766","0416",0x00000000,"pt-br;Portuguese (Brazil)"
HKCR,"MIME\Database\Rfc1766","0816",0x00000000,"pt;Portuguese (Portugal)"
HKCR,"MIME\Database\Rfc1766","0417",0x00000000,"rm;Rhaeto-Romanic"
HKCR,"MIME\Database\Rfc1766","0418",0x00000000,"ro;Romanian"
HKCR,"MIME\Database\Rfc1766","0818",0x00000000,"ro-mo;Romanian (Moldova)"
HKCR,"MIME\Database\Rfc1766","0419",0x00000000,"ru;Russian"
HKCR,"MIME\Database\Rfc1766","0819",0x00000000,"ru-mo;Russian (Moldova)"
HKCR,"MIME\Database\Rfc1766","0C1A",0x00000000,"sr;Serbian (Cyrillic)"
HKCR,"MIME\Database\Rfc1766","081A",0x00000000,"sr;Serbian (Latin)"
HKCR,"MIME\Database\Rfc1766","041B",0x00000000,"sk;Slovak"
HKCR,"MIME\Database\Rfc1766","0424",0x00000000,"sl;Slovenian"
HKCR,"MIME\Database\Rfc1766","042E",0x00000000,"sb;Sorbian"
HKCR,"MIME\Database\Rfc1766","040A",0x00000000,"es;Spanish (Traditional Sort)"
HKCR,"MIME\Database\Rfc1766","080A",0x00000000,"es-mx;Spanish (Mexico)"
HKCR,"MIME\Database\Rfc1766","0C0A",0x00000000,"es;Spanish (International Sort)"
HKCR,"MIME\Database\Rfc1766","100A",0x00000000,"es-gt;Spanish (Guatemala)"
HKCR,"MIME\Database\Rfc1766","140A",0x00000000,"es-cr;Spanish (Costa Rica)"
HKCR,"MIME\Database\Rfc1766","180A",0x00000000,"es-pa;Spanish (Panama)"
HKCR,"MIME\Database\Rfc1766","1C0A",0x00000000,"es-do;Spanish (Dominican Republic)"
HKCR,"MIME\Database\Rfc1766","200A",0x00000000,"es-ve;Spanish (Venezuela)"
HKCR,"MIME\Database\Rfc1766","240A",0x00000000,"es-co;Spanish (Colombia)"
HKCR,"MIME\Database\Rfc1766","280A",0x00000000,"es-pe;Spanish (Peru)"
HKCR,"MIME\Database\Rfc1766","2C0A",0x00000000,"es-ar;Spanish (Argentina)"
HKCR,"MIME\Database\Rfc1766","300A",0x00000000,"es-ec;Spanish (Ecuador)"
HKCR,"MIME\Database\Rfc1766","340A",0x00000000,"es-cl;Spanish (Chile)"
HKCR,"MIME\Database\Rfc1766","380A",0x00000000,"es-uy;Spanish (Uruguay)"
HKCR,"MIME\Database\Rfc1766","3C0A",0x00000000,"es-py;Spanish (Paraguay)"
HKCR,"MIME\Database\Rfc1766","400A",0x00000000,"es-bo;Spanish (Bolivia)"
HKCR,"MIME\Database\Rfc1766","440A",0x00000000,"es-sv;Spanish (El Salvador)"
HKCR,"MIME\Database\Rfc1766","480A",0x00000000,"es-hn;Spanish (Honduras)"
HKCR,"MIME\Database\Rfc1766","4C0A",0x00000000,"es-ni;Spanish (Nicaragua)"
HKCR,"MIME\Database\Rfc1766","500A",0x00000000,"es-pr;Spanish (Puerto Rico)"
HKCR,"MIME\Database\Rfc1766","0430",0x00000000,"sx;Sutu"
HKCR,"MIME\Database\Rfc1766","041D",0x00000000,"sv;Swedish"
HKCR,"MIME\Database\Rfc1766","081D",0x00000000,"sv-fi;Swedish (Finland)"
HKCR,"MIME\Database\Rfc1766","041E",0x00000000,"th;Thai"
HKCR,"MIME\Database\Rfc1766","0431",0x00000000,"ts;Tsonga"
HKCR,"MIME\Database\Rfc1766","0432",0x00000000,"tn;Tswana"
HKCR,"MIME\Database\Rfc1766","041F",0x00000000,"tr;Turkish"
HKCR,"MIME\Database\Rfc1766","0422",0x00000000,"uk;Ukrainian"
HKCR,"MIME\Database\Rfc1766","0420",0x00000000,"ur;Urdu"
HKCR,"MIME\Database\Rfc1766","042A",0x00000000,"vi;Vietnamese"
HKCR,"MIME\Database\Rfc1766","0434",0x00000000,"xh;Xhosa"
HKCR,"MIME\Database\Rfc1766","043D",0x00000000,"ji;Yiddish"
HKCR,"MIME\Database\Rfc1766","0435",0x00000000,"zu;Zulu"
; EOF

View File

@@ -257,10 +257,10 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management","Pagin
; Subsystems
HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Debug",0x00020000,""
HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Kmode",0x00020000,"%SystemRoot%\system32\win32k.sys"
HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Optional",0x00070001,50,00,6f,00,73,00,69,00,78,00,00,00,4f,00,73,00,32,00,00,00,00,00
HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Optional",0x00010000,"Posix","Os2"
HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Os2",0x00020000,"%SystemRoot%\system32\os2ss.exe"
HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Posix",0x00020000,"%SystemRoot%\system32\psxss.exe"
HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Required",0x00070001,44,00,65,00,62,00,75,00,67,00,00,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,00,00,00,00
HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Required",0x00010000,"Debug","Windows"
HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Windows",0x00020000,"%SystemRoot%\system32\csrss.exe"
; 3Com 3c905 Driver
@@ -674,8 +674,13 @@ HKLM,"SYSTEM\CurrentControlSet\Services\Null","Type",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Services\Serial","ErrorControl",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\Serial","Group",0x00000000,"Base"
HKLM,"SYSTEM\CurrentControlSet\Services\Serial","ImagePath",0x00020000,"system32\drivers\serial.sys"
HKLM,"SYSTEM\CurrentControlSet\Services\Serial","Start",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Services\Serial","Start",0x00010001,0x00000004
HKLM,"SYSTEM\CurrentControlSet\Services\Serial","Type",0x00010001,0x00000001
;hard coded values
HKLM,"SYSTEM\CurrentControlSet\Services\Serial\Enum","0",0x00000000,"ACPI\PNP0501"
HKLM,"SYSTEM\CurrentControlSet\Services\Serial\Enum","Count",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Services\Serial\Enum","NextInstance",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Enum\ACPI\PNP0501\0000","Service",0x00000000,"serial"
; Packet driver
HKLM,"SYSTEM\CurrentControlSet\Services\Packet","ErrorControl",0x00010001,0x00000001

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -99,6 +99,7 @@ lib\mpr\mpr.dll 1
lib\msacm\msacm32.dll 1
lib\msafd\msafd.dll 1
lib\msgina\msgina.dll 1
lib\msi\msi.dll 1
lib\msimg32\msimg32.dll 1
lib\msvcrt\msvcrt.dll 1
lib\msvcrt20\msvcrt20.dll 1
@@ -108,6 +109,7 @@ lib\ole32\ole32.dll 1
lib\oleaut32\oleaut32.dll 1
lib\olepro32\olepro32.dll 1
lib\psapi\psapi.dll 1
lib\riched20\riched20.dll 1
lib\richedit\riched32.dll 1
lib\rpcrt4\rpcrt4.dll 1
lib\samlib\samlib.dll 1
@@ -146,8 +148,9 @@ subsys\system\cmd\cmd.exe 1
subsys\system\explorer\explorer.exe 4
subsys\system\explorer\explorer-cfg-template.xml 4
subsys\system\explorer\notifyhook\notifyhook.dll 1
subsys\system\ibrowser\ibrowser.exe 1
subsys\system\format\format.exe 1
subsys\system\ibrowser\ibrowser.exe 1
subsys\system\msiexec\msiexec.exe 1
subsys\system\notepad\notepad.exe 1
subsys\system\regedit\regedit.exe 4
subsys\system\regsvr32\regsvr32.exe 1

View File

@@ -13,17 +13,18 @@ ARCH := i386
# see gcc manual for more cpu names and which cpus it can
# be optimized for.
#
OARCH := pentium2
OARCH := i486
#
# Whether to compile in the kernel debugger
#
KDBG := 1
KDBG := 0
#
# Whether to compile for debugging
#
DBG := 1
DBG := 0
#
# Whether to compile a multiprocessor or single processor version

View File

@@ -26,52 +26,55 @@ This will allow you to use the WINE tools and librarys with very little
work to import a new dll.
The following build tools are derived from Wine.
reactos/tools/unicode # Synced to Wine-20050310
reactos/tools/wpp # Synced to Wine-20050310
reactos/tools/bin2res # Resource to binary converter
reactos/tools/winebuild # Synced to Wine-20050211
reactos/tools/winebuild # Synced to Wine-20050310
reactos/tools/wmc # Wine Message Compiler
reactos/tools/wrc # Synced to Wine-20050211
reactos/tools/wrc # Synced to Wine-20050310
reactos/tools/widl # Synced to Wine-20050310
The following shared libraries are a 100% port from Winehq sources.
reactos/lib/cabinet # Synced to Wine-20050211
reactos/lib/comctl32 # Synced to Wine-20050211
reactos/lib/comdlg32 # Synced to Wine-20050211
reactos/lib/dinput # Synced to Wine-20050211
reactos/lib/dinput8 # Synced to Wine-20050211
reactos/lib/icmp # Synced to Wine-20050211
reactos/lib/cabinet # Synced to Wine-20050310
reactos/lib/comctl32 # Synced to Wine-20050310
reactos/lib/comdlg32 # Synced to Wine-20050310
reactos/lib/dinput # Synced to Wine-20050310
reactos/lib/dinput8 # Synced to Wine-20050310
reactos/lib/icmp # Synced to Wine-20050310
reactos/lib/iphlpapi # Out of sync
reactos/lib/imagehlp # Patches for BindImage need review and submission to winehq.
reactos/lib/msvcrt20 # Out of sync
reactos/lib/mpr # Synced to Wine-20050211
reactos/lib/mpr # Synced to Wine-20050310
reactos/lib/msacm # Out of sync
reactos/lib/msimg32 # Synced to Wine-20050211
reactos/lib/msi # Synced to Wine-20050211
reactos/lib/msimg32 # Synced to Wine-20050310
reactos/lib/msi # Synced to Wine-20050310
reactos/lib/msvideo # Out of sync
reactos/lib/netapi32 # Out of sync
reactos/lib/odbc32 # In sync. Depends on port of Linux ODBC.
reactos/lib/ole32 # Synced to Wine-20050211
reactos/lib/oleaut32 # Synced to Wine-20050211
reactos/lib/oledlg # Synced to Wine-20050211
reactos/lib/olepro32 # Synced to Wine-20050211
reactos/lib/richedit # Synced to Wine-20050211
reactos/lib/rpcrt4 # Synced to Wine-20050211
reactos/lib/setupapi # Synced to Wine-20050125 # CVS
reactos/lib/shell32 # Synced to Wine-20050211
reactos/lib/shdocvw # Synced to Wine-20050211
reactos/lib/shlwapi # Synced to Wine-20050211
reactos/lib/ole32 # Synced to Wine-20050310
reactos/lib/oleaut32 # Synced to Wine-20050310
reactos/lib/oledlg # Synced to Wine-20050310
reactos/lib/olepro32 # Synced to Wine-20050310
reactos/lib/riched20 # Synced to Wine-20050310
reactos/lib/richedit # Synced to Wine-20050310
reactos/lib/rpcrt4 # Synced to Wine-20050310
reactos/lib/setupapi # Synced to Wine-20050310
reactos/lib/shell32 # Synced to Wine-20050310
reactos/lib/shdocvw # Synced to Wine-20050310
reactos/lib/shlwapi # Synced to Wine-20050310
reactos/lib/twain # Out of sync
reactos/lib/unicode # Dependancy on this lib needs to be removed. Synced to Wine-20050211
reactos/lib/urlmon # Synced to Wine-20050211
reactos/lib/urlmon # Synced to Wine-20050310
reactos/lib/version # Out of sync
reactos/lib/wininet # Out of sync
reactos/lib/winmm # Synced to Wine-20050211
reactos/lib/winmm/midimap # Synced to Wine-20050211
reactos/lib/winmm/wavemap # Synced to Wine-20050211
reactos/lib/winmm # Synced to Wine-20050310
reactos/lib/winmm/midimap # Synced to Wine-20050310
reactos/lib/winmm/wavemap # Synced to Wine-20050310
ReactOS shares the following programs with Winehq.
reactos/subsys/system/regedit # Out of sync
reactos/subsys/system/expand # Out of sync
reactos/subsys/system/msiexec # Synced to Wine-20050211
reactos/subsys/system/msiexec # Synced to Wine-20050311
In addition the following libs, dlls and source files are mostly based on code ported
from Winehq CVS. If you are looking to update something in these files

View File

@@ -1,103 +1,103 @@
/*
Boiler plate for irp cancelation, for irp queues you manage yourself
-Gunnar
*/
CancelRoutine(
DEV_OBJ Dev,
Irp
)
{
//don't need this since we have our own sync. protecting irp cancellation
IoReleaseCancelSpinLock(Irp->CancelIrql);
theLock = Irp->Tail.Overlay.DriverContext[3];
Lock(theLock);
RemoveEntryList(&Irp->Tail.Overlay.ListEntry);
Unlock(theLock);
Irp->IoStatus.Status = STATUS_CANCELLED;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
}
QUEUE_BOLIERPLATE
{
Lock(theLock);
Irp->Tail.Overlay.DriverContext[3] = &theLock;
IoSetCancelRoutine(Irp, CancelRoutine);
if (Irp->Cancel && IoSetCancelRoutine(Irp, NULL))
{
/*
Irp has already been cancelled (before we got to queue it),
and we got to remove the cancel routine before the canceler could,
so we cancel/complete the irp ourself.
*/
Unlock(theLock);
Irp->IoStatus.Status = STATUS_CANCELLED;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return FALSE;
}
//else were ok
Irp->IoStatus.Status = STATUS_PENDING;
IoMarkIrpPending(Irp);
InsertTailList(Queue);
Unlock(theLock);
}
DEQUEUE_BOILERPLATE
{
Lock(theLock);
Irp = RemoveHeadList(Queue);
if (!IoSetCancelRoutine(Irp, NULL))
{
/*
Cancel routine WILL be called after we release the spinlock. It will try to remove
the irp from the list and cancel/complete this irp. Since we allready removed it,
make its ListEntry point to itself.
*/
InitializeListHead(&Irp->Tail.Overlay.ListEntry);
Unlock(theLock);
return;
}
/*
Cancel routine will NOT be called, canceled or not.
The Irp might have been canceled (Irp->Cancel flag set) but we don't care,
since we are to complete this Irp now anyways.
*/
Unlock(theLock);
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
}
/*
Boiler plate for irp cancelation, for irp queues you manage yourself
-Gunnar
*/
CancelRoutine(
DEV_OBJ Dev,
Irp
)
{
//don't need this since we have our own sync. protecting irp cancellation
IoReleaseCancelSpinLock(Irp->CancelIrql);
theLock = Irp->Tail.Overlay.DriverContext[3];
Lock(theLock);
RemoveEntryList(&Irp->Tail.Overlay.ListEntry);
Unlock(theLock);
Irp->IoStatus.Status = STATUS_CANCELLED;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
}
QUEUE_BOLIERPLATE
{
Lock(theLock);
Irp->Tail.Overlay.DriverContext[3] = &theLock;
IoSetCancelRoutine(Irp, CancelRoutine);
if (Irp->Cancel && IoSetCancelRoutine(Irp, NULL))
{
/*
Irp has already been cancelled (before we got to queue it),
and we got to remove the cancel routine before the canceler could,
so we cancel/complete the irp ourself.
*/
Unlock(theLock);
Irp->IoStatus.Status = STATUS_CANCELLED;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return FALSE;
}
//else were ok
Irp->IoStatus.Status = STATUS_PENDING;
IoMarkIrpPending(Irp);
InsertTailList(Queue);
Unlock(theLock);
}
DEQUEUE_BOILERPLATE
{
Lock(theLock);
Irp = RemoveHeadList(Queue);
if (!IoSetCancelRoutine(Irp, NULL))
{
/*
Cancel routine WILL be called after we release the spinlock. It will try to remove
the irp from the list and cancel/complete this irp. Since we allready removed it,
make its ListEntry point to itself.
*/
InitializeListHead(&Irp->Tail.Overlay.ListEntry);
Unlock(theLock);
return;
}
/*
Cancel routine will NOT be called, canceled or not.
The Irp might have been canceled (Irp->Cancel flag set) but we don't care,
since we are to complete this Irp now anyways.
*/
Unlock(theLock);
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
}

View File

@@ -60,12 +60,7 @@ AcpiCreateDeviceIDString(PUNICODE_STRING DeviceID,
L"ACPI\\%S",
Node->device.id.hid);
if (!AcpiCreateUnicodeString(DeviceID, Buffer, PagedPool))
{
return FALSE;
}
return TRUE;
return AcpiCreateUnicodeString(DeviceID, Buffer, PagedPool);
}
@@ -108,8 +103,15 @@ BOOLEAN
AcpiCreateInstanceIDString(PUNICODE_STRING InstanceID,
BM_NODE *Node)
{
/* FIXME: Create unique instnce id. */
return AcpiCreateUnicodeString(InstanceID, L"0000", PagedPool);
WCHAR Buffer[10];
if (Node->device.id.uid[0])
swprintf(Buffer, L"%S", Node->device.id.uid);
else
/* FIXME: Generate unique id! */
swprintf(Buffer, L"0000");
return AcpiCreateUnicodeString(InstanceID, Buffer, PagedPool);
}
@@ -126,7 +128,7 @@ FdoQueryBusRelations(
ANSI_STRING AnsiString;
ACPI_STATUS AcpiStatus;
PACPI_DEVICE Device;
NTSTATUS Status;
NTSTATUS Status = STATUS_SUCCESS;
BM_NODE *Node;
ULONG Size;
ULONG i;

View File

@@ -601,5 +601,5 @@ acpi_os_writable(void *ptr, u32 len)
u32
acpi_os_get_thread_id (void)
{
return (ULONG)PsGetCurrentThreadId();
return (ULONG)PsGetCurrentThreadId() + 1;
}

View File

@@ -389,6 +389,7 @@ acpi_cm_init_globals (
acpi_gbl_acpi_mutex_info[i].mutex = NULL;
acpi_gbl_acpi_mutex_info[i].locked = FALSE;
acpi_gbl_acpi_mutex_info[i].use_count = 0;
acpi_gbl_acpi_mutex_info[i].owner_id = 0;
}
/* Global notify handlers */

View File

@@ -0,0 +1,96 @@
/* $Id:
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/dd/serial/circularbuffer.c
* PURPOSE: Operations on a circular buffer
*
* PROGRAMMERS: Herv<72> Poussineau (poussine@freesurf.fr)
*/
#define NDEBUG
#include "serial.h"
NTSTATUS
InitializeCircularBuffer(
IN PCIRCULAR_BUFFER pBuffer,
IN ULONG BufferSize)
{
DPRINT("Serial: InitializeCircularBuffer(pBuffer %p, BufferSize %lu)\n", pBuffer, BufferSize);
pBuffer->Buffer = (PUCHAR)ExAllocatePoolWithTag(NonPagedPool, BufferSize * sizeof(UCHAR), SERIAL_TAG);
if (!pBuffer->Buffer)
return STATUS_INSUFFICIENT_RESOURCES;
pBuffer->Length = BufferSize;
pBuffer->ReadPosition = pBuffer->WritePosition = 0;
return STATUS_SUCCESS;
}
NTSTATUS
FreeCircularBuffer(
IN PCIRCULAR_BUFFER pBuffer)
{
DPRINT("Serial: FreeCircularBuffer(pBuffer %p)\n", pBuffer);
ExFreePoolWithTag(pBuffer->Buffer, SERIAL_TAG);
return STATUS_SUCCESS;
}
BOOLEAN
IsCircularBufferEmpty(
IN PCIRCULAR_BUFFER pBuffer)
{
DPRINT("Serial: IsCircularBufferEmpty(pBuffer %p)\n", pBuffer);
return (pBuffer->ReadPosition == pBuffer->WritePosition);
}
NTSTATUS
PushCircularBufferEntry(
IN PCIRCULAR_BUFFER pBuffer,
IN UCHAR Entry)
{
DPRINT("Serial: PushCircularBufferEntry(pBuffer %p, Entry 0x%x)\n", pBuffer, Entry);
ASSERT(pBuffer->Length);
ULONG NextPosition = (pBuffer->WritePosition + 1) % pBuffer->Length;
if (NextPosition == pBuffer->ReadPosition)
return STATUS_BUFFER_TOO_SMALL;
pBuffer->Buffer[pBuffer->WritePosition] = Entry;
pBuffer->WritePosition = NextPosition;
return STATUS_SUCCESS;
}
NTSTATUS
PopCircularBufferEntry(
IN PCIRCULAR_BUFFER pBuffer,
OUT PUCHAR Entry)
{
DPRINT("Serial: PopCircularBufferEntry(pBuffer %p)\n", pBuffer);
ASSERT(pBuffer->Length);
if (IsCircularBufferEmpty(pBuffer))
return STATUS_ARRAY_BOUNDS_EXCEEDED;
*Entry = pBuffer->Buffer[pBuffer->ReadPosition];
pBuffer->ReadPosition = (pBuffer->ReadPosition + 1) % pBuffer->Length;
return STATUS_SUCCESS;
}
NTSTATUS
IncreaseCircularBufferSize(
IN PCIRCULAR_BUFFER pBuffer,
IN ULONG NewBufferSize)
{
PUCHAR NewBuffer;
DPRINT("Serial: IncreaseCircularBufferSize(pBuffer %p, NewBufferSize %lu)\n", pBuffer, NewBufferSize);
ASSERT(pBuffer->Length);
if (pBuffer->Length > NewBufferSize)
return STATUS_INVALID_PARAMETER;
else if (pBuffer->Length == NewBufferSize)
return STATUS_SUCCESS;
NewBuffer = (PUCHAR)ExAllocatePoolWithTag(NonPagedPool, NewBufferSize * sizeof(UCHAR), SERIAL_TAG);
if (!NewBuffer)
return STATUS_INSUFFICIENT_RESOURCES;
RtlCopyMemory(NewBuffer, pBuffer->Buffer, pBuffer->Length * sizeof(UCHAR));
ExFreePoolWithTag(pBuffer->Buffer, SERIAL_TAG);
pBuffer->Buffer = NewBuffer;
pBuffer->Length = NewBufferSize;
return STATUS_SUCCESS;
}

View File

@@ -0,0 +1,24 @@
/* $Id:
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/dd/serial/cleanup.c
* PURPOSE: Serial IRP_MJ_CLEANUP operations
*
* PROGRAMMERS: Herv<72> Poussineau (poussine@freesurf.fr)
*/
#define NDEBUG
#include "serial.h"
NTSTATUS STDCALL
SerialCleanup(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
DPRINT("Serial: IRP_MJ_CLEANUP\n");
Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_SUCCESS;
}

View File

@@ -0,0 +1,29 @@
/* $Id:
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/dd/serial/close.c
* PURPOSE: Serial IRP_MJ_CLOSE operations
*
* PROGRAMMERS: Herv<72> Poussineau (poussine@freesurf.fr)
*/
#define NDEBUG
#include "serial.h"
NTSTATUS STDCALL
SerialClose(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PSERIAL_DEVICE_EXTENSION pDeviceExtension;
DPRINT("Serial: IRP_MJ_CLOSE\n");
pDeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
pDeviceExtension->IsOpened = FALSE;
Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_SUCCESS;
}

View File

@@ -0,0 +1,60 @@
/* $Id:
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/dd/serial/create.c
* PURPOSE: Serial IRP_MJ_CREATE operations
*
* PROGRAMMERS: Herv<72> Poussineau (poussine@freesurf.fr)
*/
#define NDEBUG
#include "serial.h"
NTSTATUS STDCALL
SerialCreate(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PIO_STACK_LOCATION Stack;
PFILE_OBJECT FileObject;
PSERIAL_DEVICE_EXTENSION DeviceExtension;
NTSTATUS Status;
DPRINT("Serial: IRP_MJ_CREATE\n");
Stack = IoGetCurrentIrpStackLocation(Irp);
FileObject = Stack->FileObject;
DeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
if (Stack->Parameters.Create.Options & FILE_DIRECTORY_FILE)
{
CHECKPOINT;
Status = STATUS_NOT_A_DIRECTORY;
goto ByeBye;
}
if (FileObject->FileName.Length != 0 ||
FileObject->RelatedFileObject != NULL)
{
CHECKPOINT;
Status = STATUS_ACCESS_DENIED;
goto ByeBye;
}
if(DeviceExtension->IsOpened)
{
DPRINT("Serial: COM%lu is already opened", DeviceExtension->ComPort);
Status = STATUS_ACCESS_DENIED;
goto ByeBye;
}
DPRINT("Serial: open COM%lu: successfull\n", DeviceExtension->ComPort);
DeviceExtension->IsOpened = TRUE;
Status = STATUS_SUCCESS;
ByeBye:
Irp->IoStatus.Status = Status;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}

View File

@@ -0,0 +1,730 @@
/* $Id:
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/dd/serial/devctrl.c
* PURPOSE: Serial IRP_MJ_DEVICE_CONTROL operations
*
* PROGRAMMERS: Herv<72> Poussineau (poussine@freesurf.fr)
*/
/* FIXME: call IoAcquireRemoveLock/IoReleaseRemoveLock around each I/O operation */
#define NDEBUG
#include "serial.h"
NTSTATUS STDCALL
SerialSetBaudRate(
IN PSERIAL_DEVICE_EXTENSION DeviceExtension,
IN ULONG NewBaudRate)
{
USHORT divisor;
PUCHAR ComPortBase = (PUCHAR)DeviceExtension->BaseAddress;
ULONG BaudRate;
NTSTATUS Status = STATUS_SUCCESS;
if (NewBaudRate & SERIAL_BAUD_USER)
{
BaudRate = NewBaudRate & ~SERIAL_BAUD_USER;
divisor = (USHORT)(BAUD_CLOCK / (CLOCKS_PER_BIT * BaudRate));
}
else
{
switch (NewBaudRate)
{
case SERIAL_BAUD_075: divisor = 0x600; BaudRate = 75; break;
case SERIAL_BAUD_110: divisor = 0x400; BaudRate = 110; break;
case SERIAL_BAUD_134_5: divisor = 0x360; BaudRate = 134; break;
case SERIAL_BAUD_150: divisor = 0x300; BaudRate = 150; break;
case SERIAL_BAUD_300: divisor = 0x180; BaudRate = 300; break;
case SERIAL_BAUD_600: divisor = 0xc0; BaudRate = 600; break;
case SERIAL_BAUD_1200: divisor = 0x60; BaudRate = 1200; break;
case SERIAL_BAUD_1800: divisor = 0x40; BaudRate = 1800; break;
case SERIAL_BAUD_2400: divisor = 0x30; BaudRate = 2400; break;
case SERIAL_BAUD_4800: divisor = 0x18; BaudRate = 4800; break;
case SERIAL_BAUD_7200: divisor = 0x10; BaudRate = 7200; break;
case SERIAL_BAUD_9600: divisor = 0xc; BaudRate = 9600; break;
case SERIAL_BAUD_14400: divisor = 0x8; BaudRate = 14400; break;
case SERIAL_BAUD_38400: divisor = 0x3; BaudRate = 38400; break;
case SERIAL_BAUD_57600: divisor = 0x2; BaudRate = 57600; break;
case SERIAL_BAUD_115200: divisor = 0x1; BaudRate = 115200; break;
case SERIAL_BAUD_56K: divisor = 0x2; BaudRate = 57600; break;
case SERIAL_BAUD_128K: divisor = 0x1; BaudRate = 115200; break;
default: Status = STATUS_INVALID_PARAMETER;
}
}
if (NT_SUCCESS(Status))
{
Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort);
if (NT_SUCCESS(Status))
{
UCHAR Lcr;
DPRINT("Serial: SerialSetBaudRate(COM%lu, %lu Bauds)\n", DeviceExtension->ComPort, BaudRate);
/* Set Bit 7 of LCR to expose baud registers */
Lcr = READ_PORT_UCHAR(SER_LCR(ComPortBase));
WRITE_PORT_UCHAR(SER_LCR(ComPortBase), Lcr | SR_LCR_DLAB);
/* Write the baud rate */
WRITE_PORT_UCHAR(SER_DLL(ComPortBase), divisor & 0xff);
WRITE_PORT_UCHAR(SER_DLM(ComPortBase), divisor >> 8);
/* Switch back to normal registers */
WRITE_PORT_UCHAR(SER_LCR(ComPortBase), Lcr);
IoReleaseRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort);
}
}
if (NT_SUCCESS(Status))
DeviceExtension->BaudRate = BaudRate;
return Status;
}
NTSTATUS STDCALL
SerialSetLineControl(
IN PSERIAL_DEVICE_EXTENSION DeviceExtension,
IN PSERIAL_LINE_CONTROL NewSettings)
{
PUCHAR ComPortBase;
UCHAR Lcr = 0;
NTSTATUS Status;
DPRINT("Serial: SerialSetLineControl(COM%lu, Settings { %lu %lu %lu })\n",
DeviceExtension->ComPort, NewSettings->StopBits, NewSettings->Parity, NewSettings->WordLength);
/* Verify parameters */
switch (NewSettings->WordLength)
{
case 5: Lcr |= SR_LCR_CS5; break;
case 6: Lcr |= SR_LCR_CS6; break;
case 7: Lcr |= SR_LCR_CS7; break;
case 8: Lcr |= SR_LCR_CS8; break;
default: return STATUS_INVALID_PARAMETER;
}
if (NewSettings->WordLength < 5 || NewSettings->WordLength > 8)
return STATUS_INVALID_PARAMETER;
switch (NewSettings->Parity)
{
case NO_PARITY: Lcr |= SR_LCR_PNO; break;
case ODD_PARITY: Lcr |= SR_LCR_POD; break;
case EVEN_PARITY: Lcr |= SR_LCR_PEV; break;
case MARK_PARITY: Lcr |= SR_LCR_PMK; break;
case SPACE_PARITY: Lcr |= SR_LCR_PSP; break;
default: return STATUS_INVALID_PARAMETER;
}
switch (NewSettings->StopBits)
{
case STOP_BIT_1:
Lcr |= SR_LCR_ST1;
break;
case STOP_BITS_1_5:
if (NewSettings->WordLength != 5)
return STATUS_INVALID_PARAMETER;
Lcr |= SR_LCR_ST2;
break;
case STOP_BITS_2:
if (NewSettings->WordLength < 6 || NewSettings->WordLength > 8)
return STATUS_INVALID_PARAMETER;
Lcr |= SR_LCR_ST2;
break;
default:
return STATUS_INVALID_PARAMETER;
}
/* Update current parameters */
ComPortBase = (PUCHAR)DeviceExtension->BaseAddress;
Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort);
if (!NT_SUCCESS(Status))
return Status;
WRITE_PORT_UCHAR(SER_LCR(ComPortBase), Lcr);
/* Read junk out of RBR */
READ_PORT_UCHAR(SER_RBR(ComPortBase));
IoReleaseRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort);
if (NT_SUCCESS(Status))
DeviceExtension->SerialLineControl = *NewSettings;
return Status;
}
BOOLEAN
SerialClearPerfStats(
IN PSERIALPERF_STATS pSerialPerfStats)
{
RtlZeroMemory(pSerialPerfStats, sizeof(SERIALPERF_STATS));
return TRUE;
}
BOOLEAN
SerialGetPerfStats(IN PIRP pIrp)
{
PSERIAL_DEVICE_EXTENSION pDeviceExtension;
pDeviceExtension = (PSERIAL_DEVICE_EXTENSION)
IoGetCurrentIrpStackLocation(pIrp)->DeviceObject->DeviceExtension;
/*
* we assume buffer is big enough to hold SerialPerfStats structure
* caller must verify this
*/
RtlCopyMemory(
pIrp->AssociatedIrp.SystemBuffer,
&pDeviceExtension->SerialPerfStats,
sizeof(SERIALPERF_STATS)
);
return TRUE;
}
NTSTATUS
SerialGetCommProp(
OUT PSERIAL_COMMPROP pCommProp,
IN PSERIAL_DEVICE_EXTENSION DeviceExtension)
{
RtlZeroMemory(pCommProp, sizeof(SERIAL_COMMPROP));
pCommProp->PacketLength = sizeof(SERIAL_COMMPROP);
pCommProp->PacketVersion = 2;
pCommProp->ServiceMask = SERIAL_SP_SERIALCOMM;
pCommProp->MaxTxQueue = pCommProp->CurrentTxQueue = DeviceExtension->OutputBuffer.Length - 1;
pCommProp->MaxRxQueue = pCommProp->CurrentRxQueue = DeviceExtension->InputBuffer.Length - 1;
pCommProp->MaxBaud = SERIAL_BAUD_115200;
pCommProp->ProvSubType = 1; // PST_RS232;
/* FIXME: ProvCapabilities may be related to Uart type */
pCommProp->ProvCapabilities = SERIAL_PCF_DTRDSR | SERIAL_PCF_INTTIMEOUTS | SERIAL_PCF_PARITY_CHECK
| SERIAL_PCF_RTSCTS | SERIAL_PCF_SETXCHAR | SERIAL_PCF_SPECIALCHARS | SERIAL_PCF_TOTALTIMEOUTS
| SERIAL_PCF_XONXOFF;
/* FIXME: SettableParams may be related to Uart type */
pCommProp->SettableParams = SERIAL_SP_BAUD | SERIAL_SP_DATABITS | SERIAL_SP_HANDSHAKING
| SERIAL_SP_PARITY | SERIAL_SP_PARITY_CHECK | SERIAL_SP_STOPBITS;
/* FIXME: SettableBaud may be related to Uart type */
pCommProp->SettableBaud = SERIAL_BAUD_075 | SERIAL_BAUD_110 | SERIAL_BAUD_134_5
| SERIAL_BAUD_150 | SERIAL_BAUD_300 | SERIAL_BAUD_600 | SERIAL_BAUD_1200
| SERIAL_BAUD_1800 | SERIAL_BAUD_2400 | SERIAL_BAUD_4800 | SERIAL_BAUD_7200
| SERIAL_BAUD_9600 | SERIAL_BAUD_14400 | SERIAL_BAUD_19200 | SERIAL_BAUD_38400
| SERIAL_BAUD_56K | SERIAL_BAUD_57600 | SERIAL_BAUD_115200 | SERIAL_BAUD_128K
| SERIAL_BAUD_USER;
pCommProp->SettableData = SERIAL_DATABITS_5 | SERIAL_DATABITS_6 | SERIAL_DATABITS_7 | SERIAL_DATABITS_8;
pCommProp->SettableStopParity = SERIAL_STOPBITS_10 | SERIAL_STOPBITS_15 | SERIAL_STOPBITS_20
| SERIAL_PARITY_NONE | SERIAL_PARITY_ODD | SERIAL_PARITY_EVEN | SERIAL_PARITY_MARK | SERIAL_PARITY_SPACE;
return STATUS_SUCCESS;
}
NTSTATUS
SerialGetCommStatus(
OUT PSERIAL_STATUS pSerialStatus,
IN PSERIAL_DEVICE_EXTENSION DeviceExtension)
{
KIRQL Irql;
RtlZeroMemory(pSerialStatus, sizeof(SERIAL_STATUS));
pSerialStatus->Errors = 0; /* FIXME */
pSerialStatus->HoldReasons = 0; /* FIXME */
KeAcquireSpinLock(&DeviceExtension->InputBufferLock, &Irql);
pSerialStatus->AmountInInQueue = (DeviceExtension->InputBuffer.WritePosition + DeviceExtension->InputBuffer.Length
- DeviceExtension->InputBuffer.ReadPosition) % DeviceExtension->InputBuffer.Length;
KeReleaseSpinLock(&DeviceExtension->InputBufferLock, Irql);
KeAcquireSpinLock(&DeviceExtension->OutputBufferLock, &Irql);
pSerialStatus->AmountInOutQueue = (DeviceExtension->OutputBuffer.WritePosition + DeviceExtension->OutputBuffer.Length
- DeviceExtension->OutputBuffer.ReadPosition) % DeviceExtension->OutputBuffer.Length;
KeReleaseSpinLock(&DeviceExtension->OutputBufferLock, Irql);
pSerialStatus->EofReceived = FALSE; /* FIXME */
pSerialStatus->WaitForImmediate = FALSE; /* FIXME */
return STATUS_SUCCESS;
}
NTSTATUS STDCALL
SerialDeviceControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PIO_STACK_LOCATION Stack;
PSERIAL_DEVICE_EXTENSION DeviceExtension;
ULONG LengthIn, LengthOut;
ULONG Information = 0;
PUCHAR Buffer;
PUCHAR ComPortBase;
NTSTATUS Status;
DPRINT("Serial: IRP_MJ_DEVICE_CONTROL dispatch\n");
/* FIXME: pend operation if possible */
Stack = IoGetCurrentIrpStackLocation(Irp);
LengthIn = Stack->Parameters.DeviceIoControl.InputBufferLength;
LengthOut = Stack->Parameters.DeviceIoControl.OutputBufferLength;
Buffer = Irp->AssociatedIrp.SystemBuffer;
DeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
ComPortBase = (PUCHAR)DeviceExtension->BaseAddress;
/* FIXME: need to probe buffers */
/* FIXME: see http://www.osronline.com/ddkx/serial/serref_61bm.htm */
switch (Stack->Parameters.DeviceIoControl.IoControlCode)
{
case IOCTL_SERIAL_CLEAR_STATS:
{
DPRINT("Serial: IOCTL_SERIAL_CLEAR_STATS\n");
KeSynchronizeExecution(
DeviceExtension->Interrupt,
(PKSYNCHRONIZE_ROUTINE)SerialClearPerfStats,
&DeviceExtension->SerialPerfStats);
Status = STATUS_SUCCESS;
break;
}
case IOCTL_SERIAL_CLR_DTR:
{
DPRINT("Serial: IOCTL_SERIAL_CLR_DTR\n");
/* FIXME: If the handshake flow control of the device is configured to
* automatically use DTR, return STATUS_INVALID_PARAMETER */
DeviceExtension->MCR &= ~SR_MCR_DTR;
WRITE_PORT_UCHAR(SER_MCR(ComPortBase), DeviceExtension->MCR);
Status = STATUS_SUCCESS;
break;
}
case IOCTL_SERIAL_CLR_RTS:
{
DPRINT("Serial: IOCTL_SERIAL_CLR_RTS\n");
/* FIXME: If the handshake flow control of the device is configured to
* automatically use RTS, return STATUS_INVALID_PARAMETER */
DeviceExtension->MCR &= ~SR_MCR_RTS;
WRITE_PORT_UCHAR(SER_MCR(ComPortBase), DeviceExtension->MCR);
Status = STATUS_SUCCESS;
break;
}
case IOCTL_SERIAL_CONFIG_SIZE:
{
/* Obsolete on Microsoft Windows 2000+ */
PULONG pConfigSize;
DPRINT("Serial: IOCTL_SERIAL_CONFIG_SIZE\n");
if (LengthOut != sizeof(ULONG) || Buffer == NULL)
Status = STATUS_INVALID_PARAMETER;
else
{
pConfigSize = (PULONG)Buffer;
*pConfigSize = 0;
Status = STATUS_SUCCESS;
}
break;
}
case IOCTL_SERIAL_GET_BAUD_RATE:
{
DPRINT("Serial: IOCTL_SERIAL_GET_BAUD_RATE\n");
/* FIXME: HACK!!! following line MUST NOT be here! */
Buffer = Irp->UserBuffer;
if (LengthOut < sizeof(SERIAL_BAUD_RATE))
Status = STATUS_BUFFER_TOO_SMALL;
else if (Buffer == NULL)
Status = STATUS_INVALID_PARAMETER;
else
{
((PSERIAL_BAUD_RATE)Buffer)->BaudRate = DeviceExtension->BaudRate;
Information = sizeof(SERIAL_BAUD_RATE);
Status = STATUS_SUCCESS;
}
}
case IOCTL_SERIAL_GET_CHARS:
{
/* FIXME */
DPRINT1("Serial: IOCTL_SERIAL_GET_CHARS not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_GET_COMMSTATUS:
{
DPRINT("Serial: IOCTL_SERIAL_GET_COMMSTATUS\n");
if (LengthOut < sizeof(SERIAL_STATUS))
{
DPRINT("Serial: return STATUS_BUFFER_TOO_SMALL\n");
Status = STATUS_BUFFER_TOO_SMALL;
}
else if (Buffer == NULL)
{
DPRINT("Serial: return STATUS_INVALID_PARAMETER\n");
Status = STATUS_INVALID_PARAMETER;
}
else
{
Status = SerialGetCommStatus((PSERIAL_STATUS)Buffer, DeviceExtension);
Information = sizeof(SERIAL_STATUS);
}
break;
}
case IOCTL_SERIAL_GET_DTRRTS:
{
PULONG pDtrRts;
DPRINT("Serial: IOCTL_SERIAL_GET_DTRRTS\n");
if (LengthOut != sizeof(ULONG) || Buffer == NULL)
Status = STATUS_INVALID_PARAMETER;
else
{
pDtrRts = (PULONG)Buffer;
*pDtrRts = 0;
if (DeviceExtension->MCR & SR_MCR_DTR)
*pDtrRts |= SERIAL_DTR_STATE;
if (DeviceExtension->MCR & SR_MCR_RTS)
*pDtrRts |= SERIAL_RTS_STATE;
Status = STATUS_SUCCESS;
}
break;
}
case IOCTL_SERIAL_GET_HANDFLOW:
{
/* FIXME */
DPRINT1("Serial: IOCTL_SERIAL_GET_HANDFLOW not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_GET_LINE_CONTROL:
{
DPRINT("Serial: IOCTL_SERIAL_GET_LINE_CONTROL\n");
if (LengthOut < sizeof(SERIAL_LINE_CONTROL))
Status = STATUS_BUFFER_TOO_SMALL;
else if (Buffer == NULL)
Status = STATUS_INVALID_PARAMETER;
else
{
*((PSERIAL_LINE_CONTROL)Buffer) = DeviceExtension->SerialLineControl;
Information = sizeof(SERIAL_LINE_CONTROL);
Status = STATUS_SUCCESS;
}
break;
}
case IOCTL_SERIAL_GET_MODEM_CONTROL:
{
PULONG pMCR;
DPRINT("Serial: IOCTL_SERIAL_GET_MODEM_CONTROL\n");
if (LengthOut != sizeof(ULONG) || Buffer == NULL)
Status = STATUS_INVALID_PARAMETER;
else
{
pMCR = (PULONG)Buffer;
*pMCR = DeviceExtension->MCR;
Status = STATUS_SUCCESS;
}
break;
}
case IOCTL_SERIAL_GET_MODEMSTATUS:
{
PULONG pMSR;
DPRINT("Serial: IOCTL_SERIAL_GET_MODEMSTATUS\n");
if (LengthOut != sizeof(ULONG) || Buffer == NULL)
Status = STATUS_INVALID_PARAMETER;
else
{
pMSR = (PULONG)Buffer;
*pMSR = DeviceExtension->MSR;
Status = STATUS_SUCCESS;
}
break;
}
case IOCTL_SERIAL_GET_PROPERTIES:
{
DPRINT("Serial: IOCTL_SERIAL_GET_PROPERTIES\n");
if (LengthOut < sizeof(SERIAL_COMMPROP))
{
DPRINT("Serial: return STATUS_BUFFER_TOO_SMALL\n");
Status = STATUS_BUFFER_TOO_SMALL;
}
else if (Buffer == NULL)
{
DPRINT("Serial: return STATUS_INVALID_PARAMETER\n");
Status = STATUS_INVALID_PARAMETER;
}
else
{
Status = SerialGetCommProp((PSERIAL_COMMPROP)Buffer, DeviceExtension);
Information = sizeof(SERIAL_COMMPROP);
}
break;
}
case IOCTL_SERIAL_GET_STATS:
{
DPRINT("Serial: IOCTL_SERIAL_GET_STATS\n");
if (LengthOut < sizeof(SERIALPERF_STATS))
{
DPRINT("Serial: return STATUS_BUFFER_TOO_SMALL\n");
Status = STATUS_BUFFER_TOO_SMALL;
}
else if (Buffer == NULL)
{
DPRINT("Serial: return STATUS_INVALID_PARAMETER\n");
Status = STATUS_INVALID_PARAMETER;
}
else
{
KeSynchronizeExecution(DeviceExtension->Interrupt,
(PKSYNCHRONIZE_ROUTINE)SerialGetPerfStats, Irp);
Status = STATUS_SUCCESS;
Information = sizeof(SERIALPERF_STATS);
}
break;
}
case IOCTL_SERIAL_GET_TIMEOUTS:
{
DPRINT("Serial: IOCTL_SERIAL_GET_TIMEOUTS\n");
if (LengthOut != sizeof(SERIAL_TIMEOUTS) || Buffer == NULL)
Status = STATUS_INVALID_PARAMETER;
else
{
*(PSERIAL_TIMEOUTS)Buffer = DeviceExtension->SerialTimeOuts;
Status = STATUS_SUCCESS;
}
break;
}
case IOCTL_SERIAL_GET_WAIT_MASK:
{
PULONG pWaitMask;
DPRINT("Serial: IOCTL_SERIAL_GET_WAIT_MASK\n");
if (LengthOut != sizeof(ULONG) || Buffer == NULL)
Status = STATUS_INVALID_PARAMETER;
else
{
pWaitMask = (PULONG)Buffer;
*pWaitMask = DeviceExtension->WaitMask;
Status = STATUS_SUCCESS;
}
break;
}
case IOCTL_SERIAL_IMMEDIATE_CHAR:
{
/* FIXME */
DPRINT1("Serial: IOCTL_SERIAL_IMMEDIATE_CHAR not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_LSRMST_INSERT:
{
/* FIXME */
DPRINT1("Serial: IOCTL_SERIAL_LSRMST_INSERT not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_PURGE:
{
KIRQL Irql1, Irql2;
DPRINT("Serial: IOCTL_SERIAL_PURGE\n");
KeAcquireSpinLock(&DeviceExtension->InputBufferLock, &Irql1);
KeAcquireSpinLock(&DeviceExtension->OutputBufferLock, &Irql2);
DeviceExtension->InputBuffer.ReadPosition = DeviceExtension->InputBuffer.WritePosition = 0;
DeviceExtension->OutputBuffer.ReadPosition = DeviceExtension->OutputBuffer.WritePosition = 0;
/* Clear receive/transmit buffers */
if (DeviceExtension->UartType >= Uart16550)
{
WRITE_PORT_UCHAR(SER_FCR(ComPortBase),
SR_FCR_CLEAR_RCVR | SR_FCR_CLEAR_XMIT);
}
KeReleaseSpinLock(&DeviceExtension->OutputBufferLock, Irql2);
KeReleaseSpinLock(&DeviceExtension->InputBufferLock, Irql1);
Status = STATUS_SUCCESS;
break;
}
case IOCTL_SERIAL_RESET_DEVICE:
{
/* FIXME */
DPRINT1("Serial: IOCTL_SERIAL_RESET_DEVICE not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_SET_BAUD_RATE:
{
PULONG pNewBaudRate;
DPRINT("Serial: IOCTL_SERIAL_SET_BAUD_RATE\n");
if (LengthIn != sizeof(ULONG) || Buffer == NULL)
Status = STATUS_INVALID_PARAMETER;
else
{
pNewBaudRate = (PULONG)Buffer;
Status = SerialSetBaudRate(DeviceExtension, *pNewBaudRate);
}
break;
}
case IOCTL_SERIAL_SET_BREAK_OFF:
{
/* FIXME */
DPRINT1("Serial: IOCTL_SERIAL_SET_BREAK_OFF not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_SET_BREAK_ON:
{
/* FIXME */
DPRINT1("Serial: IOCTL_SERIAL_SET_BREAK_ON not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_SET_CHARS:
{
/* FIXME */
DPRINT1("Serial: IOCTL_SERIAL_SET_CHARS not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_SET_DTR:
{
/* FIXME: If the handshake flow control of the device is configured to
* automatically use DTR, return STATUS_INVALID_PARAMETER */
DPRINT("Serial: IOCTL_SERIAL_SET_DTR\n");
if (!(DeviceExtension->MCR & SR_MCR_DTR))
{
DeviceExtension->MCR |= SR_MCR_DTR;
WRITE_PORT_UCHAR(SER_MCR(ComPortBase), DeviceExtension->MCR);
}
Status = STATUS_SUCCESS;
break;
}
case IOCTL_SERIAL_SET_FIFO_CONTROL:
{
DPRINT("Serial: IOCTL_SERIAL_SET_FIFO_CONTROL\n");
if (LengthIn != sizeof(ULONG) || Buffer == NULL)
Status = STATUS_INVALID_PARAMETER;
else
{
WRITE_PORT_UCHAR(SER_FCR(ComPortBase), (UCHAR)((*(PULONG)Buffer) & 0xff));
Status = STATUS_SUCCESS;
}
break;
}
case IOCTL_SERIAL_SET_HANDFLOW:
{
/* FIXME */
DPRINT1("Serial: IOCTL_SERIAL_SET_HANDFLOW not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_SET_LINE_CONTROL:
{
DPRINT("Serial: IOCTL_SERIAL_SET_LINE_CONTROL\n");
if (LengthIn < sizeof(SERIAL_LINE_CONTROL))
Status = STATUS_BUFFER_TOO_SMALL;
else if (Buffer == NULL)
Status = STATUS_INVALID_PARAMETER;
else
Status = SerialSetLineControl(DeviceExtension, (PSERIAL_LINE_CONTROL)Buffer);
break;
}
case IOCTL_SERIAL_SET_MODEM_CONTROL:
{
PULONG pMCR;
DPRINT("Serial: IOCTL_SERIAL_SET_MODEM_CONTROL\n");
if (LengthIn != sizeof(ULONG) || Buffer == NULL)
Status = STATUS_INVALID_PARAMETER;
else
{
pMCR = (PULONG)Buffer;
DeviceExtension->MCR = (UCHAR)(*pMCR & 0xff);
WRITE_PORT_UCHAR(SER_MCR(ComPortBase), DeviceExtension->MCR);
Status = STATUS_SUCCESS;
}
break;
}
case IOCTL_SERIAL_SET_QUEUE_SIZE:
{
if (LengthIn < sizeof(SERIAL_QUEUE_SIZE ))
return STATUS_BUFFER_TOO_SMALL;
else if (Buffer == NULL)
return STATUS_INVALID_PARAMETER;
else
{
KIRQL Irql;
Status = STATUS_SUCCESS;
if (((PSERIAL_QUEUE_SIZE)Buffer)->InSize > DeviceExtension->InputBuffer.Length)
{
KeAcquireSpinLock(&DeviceExtension->InputBufferLock, &Irql);
Status = IncreaseCircularBufferSize(&DeviceExtension->InputBuffer, ((PSERIAL_QUEUE_SIZE)Buffer)->InSize);
KeReleaseSpinLock(&DeviceExtension->InputBufferLock, Irql);
}
if (NT_SUCCESS(Status) && ((PSERIAL_QUEUE_SIZE)Buffer)->OutSize > DeviceExtension->OutputBuffer.Length)
{
KeAcquireSpinLock(&DeviceExtension->OutputBufferLock, &Irql);
Status = IncreaseCircularBufferSize(&DeviceExtension->OutputBuffer, ((PSERIAL_QUEUE_SIZE)Buffer)->OutSize);
KeReleaseSpinLock(&DeviceExtension->OutputBufferLock, Irql);
}
}
break;
}
case IOCTL_SERIAL_SET_RTS:
{
/* FIXME: If the handshake flow control of the device is configured to
* automatically use DTR, return STATUS_INVALID_PARAMETER */
DPRINT("Serial: IOCTL_SERIAL_SET_RTS\n");
if (!(DeviceExtension->MCR & SR_MCR_RTS))
{
DeviceExtension->MCR |= SR_MCR_RTS;
WRITE_PORT_UCHAR(SER_MCR(ComPortBase), DeviceExtension->MCR);
}
Status = STATUS_SUCCESS;
break;
}
case IOCTL_SERIAL_SET_TIMEOUTS:
{
DPRINT("Serial: IOCTL_SERIAL_SET_TIMEOUTS\n");
if (LengthIn != sizeof(SERIAL_TIMEOUTS) || Buffer == NULL)
Status = STATUS_INVALID_PARAMETER;
else
{
DeviceExtension->SerialTimeOuts = *(PSERIAL_TIMEOUTS)Buffer;
Status = STATUS_SUCCESS;
}
break;
}
case IOCTL_SERIAL_SET_WAIT_MASK:
{
PULONG pWaitMask;
DPRINT("Serial: IOCTL_SERIAL_SET_WAIT_MASK\n");
if (LengthIn != sizeof(ULONG) || Buffer == NULL)
Status = STATUS_INVALID_PARAMETER;
else
{
pWaitMask = (PULONG)Buffer;
DeviceExtension->WaitMask = *pWaitMask;
Status = STATUS_SUCCESS;
}
break;
}
case IOCTL_SERIAL_SET_XOFF:
{
/* FIXME */
DPRINT1("Serial: IOCTL_SERIAL_SET_XOFF not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_SET_XON:
{
/* FIXME */
DPRINT1("Serial: IOCTL_SERIAL_SET_XON not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_WAIT_ON_MASK:
{
/* FIXME */
DPRINT1("Serial: IOCTL_SERIAL_WAIT_ON_MASK not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_XOFF_COUNTER:
{
/* FIXME */
DPRINT1("Serial: IOCTL_SERIAL_XOFF_COUNTER not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
default:
{
/* Pass Irp to lower driver */
DPRINT("Serial: Unknown IOCTL code 0x%x\n", Stack->Parameters.DeviceIoControl.IoControlCode);
IoSkipCurrentIrpStackLocation(Irp);
return IoCallDriver(DeviceExtension->LowerDevice, Irp);
}
}
Irp->IoStatus.Information = Information;
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}

View File

@@ -0,0 +1,76 @@
/* $Id:
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/dd/serial/info.c
* PURPOSE: Serial IRP_MJ_QUERY_INFORMATION operations
*
* PROGRAMMERS: Herv<72> Poussineau (poussine@freesurf.fr)
*/
#define NDEBUG2
#include "serial.h"
NTSTATUS STDCALL
SerialQueryInformation(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PSERIAL_DEVICE_EXTENSION DeviceExtension;
PIO_STACK_LOCATION Stack;
PVOID SystemBuffer;
ULONG BufferLength;
ULONG Information = 0;
NTSTATUS Status;
DeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
Stack = IoGetCurrentIrpStackLocation(Irp);
SystemBuffer = Irp->AssociatedIrp.SystemBuffer;
BufferLength = Stack->Parameters.QueryFile.Length;
switch (Stack->Parameters.QueryFile.FileInformationClass)
{
case FileStandardInformation:
{
PFILE_STANDARD_INFORMATION StandardInfo = (PFILE_STANDARD_INFORMATION)SystemBuffer;
DPRINT("Serial: IRP_MJ_QUERY_INFORMATION / FileStandardInformation\n");
if (BufferLength < sizeof(FILE_STANDARD_INFORMATION))
Status = STATUS_BUFFER_OVERFLOW;
else
{
StandardInfo->AllocationSize.QuadPart = 0;
StandardInfo->EndOfFile.QuadPart = 0;
StandardInfo->Directory = FALSE;
StandardInfo->NumberOfLinks = 0;
StandardInfo->DeletePending = FALSE; /* FIXME: should be TRUE sometimes */
Status = STATUS_SUCCESS;
}
break;
}
case FilePositionInformation:
{
PFILE_POSITION_INFORMATION PositionInfo = (PFILE_POSITION_INFORMATION)SystemBuffer;
DPRINT("Serial: IRP_MJ_QUERY_INFORMATION / FilePositionInformation\n");
if (BufferLength < sizeof(PFILE_POSITION_INFORMATION))
Status = STATUS_BUFFER_OVERFLOW;
else
{
PositionInfo->CurrentByteOffset.QuadPart = 0;
Status = STATUS_SUCCESS;
}
break;
}
default:
{
DPRINT("Serial: IRP_MJ_QUERY_INFORMATION: Unexpected file information class 0x%02x\n", Stack->Parameters.QueryFile.FileInformationClass);
return ForwardIrpAndForget(DeviceObject, Irp);
}
}
Irp->IoStatus.Information = Information;
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}

View File

@@ -0,0 +1,180 @@
/* $Id:
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/bus/serial/legacy.c
* PURPOSE: Legacy serial port enumeration
*
* PROGRAMMERS: Herv<72> Poussineau (poussine@freesurf.fr)
* Mark Junker (mjscod@gmx.de)
*/
#define NDEBUG
#include "serial.h"
UART_TYPE
SerialDetectUartType(
IN PUCHAR BaseAddress)
{
UCHAR Lcr, TestLcr;
UCHAR OldScr, Scr5A, ScrA5;
BOOLEAN FifoEnabled;
UCHAR NewFifoStatus;
Lcr = READ_PORT_UCHAR(SER_LCR(BaseAddress));
WRITE_PORT_UCHAR(SER_LCR(BaseAddress), Lcr ^ 0xFF);
TestLcr = READ_PORT_UCHAR(SER_LCR(BaseAddress)) ^ 0xFF;
WRITE_PORT_UCHAR(SER_LCR(BaseAddress), Lcr);
/* Accessing the LCR must work for a usable serial port */
if (TestLcr != Lcr)
return UartUnknown;
/* Ensure that all following accesses are done as required */
READ_PORT_UCHAR(SER_RBR(BaseAddress));
READ_PORT_UCHAR(SER_IER(BaseAddress));
READ_PORT_UCHAR(SER_IIR(BaseAddress));
READ_PORT_UCHAR(SER_LCR(BaseAddress));
READ_PORT_UCHAR(SER_MCR(BaseAddress));
READ_PORT_UCHAR(SER_LSR(BaseAddress));
READ_PORT_UCHAR(SER_MSR(BaseAddress));
READ_PORT_UCHAR(SER_SCR(BaseAddress));
/* Test scratch pad */
OldScr = READ_PORT_UCHAR(SER_SCR(BaseAddress));
WRITE_PORT_UCHAR(SER_SCR(BaseAddress), 0x5A);
Scr5A = READ_PORT_UCHAR(SER_SCR(BaseAddress));
WRITE_PORT_UCHAR(SER_SCR(BaseAddress), 0xA5);
ScrA5 = READ_PORT_UCHAR(SER_SCR(BaseAddress));
WRITE_PORT_UCHAR(SER_SCR(BaseAddress), OldScr);
/* When non-functional, we have a 8250 */
if (Scr5A != 0x5A || ScrA5 != 0xA5)
return Uart8250;
/* Test FIFO type */
FifoEnabled = (READ_PORT_UCHAR(SER_IIR(BaseAddress)) & 0x80) != 0;
WRITE_PORT_UCHAR(SER_FCR(BaseAddress), SR_FCR_ENABLE_FIFO);
NewFifoStatus = READ_PORT_UCHAR(SER_IIR(BaseAddress)) & 0xC0;
if (!FifoEnabled)
WRITE_PORT_UCHAR(SER_FCR(BaseAddress), 0);
switch (NewFifoStatus)
{
case 0x00:
return Uart16450;
case 0x80:
return Uart16550;
}
/* FIFO is only functional for 16550A+ */
return Uart16550A;
}
NTSTATUS
DetectLegacyDevice(
IN PDRIVER_OBJECT DriverObject,
IN ULONG ComPortBase,
IN ULONG Irq)
{
ULONG ResourceListSize;
PCM_RESOURCE_LIST ResourceList;
PCM_PARTIAL_RESOURCE_DESCRIPTOR ResourceDescriptor;
BOOLEAN ConflictDetected;
UART_TYPE UartType;
PDEVICE_OBJECT Pdo = NULL;
PDEVICE_OBJECT Fdo;
KIRQL Dirql;
NTSTATUS Status;
/* Create resource list */
ResourceListSize = sizeof(CM_RESOURCE_LIST) + sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
ResourceList = (PCM_RESOURCE_LIST)ExAllocatePoolWithTag(PagedPool, ResourceListSize, SERIAL_TAG);
if (!ResourceList)
return STATUS_INSUFFICIENT_RESOURCES;
ResourceList->Count = 1;
ResourceList->List[0].InterfaceType = Isa;
ResourceList->List[0].BusNumber = -1; /* FIXME */
ResourceList->List[0].PartialResourceList.Version = 1;
ResourceList->List[0].PartialResourceList.Revision = 1;
ResourceList->List[0].PartialResourceList.Count = 2;
ResourceDescriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[0];
ResourceDescriptor->Type = CmResourceTypePort;
ResourceDescriptor->ShareDisposition = CmResourceShareDriverExclusive;
ResourceDescriptor->Flags = CM_RESOURCE_PORT_IO;
ResourceDescriptor->u.Port.Start.u.HighPart = 0;
ResourceDescriptor->u.Port.Start.u.LowPart = ComPortBase;
ResourceDescriptor->u.Port.Length = 8;
ResourceDescriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[1];
ResourceDescriptor->Type = CmResourceTypeInterrupt;
ResourceDescriptor->ShareDisposition = CmResourceShareShared;
ResourceDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED;
ResourceDescriptor->u.Interrupt.Vector = HalGetInterruptVector(
Internal, 0, 0, Irq,
&Dirql,
&ResourceDescriptor->u.Interrupt.Affinity);
ResourceDescriptor->u.Interrupt.Level = (ULONG)Dirql;
/* Report resource list */
Status = IoReportResourceForDetection(
DriverObject, ResourceList, ResourceListSize,
NULL, NULL, 0,
&ConflictDetected);
if (Status == STATUS_CONFLICTING_ADDRESSES)
return STATUS_DEVICE_NOT_CONNECTED;
if (!NT_SUCCESS(Status))
return Status;
/* Test if port exists */
UartType = SerialDetectUartType((PUCHAR)ComPortBase);
/* Report device if detected... */
if (UartType != UartUnknown)
{
Status = IoReportDetectedDevice(
DriverObject,
ResourceList->List[0].InterfaceType, ResourceList->List[0].BusNumber, -1/*FIXME*/,
ResourceList, NULL,
TRUE,
&Pdo);
if (NT_SUCCESS(Status))
{
Status = SerialAddDeviceInternal(DriverObject, Pdo, UartType, &Fdo);
if (NT_SUCCESS(Status))
{
Status = SerialPnpStartDevice(Fdo, ResourceList);
}
}
}
else
{
/* Release resources */
Status = IoReportResourceForDetection(
DriverObject, NULL, 0,
NULL, NULL, 0,
&ConflictDetected);
Status = STATUS_DEVICE_NOT_CONNECTED;
}
return Status;
}
NTSTATUS
DetectLegacyDevices(
IN PDRIVER_OBJECT DriverObject)
{
ULONG ComPortBase[] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
ULONG Irq[] = { 4, 3, 4, 3 };
ULONG i;
NTSTATUS Status;
NTSTATUS ReturnedStatus = STATUS_SUCCESS;
for (i = 0; i < sizeof(ComPortBase)/sizeof(ComPortBase[0]); i++)
{
Status = DetectLegacyDevice(DriverObject, ComPortBase[i], Irq[i]);
if (!NT_SUCCESS(Status) && Status != STATUS_DEVICE_NOT_CONNECTED)
ReturnedStatus = Status;
DPRINT("Serial: Legacy device at 0x%x (IRQ %lu): status = 0x%08lx\n", ComPortBase[i], Irq[i], Status);
}
return ReturnedStatus;
}

View File

@@ -6,7 +6,19 @@ TARGET_TYPE = driver
TARGET_NAME = serial
TARGET_OBJECTS = serial.o
TARGET_OBJECTS = \
circularbuffer.o \
cleanup.o \
close.o \
create.o \
devctrl.o \
info.o \
legacy.o \
misc.o \
pnp.o \
power.o \
rw.o \
serial.o
TARGET_CFLAGS = -Wall -Werror -D__USE_W32API

View File

@@ -0,0 +1,196 @@
/* $Id:
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/dd/serial/misc.c
* PURPOSE: Misceallenous operations
*
* PROGRAMMERS: Herv<72> Poussineau (poussine@freesurf.fr)
*/
/* FIXME: call IoAcquireRemoveLock/IoReleaseRemoveLock around each I/O operation */
#define NDEBUG
#include "serial.h"
NTSTATUS STDCALL
ForwardIrpAndWaitCompletion(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
IN PVOID Context)
{
if (Irp->PendingReturned)
KeSetEvent((PKEVENT)Context, IO_NO_INCREMENT, FALSE);
return STATUS_MORE_PROCESSING_REQUIRED;
}
NTSTATUS
ForwardIrpAndWait(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PDEVICE_OBJECT LowerDevice = ((PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
KEVENT Event;
NTSTATUS Status;
KeInitializeEvent(&Event, NotificationEvent, FALSE);
IoCopyCurrentIrpStackLocationToNext(Irp);
DPRINT("Serial: Calling lower device %p [%wZ]\n", LowerDevice, &LowerDevice->DriverObject->DriverName);
IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE);
Status = IoCallDriver(LowerDevice, Irp);
if (Status == STATUS_PENDING)
{
Status = KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL);
if (NT_SUCCESS(Status))
Status = Irp->IoStatus.Status;
}
return Status;
}
NTSTATUS STDCALL
ForwardIrpAndForget(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PDEVICE_OBJECT LowerDevice = ((PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
IoSkipCurrentIrpStackLocation(Irp);
return IoCallDriver(LowerDevice, Irp);
}
VOID STDCALL
SerialReceiveByte(
IN PKDPC Dpc,
IN PVOID pDeviceExtension, // real type PSERIAL_DEVICE_EXTENSION
IN PVOID pByte, // real type UCHAR
IN PVOID Unused)
{
PSERIAL_DEVICE_EXTENSION DeviceExtension;
UCHAR Byte;
KIRQL Irql;
NTSTATUS Status;
DeviceExtension = (PSERIAL_DEVICE_EXTENSION)pDeviceExtension;
Byte = (UCHAR)(ULONG_PTR)pByte;
DPRINT1("Serial: received byte on COM%lu: 0x%02x (%c)\n",
DeviceExtension->ComPort, Byte, Byte);
KeAcquireSpinLock(&DeviceExtension->InputBufferLock, &Irql);
Status = PushCircularBufferEntry(&DeviceExtension->InputBuffer, Byte);
if (!NT_SUCCESS(Status))
{
/* FIXME: count buffer overflow */
return;
}
DPRINT1("Serial: push to buffer done\n");
KeReleaseSpinLock(&DeviceExtension->InputBufferLock, Irql);
InterlockedIncrement(&DeviceExtension->SerialPerfStats.ReceivedCount);
}
VOID STDCALL
SerialSendByte(
IN PKDPC Dpc,
IN PVOID pDeviceExtension, // real type PSERIAL_DEVICE_EXTENSION
IN PVOID Unused1,
IN PVOID Unused2)
{
PSERIAL_DEVICE_EXTENSION DeviceExtension;
PUCHAR ComPortBase;
UCHAR Byte;
KIRQL Irql;
NTSTATUS Status;
DeviceExtension = (PSERIAL_DEVICE_EXTENSION)pDeviceExtension;
ComPortBase = (PUCHAR)DeviceExtension->BaseAddress;
DPRINT1("Serial: sending bytes (if any) on COM%lu\n",
DeviceExtension->ComPort);
KeAcquireSpinLock(&DeviceExtension->OutputBufferLock, &Irql);
while (!IsCircularBufferEmpty(&DeviceExtension->OutputBuffer)
&& READ_PORT_UCHAR(SER_LSR(ComPortBase)) & SR_LSR_TBE)
{
Status = PopCircularBufferEntry(&DeviceExtension->OutputBuffer, &Byte);
if (!NT_SUCCESS(Status))
break;
WRITE_PORT_UCHAR(SER_THR(ComPortBase), Byte);
DeviceExtension->SerialPerfStats.TransmittedCount++;
}
KeReleaseSpinLock(&DeviceExtension->OutputBufferLock, Irql);
}
BOOLEAN STDCALL
SerialInterruptService(
IN PKINTERRUPT Interrupt,
IN OUT PVOID ServiceContext)
{
PDEVICE_OBJECT DeviceObject;
PSERIAL_DEVICE_EXTENSION DeviceExtension;
UCHAR Byte;
PUCHAR ComPortBase;
UCHAR Iir;
DeviceObject = (PDEVICE_OBJECT)ServiceContext;
DeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
ComPortBase = (PUCHAR)DeviceExtension->BaseAddress;
Iir = READ_PORT_UCHAR(SER_IIR(ComPortBase));
if (Iir == 0xff)
return TRUE;
Iir &= SR_IIR_ID_MASK;
if ((Iir & SR_IIR_SELF) != 0) { return FALSE; }
/* FIXME: sometimes, update DeviceExtension->IER */
/* FIXME: sometimes, update DeviceExtension->MCR */
switch (Iir)
{
case SR_IIR_MSR_CHANGE:
{
DPRINT1("Serial: SR_IIR_MSR_CHANGE\n");
DeviceExtension->MSR = READ_PORT_UCHAR(SER_MSR(ComPortBase));
/* FIXME: what to do? */
return TRUE;
}
case SR_IIR_THR_EMPTY:
{
DPRINT("Serial: SR_IIR_THR_EMPTY\n");
return KeInsertQueueDpc(&DeviceExtension->SendByteDpc, NULL, NULL);
}
case SR_IIR_DATA_RECEIVED:
{
DPRINT1("Serial: SR_IIR_DATA_RECEIVED\n");
while (READ_PORT_UCHAR(SER_LSR(ComPortBase)) & SR_LSR_DR)
{
Byte = READ_PORT_UCHAR(SER_RBR(ComPortBase));
DPRINT1("Serial: Byte received: 0x%02x (%c)\n", Byte, Byte);
if (!KeInsertQueueDpc(&DeviceExtension->ReceivedByteDpc, (PVOID)(ULONG_PTR)Byte, NULL))
break;
}
return TRUE;
}
case SR_IIR_ERROR:
{
/* FIXME: what to do? */
DPRINT1("Serial: SR_IIR_ERROR\n");
break;
/*Error = READ_PORT_UCHAR( Self->Port + UART_LSR );
if( Error & LSR_OVERRUN )
Self->WaitingReadBytes.PushBack( SerialFifo::OVERRUN );
DeviceExtension->SerialPerfStats.SerialOverrunErrorCount++;
if( Error & LSR_PARITY_ERROR )
Self->WaitingReadBytes.PushBack( SerialFifo::PARITY );
DeviceExtension->SerialPerfStats.ParityErrorCount++;
if( Error & LSR_FRAMING_ERROR )
Self->WaitingReadBytes.PushBack( SerialFifo::FRAMING );
DeviceExtension->SerialPerfStats.FrameErrorCount++;
if( Error & LSR_BREAK )
Self->WaitingReadBytes.PushBack( SerialFifo::BREAK );
if( Error & LSR_TIMEOUT )
Self->WaitingReadBytes.PushBack( SerialFifo::TIMEOUT );
return KeInsertQueueDpc( &Self->DataInDpc, Self, 0 );*/
}
}
return FALSE;
}

View File

@@ -0,0 +1,351 @@
/* $Id:
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/dd/serial/pnp.c
* PURPOSE: Serial IRP_MJ_PNP operations
*
* PROGRAMMERS: Herv<72> Poussineau (poussine@freesurf.fr)
*/
/* FIXME: call IoAcquireRemoveLock/IoReleaseRemoveLock around each I/O operation */
#define INITGUID
#define NDEBUG
#include "serial.h"
NTSTATUS STDCALL
SerialAddDeviceInternal(
IN PDRIVER_OBJECT DriverObject,
IN PDEVICE_OBJECT Pdo,
IN UART_TYPE UartType,
OUT PDEVICE_OBJECT* pFdo OPTIONAL)
{
PDEVICE_OBJECT Fdo = NULL;
PSERIAL_DEVICE_EXTENSION DeviceExtension = NULL;
NTSTATUS Status;
WCHAR DeviceNameBuffer[32];
UNICODE_STRING DeviceName;
//UNICODE_STRING SymbolicLinkName;
static ULONG DeviceNumber = 0;
DPRINT("Serial: SerialAddDeviceInternal called\n");
/* Create new device object */
swprintf(DeviceNameBuffer, L"\\Device\\Serial%lu", DeviceNumber);
RtlInitUnicodeString(&DeviceName, DeviceNameBuffer);
Status = IoCreateDevice(DriverObject,
sizeof(SERIAL_DEVICE_EXTENSION),
&DeviceName,
FILE_DEVICE_SERIAL_PORT,
FILE_DEVICE_SECURE_OPEN,
FALSE,
&Fdo);
if (!NT_SUCCESS(Status))
{
DPRINT("Serial: IoCreateDevice() failed with status 0x%08x\n", Status);
Fdo = NULL;
goto ByeBye;
}
DeviceExtension = (PSERIAL_DEVICE_EXTENSION)Fdo->DeviceExtension;
RtlZeroMemory(DeviceExtension, sizeof(SERIAL_DEVICE_EXTENSION));
/* Register device interface */
#if 0 /* FIXME: activate */
Status = IoRegisterDeviceInterface(Pdo, &GUID_DEVINTERFACE_COMPORT, NULL, &SymbolicLinkName);
if (!NT_SUCCESS(Status))
{
DPRINT("Serial: IoRegisterDeviceInterface() failed with status 0x%08x\n", Status);
goto ByeBye;
}
DPRINT1("Serial: IoRegisterDeviceInterface() returned '%wZ'\n", &SymbolicLinkName);
Status = IoSetDeviceInterfaceState(&SymbolicLinkName, TRUE);
if (!NT_SUCCESS(Status))
{
DPRINT("Serial: IoSetDeviceInterfaceState() failed with status 0x%08x\n", Status);
goto ByeBye;
}
RtlFreeUnicodeString(&SymbolicLinkName);
#endif
DeviceExtension->SerialPortNumber = DeviceNumber++;
DeviceExtension->Pdo = Pdo;
DeviceExtension->PnpState = dsStopped;
DeviceExtension->UartType = UartType;
Status = InitializeCircularBuffer(&DeviceExtension->InputBuffer, 16);
if (!NT_SUCCESS(Status)) goto ByeBye;
Status = InitializeCircularBuffer(&DeviceExtension->OutputBuffer, 16);
if (!NT_SUCCESS(Status)) goto ByeBye;
IoInitializeRemoveLock(&DeviceExtension->RemoveLock, SERIAL_TAG, 0, 0);
KeInitializeSpinLock(&DeviceExtension->InputBufferLock);
KeInitializeSpinLock(&DeviceExtension->OutputBufferLock);
KeInitializeDpc(&DeviceExtension->ReceivedByteDpc, SerialReceiveByte, DeviceExtension);
KeInitializeDpc(&DeviceExtension->SendByteDpc, SerialSendByte, DeviceExtension);
//Fdo->Flags |= DO_POWER_PAGEABLE (or DO_POWER_INRUSH?)
Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo, &DeviceExtension->LowerDevice);
if (!NT_SUCCESS(Status))
{
DPRINT("Serial: IoAttachDeviceToDeviceStackSafe() failed with status 0x%08x\n", Status);
goto ByeBye;
}
Fdo->Flags |= DO_BUFFERED_IO;
Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
if (pFdo)
{
*pFdo = Fdo;
}
return STATUS_SUCCESS;
ByeBye:
if (Fdo)
{
FreeCircularBuffer(&DeviceExtension->InputBuffer);
FreeCircularBuffer(&DeviceExtension->OutputBuffer);
IoDeleteDevice(Fdo);
}
return Status;
}
NTSTATUS STDCALL
SerialAddDevice(
IN PDRIVER_OBJECT DriverObject,
IN PDEVICE_OBJECT Pdo)
{
/* Serial.sys is a legacy driver. AddDevice is called once
* with a NULL Pdo just after the driver initialization.
* Detect this case and return success.
*/
if (Pdo == NULL)
return STATUS_SUCCESS;
/* We have here a PDO that does not correspond to a legacy
* serial port. So call the internal AddDevice function.
*/
DPRINT1("Serial: SerialAddDevice() called. Pdo 0x%p (should be NULL)\n", Pdo);
/* FIXME: due to a bug, previously described AddDevice is
* not called with a NULL Pdo. Block this call (blocks
* unfortunately all the other PnP serial ports devices).
*/
//return SerialAddDeviceInternal(DriverObject, Pdo, UartUnknown, NULL);
return STATUS_UNSUCCESSFUL;
}
NTSTATUS STDCALL
SerialPnpStartDevice(
IN PDEVICE_OBJECT DeviceObject,
IN PCM_RESOURCE_LIST ResourceList)
{
PSERIAL_DEVICE_EXTENSION DeviceExtension;
WCHAR DeviceNameBuffer[32];
UNICODE_STRING DeviceName;
WCHAR LinkNameBuffer[32];
UNICODE_STRING LinkName;
WCHAR ComPortBuffer[32];
UNICODE_STRING ComPort;
ULONG Vector = 0;
ULONG i, j;
KIRQL Dirql;
KAFFINITY Affinity = 0;
KINTERRUPT_MODE InterruptMode = Latched;
BOOLEAN ShareInterrupt = TRUE;
OBJECT_ATTRIBUTES objectAttributes;
PUCHAR ComPortBase;
UNICODE_STRING KeyName;
HANDLE hKey;
NTSTATUS Status;
DeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
ASSERT(DeviceExtension->PnpState == dsStopped);
DeviceExtension->ComPort = DeviceExtension->SerialPortNumber + 1;
DeviceExtension->BaudRate = 19200 | SERIAL_BAUD_USER;
DeviceExtension->BaseAddress = 0;
Dirql = 0;
for (i = 0; i < ResourceList->Count; i++)
{
for (j = 0; j < ResourceList->List[i].PartialResourceList.Count; j++)
{
PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor = &ResourceList->List[i].PartialResourceList.PartialDescriptors[j];
switch (PartialDescriptor->Type)
{
case CmResourceTypePort:
if (PartialDescriptor->u.Port.Length < 8)
return STATUS_INSUFFICIENT_RESOURCES;
if (DeviceExtension->BaseAddress != 0)
return STATUS_UNSUCCESSFUL;
DeviceExtension->BaseAddress = PartialDescriptor->u.Port.Start.u.LowPart;
break;
case CmResourceTypeInterrupt:
if (Dirql != 0)
return STATUS_UNSUCCESSFUL;
Dirql = (KIRQL)PartialDescriptor->u.Interrupt.Level;
Vector = PartialDescriptor->u.Interrupt.Vector;
Affinity = PartialDescriptor->u.Interrupt.Affinity;
if (PartialDescriptor->Flags & CM_RESOURCE_INTERRUPT_LATCHED)
InterruptMode = Latched;
else
InterruptMode = LevelSensitive;
ShareInterrupt = (PartialDescriptor->ShareDisposition == CmResourceShareShared);
break;
}
}
}
DPRINT("Serial: New COM port. Base = 0x%lx, Irql = %u\n",
DeviceExtension->BaseAddress, Dirql);
if (!DeviceExtension->BaseAddress)
return STATUS_INSUFFICIENT_RESOURCES;
/* FIXME: we should be able to continue and use polling method
* for read/write if we don't have an interrupt */
if (!Dirql)
return STATUS_INSUFFICIENT_RESOURCES;
ComPortBase = (PUCHAR)DeviceExtension->BaseAddress;
if (DeviceExtension->UartType == UartUnknown)
DeviceExtension->UartType = SerialDetectUartType(ComPortBase);
/* Get current settings */
DeviceExtension->IER = READ_PORT_UCHAR(SER_IER(ComPortBase));
DeviceExtension->MCR = READ_PORT_UCHAR(SER_MCR(ComPortBase));
DeviceExtension->MSR = READ_PORT_UCHAR(SER_MSR(ComPortBase));
DeviceExtension->WaitMask = 0;
/* Set baud rate */
Status = SerialSetBaudRate(DeviceExtension, DeviceExtension->BaudRate);
if (!NT_SUCCESS(Status))
{
DPRINT("Serial: SerialSetBaudRate() failed with status 0x%08x\n", Status);
return Status;
}
/* Set line control */
DeviceExtension->SerialLineControl.StopBits = STOP_BIT_1;
DeviceExtension->SerialLineControl.Parity = NO_PARITY;
DeviceExtension->SerialLineControl.WordLength = 8;
Status = SerialSetLineControl(DeviceExtension, &DeviceExtension->SerialLineControl);
if (!NT_SUCCESS(Status))
{
DPRINT("Serial: SerialSetLineControl() failed with status 0x%08x\n", Status);
return Status;
}
/* Clear receive/transmit buffers */
if (DeviceExtension->UartType >= Uart16550)
{
WRITE_PORT_UCHAR(SER_FCR(ComPortBase),
SR_FCR_CLEAR_RCVR | SR_FCR_CLEAR_XMIT);
}
/* Create link \DosDevices\COMX -> \Device\SerialX */
swprintf(DeviceNameBuffer, L"\\Device\\Serial%lu", DeviceExtension->SerialPortNumber);
swprintf(LinkNameBuffer, L"\\DosDevices\\COM%lu", DeviceExtension->ComPort);
swprintf(ComPortBuffer, L"COM%lu", DeviceExtension->ComPort);
RtlInitUnicodeString(&DeviceName, DeviceNameBuffer);
RtlInitUnicodeString(&LinkName, LinkNameBuffer);
RtlInitUnicodeString(&ComPort, ComPortBuffer);
Status = IoCreateSymbolicLink(&LinkName, &DeviceName);
if (!NT_SUCCESS(Status))
{
DPRINT("Serial: IoCreateSymbolicLink() failed with status 0x%08x\n", Status);
return Status;
}
/* Connect interrupt and enable them */
Status = IoConnectInterrupt(
&DeviceExtension->Interrupt, SerialInterruptService,
DeviceObject, NULL,
Vector, Dirql, Dirql,
InterruptMode, ShareInterrupt,
Affinity, FALSE);
if (!NT_SUCCESS(Status))
{
DPRINT("Serial: IoConnectInterrupt() failed with status 0x%08x\n", Status);
IoDeleteSymbolicLink(&LinkName);
return Status;
}
/* Write an entry value under HKLM\HARDWARE\DeviceMap\SERIALCOMM */
/* This step is not mandatory, so don't exit in case of error */
RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\HARDWARE\\DeviceMap\\SERIALCOMM");
InitializeObjectAttributes(&objectAttributes, &KeyName, OBJ_CASE_INSENSITIVE, NULL, NULL);
Status = ZwCreateKey(&hKey, KEY_SET_VALUE, &objectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL);
if (NT_SUCCESS(Status))
{
/* Key = \Device\Serialx, Value = COMx */
ZwSetValueKey(hKey, &DeviceName, 0, REG_SZ, &ComPortBuffer, ComPort.Length + sizeof(WCHAR));
ZwClose(hKey);
}
DeviceExtension->PnpState = dsStarted;
DeviceExtension->IER |= 0x1f; /* Activate interrupt mode */
DeviceExtension->IER &= ~1; /* FIXME: Disable receive byte interrupt */
WRITE_PORT_UCHAR(SER_IER(ComPortBase), DeviceExtension->IER);
DeviceExtension->MCR |= 0x03; /* Activate DTR, RTS */
WRITE_PORT_UCHAR(SER_MCR(ComPortBase), DeviceExtension->MCR);
return STATUS_SUCCESS;
}
NTSTATUS STDCALL
SerialPnp(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
ULONG MinorFunction;
PIO_STACK_LOCATION Stack;
ULONG Information = 0;
NTSTATUS Status;
Stack = IoGetCurrentIrpStackLocation(Irp);
MinorFunction = Stack->MinorFunction;
switch (MinorFunction)
{
case IRP_MN_START_DEVICE:
{
DPRINT("Serial: IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
/* Call lower driver */
Status = ForwardIrpAndWait(DeviceObject, Irp);
if (NT_SUCCESS(Status))
Status = SerialPnpStartDevice(
DeviceObject,
Stack->Parameters.StartDevice.AllocatedResources);
break;
}
/* IRP_MN_QUERY_STOP_DEVICE (FIXME: required) */
/* IRP_MN_STOP_DEVICE (FIXME: required) */
/* IRP_MN_CANCEL_STOP_DEVICE (FIXME: required) */
/* IRP_MN_QUERY_REMOVE_DEVICE (FIXME: required) */
/* case IRP_MN_REMOVE_DEVICE (FIXME: required) */
/*{
DPRINT("Serial: IRP_MJ_PNP / IRP_MN_REMOVE_DEVICE\n");
IoAcquireRemoveLock
IoReleaseRemoveLockAndWait
pass request to DeviceExtension-LowerDriver
IoDeleteDevice(Fdo) and/or IoDetachDevice
break;
}*/
/* IRP_MN_CANCEL_REMOVE_DEVICE (FIXME: required) */
/* IRP_MN_SURPRISE_REMOVAL (FIXME: required) */
/* IRP_MN_QUERY_CAPABILITIES (optional) */
/* IRP_MN_QUERY_PNP_DEVICE_STATE (optional) */
/* IRP_MN_FILTER_RESOURCE_REQUIREMENTS (optional) */
/* IRP_MN_DEVICE_USAGE_NOTIFICATION (FIXME: required or optional ???) */
/* IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations (optional) */
/* IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations (optional) */
/* IRP_MN_QUERY_INTERFACE (optional) */
default:
{
DPRINT1("Serial: unknown minor function 0x%x\n", MinorFunction);
return ForwardIrpAndForget(DeviceObject, Irp);
}
}
Irp->IoStatus.Information = Information;
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}

View File

@@ -0,0 +1,24 @@
/* $Id:
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/dd/serial/power.c
* PURPOSE: Serial IRP_MJ_POWER operations
*
* PROGRAMMERS: Herv<72> Poussineau (poussine@freesurf.fr)
*/
#define NDEBUG
#include "serial.h"
NTSTATUS STDCALL
SerialPower(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
DPRINT("Serial: IRP_MJ_POWER dispatch\n");
Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_SUCCESS;
}

View File

@@ -0,0 +1,269 @@
/* $Id:
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/dd/serial/create.c
* PURPOSE: Serial IRP_MJ_READ/IRP_MJ_WRITE operations
*
* PROGRAMMERS: Herv<72> Poussineau (poussine@freesurf.fr)
*/
/* FIXME: call IoAcquireRemoveLock/IoReleaseRemoveLock around each I/O operation */
#define NDEBUG
#include "serial.h"
static PVOID
SerialGetUserBuffer(IN PIRP Irp)
{
ASSERT(Irp);
return Irp->AssociatedIrp.SystemBuffer;
}
NTSTATUS STDCALL
SerialRead(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PIO_STACK_LOCATION Stack;
PSERIAL_DEVICE_EXTENSION DeviceExtension;
ULONG Length;
ULONG Information = 0;
PUCHAR Buffer;
PUCHAR ComPortBase;
UCHAR ReceivedByte;
KIRQL Irql;
NTSTATUS Status = STATUS_SUCCESS;
DPRINT("Serial: IRP_MJ_READ\n");
/* FIXME: pend operation if possible */
Stack = IoGetCurrentIrpStackLocation(Irp);
Length = Stack->Parameters.Read.Length;
Buffer = SerialGetUserBuffer(Irp);
DeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
ComPortBase = (PUCHAR)DeviceExtension->BaseAddress;
if (Stack->Parameters.Read.ByteOffset.QuadPart != 0 || Buffer == NULL)
{
Status = STATUS_INVALID_PARAMETER;
goto ByeBye;
}
if (Length == 0)
{
Status = STATUS_SUCCESS;
goto ByeBye;
}
Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort);
if (!NT_SUCCESS(Status))
goto ByeBye;
KeAcquireSpinLock(&DeviceExtension->InputBufferLock, &Irql);
while (Length-- > 0)
{
Status = PopCircularBufferEntry(&DeviceExtension->InputBuffer, &ReceivedByte);
if (!NT_SUCCESS(Status))
break;
DPRINT("Serial: read from buffer 0x%x (%c)\n", ReceivedByte, ReceivedByte);
Buffer[Information++] = ReceivedByte;
}
KeReleaseSpinLock(&DeviceExtension->InputBufferLock, Irql);
if (Length > 0 &&
!(DeviceExtension->SerialTimeOuts.ReadIntervalTimeout == INFINITE &&
DeviceExtension->SerialTimeOuts.ReadTotalTimeoutConstant == 0 &&
DeviceExtension->SerialTimeOuts.ReadTotalTimeoutMultiplier == 0))
{
ULONG IntervalTimeout = 0;
ULONG TotalTimeout = 0;
BOOLEAN UseIntervalTimeout = FALSE;
BOOLEAN UseTotalTimeout = FALSE;
ULONG ThisByteTimeout;
BOOLEAN IsByteReceived;
ULONG i;
/* Extract timeouts informations */
if (DeviceExtension->SerialTimeOuts.ReadIntervalTimeout == INFINITE &&
DeviceExtension->SerialTimeOuts.ReadTotalTimeoutMultiplier == INFINITE &&
DeviceExtension->SerialTimeOuts.ReadTotalTimeoutConstant > 0 &&
DeviceExtension->SerialTimeOuts.ReadTotalTimeoutConstant < INFINITE)
{
if (Information > 0)
{
/* don't read mode bytes */
Length = 0;
}
else
{
/* read only one byte */
UseTotalTimeout = TRUE;
TotalTimeout = DeviceExtension->SerialTimeOuts.ReadTotalTimeoutConstant;
Length = 1;
}
}
else
{
if (DeviceExtension->SerialTimeOuts.ReadIntervalTimeout != 0)
{
UseIntervalTimeout = TRUE;
IntervalTimeout = DeviceExtension->SerialTimeOuts.ReadIntervalTimeout;
}
if (DeviceExtension->SerialTimeOuts.ReadTotalTimeoutConstant != 0 ||
DeviceExtension->SerialTimeOuts.ReadTotalTimeoutMultiplier != 0)
{
UseTotalTimeout = TRUE;
TotalTimeout = DeviceExtension->SerialTimeOuts.ReadTotalTimeoutConstant +
DeviceExtension->SerialTimeOuts.ReadTotalTimeoutMultiplier * Length;
}
}
DPRINT("Serial: UseIntervalTimeout = %ws, IntervalTimeout = %lu\n",
UseIntervalTimeout ? L"YES" : L"NO",
UseIntervalTimeout ? IntervalTimeout : 0);
DPRINT("Serial: UseTotalTimeout = %ws, TotalTimeout = %lu\n",
UseTotalTimeout ? L"YES" : L"NO",
UseTotalTimeout ? TotalTimeout : 0);
/* FIXME: it should be better to use input buffer instead of
* disabling interrupts, and try to directly read for port! */
/* FIXME: NtQueryPerformanceCounter gives a more accurate
* timer, but it is not available on all computers. First try
* NtQueryPerformanceCounter, and current method if it is not
* implemented. */
/* FIXME: remove disabling interrupts */
WRITE_PORT_UCHAR(SER_IER(ComPortBase), DeviceExtension->IER & ~1);
while (Length > 0)
{
ThisByteTimeout = IntervalTimeout;
IsByteReceived = FALSE;
while (TRUE)
{
for (i = 0; i < 1000; i++)
{
#if 1
if ((READ_PORT_UCHAR(SER_LSR(ComPortBase)) & SR_LSR_DR) != 0)
{
ReceivedByte = READ_PORT_UCHAR(ComPortBase);
DPRINT("Serial: received byte 0x%02x (%c)\n", ReceivedByte, ReceivedByte);
IsByteReceived = TRUE;
break;
}
#else
KeAcquireSpinLock(&DeviceExtension->InputBufferLock, &Irql);
if (!IsCircularBufferEmpty(&DeviceExtension->InputBuffer))
{
PopCircularBufferEntry(&DeviceExtension->InputBuffer, &ReceivedByte);
KeReleaseSpinLock(&DeviceExtension->InputBufferLock, Irql);
DPRINT("Serial: reading byte from buffer 0x%02x (%c)\n", ReceivedByte, ReceivedByte);
IsByteReceived = TRUE;
break;
}
KeReleaseSpinLock(&DeviceExtension->InputBufferLock, Irql);
#endif
KeStallExecutionProcessor(1);
}
if (IsByteReceived) break;
if (UseIntervalTimeout)
{
if (ThisByteTimeout == 0) break; else ThisByteTimeout--;
}
if (UseTotalTimeout)
{
if (TotalTimeout == 0) break; else TotalTimeout--;
}
}
if (!IsByteReceived) break;
Buffer[Information++] = ReceivedByte;
Length--;
}
/* FIXME: remove enabling interrupts */
WRITE_PORT_UCHAR(SER_IER(ComPortBase), DeviceExtension->IER);
}
Status = STATUS_SUCCESS;
IoReleaseRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort);
ByeBye:
Irp->IoStatus.Information = Information;
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}
NTSTATUS STDCALL
SerialWrite(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PIO_STACK_LOCATION Stack;
PSERIAL_DEVICE_EXTENSION DeviceExtension;
ULONG Length;
ULONG Information = 0;
PUCHAR Buffer;
PUCHAR ComPortBase;
KIRQL Irql;
NTSTATUS Status = STATUS_SUCCESS;
DPRINT("Serial: IRP_MJ_WRITE\n");
/* FIXME: pend operation if possible */
/* FIXME: use write timeouts */
Stack = IoGetCurrentIrpStackLocation(Irp);
Length = Stack->Parameters.Write.Length;
Buffer = SerialGetUserBuffer(Irp);
DeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
ComPortBase = (PUCHAR)DeviceExtension->BaseAddress;
if (Stack->Parameters.Write.ByteOffset.QuadPart != 0 || Buffer == NULL)
{
Status = STATUS_INVALID_PARAMETER;
goto ByeBye;
}
Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort);
if (!NT_SUCCESS(Status))
goto ByeBye;
KeAcquireSpinLock(&DeviceExtension->OutputBufferLock, &Irql);
if (IsCircularBufferEmpty(&DeviceExtension->OutputBuffer))
{
/* Put the maximum amount of data in UART output buffer */
while (Information < Length)
{
/* if UART output buffer is not full, directly write to it */
if ((READ_PORT_UCHAR(SER_LSR(ComPortBase)) & SR_LSR_TBE) != 0)
{
DPRINT("Serial: direct write 0x%02x (%c)\n", Buffer[Information], Buffer[Information]);
WRITE_PORT_UCHAR(SER_THR(ComPortBase), Buffer[Information]);
DeviceExtension->SerialPerfStats.TransmittedCount++;
Information++;
}
else
break;
}
}
/* write remaining bytes into output buffer */
while (Information < Length)
{
Status = PushCircularBufferEntry(&DeviceExtension->OutputBuffer, Buffer[Information]);
if (!NT_SUCCESS(Status))
{
DPRINT("Serial: buffer overrun on COM%lu\n", DeviceExtension->ComPort);
DeviceExtension->SerialPerfStats.BufferOverrunErrorCount++;
break;
}
DPRINT1("Serial: write to buffer 0x%02x\n", Buffer[Information]);
Information++;
}
KeReleaseSpinLock(&DeviceExtension->OutputBufferLock, Irql);
IoReleaseRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort);
ByeBye:
Irp->IoStatus.Information = Information;
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}

View File

@@ -1,160 +1,47 @@
/* $Id$
*
* Serial driver
* Written by Jason Filby (jasonfilby@yahoo.com)
* For ReactOS (www.reactos.com)
*
/* $Id:
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/dd/serial/serial.c
* PURPOSE: Serial driver loading/unloading
*
* PROGRAMMERS: Herv<72> Poussineau (poussine@freesurf.fr)
*/
/* FIXME: call IoAcquireRemoveLock/IoReleaseRemoveLock around each I/O operation */
#include <ddk/ntddk.h>
//#include <internal/mmhal.h>
//#include "../../../ntoskrnl/include/internal/i386/io.h"
//#include "../../../ntoskrnl/include/internal/io.h"
//#define NDEBUG
#include "serial.h"
#define outb_p(a,p) WRITE_PORT_UCHAR((PUCHAR)a,p)
#define outw_p(a,p) WRITE_PORT_USHORT((PUSHORT)a,p)
#define inb_p(p) READ_PORT_UCHAR((PUCHAR)p)
#define NDEBUG
#include <debug.h>
#define COM1 0x3F8
#define COM2 0x2F8
#define COM3 0x3E8
#define COM4 0x2E8
#define UART_BAUDRATE 96 // 1200 BPS
#define UART_LCRVAL 0x1b // 0x1b for 8e1
#define UARY_FCRVAL 0x7
int uart_detect(unsigned base)
VOID STDCALL
DriverUnload(IN PDRIVER_OBJECT DriverObject)
{
// Returns 0 if no UART detected
outb_p(base+4, 0x10);
if ((inb_p(base+6) & 0xf0)) return 0;
return 1;
};
int irq_setup(unsigned base)
{
// Returns -1 if not found -- otherwise returns interrupt level
char ier, mcr, imrm, imrs, maskm, masks, irqm, irqs;
__asm("cli"); // disable all CPU interrupts
ier = inb_p(base+1); // read IER
outb_p(base+1,0); // disable all UART ints
while (!(inb_p(base+5)&0x20)); // wait for the THR to be empty
mcr = inb_p(base+4); // read MCR
outb_p(base+4,0x0F); // connect UART to irq line
imrm = inb_p(0x21); // read contents of master ICU mask register
imrs = inb_p(0xA1); // read contents of slave ICU mask register
outb_p(0xA0,0x0A); // next read access to 0xA0 reads out IRR
outb_p(0x20,0x0A); // next read access to 0x20 reads out IRR
outb_p(base+1,2); // let's generate interrupts...
maskm = inb_p(0x20); // this clears all bits except for the one
masks = inb_p(0xA0); // that corresponds to the int
outb_p(base+1,0); // drop the int line
maskm &= ~inb_p(0x20); // this clears all bits except for the one
masks &= ~inb_p(0xA0); // that corresponds to the int
outb_p(base+1,2); // and raise it again just to be sure...
maskm &= inb_p(0x20); // this clears all bits except for the one
masks &= inb_p(0xA0); // that corresponds to the int
outb_p(0xA1,~masks); // now let us unmask this interrupt only
outb_p(0x21,~maskm);
outb_p(0xA0,0x0C); // enter polled mode
outb_p(0x20,0x0C); // that order is important with Pentium/PCI systems
irqs = inb_p(0xA0); // and accept the interrupt
irqm = inb_p(0x20);
inb_p(base+2); // reset transmitter interrupt in UART
outb_p(base+4,mcr); // restore old value of MCR
outb_p(base+1,ier); // restore old value of IER
if (masks) outb_p(0xA0,0x20); // send an EOI to slave
if (maskm) outb_p(0x20,0x20); // send an EOI to master
outb_p(0x21,imrm); // restore old mask register contents
outb_p(0xA1,imrs);
__asm("sti");
if (irqs&0x80) // slave interrupt occured
return (irqs&0x07)+8;
if (irqm&0x80) // master interrupt occured
return irqm&0x07;
return -1;
};
void uart_init(unsigned uart_base)
{
// Initialize the UART
outb_p(uart_base+3, 0x80);
outw_p(uart_base, UART_BAUDRATE);
outb_p(uart_base+3, UART_LCRVAL);
outb_p(uart_base+4, 0);
};
unsigned uart_getchar(unsigned uart_base)
{
unsigned x;
x=(inb_p(uart_base+5) & 0x9f) << 8;
if(x & 0x100) x|=((unsigned)inb_p(uart_base)) & 0xff;
return x;
};
void InitializeSerial(void)
{
unsigned comports[4] = { COM1, COM2, COM3, COM4 };
char *comname[4] = { "COM1", "COM2", "COM3", "COM4" };
int i, irq_level;
for (i=0; i<4; i++)
{
if(uart_detect(comports[i])==0)
{
DbgPrint("%s not detected\n", comname[i]);
} else {
uart_init(comports[i]);
irq_level=irq_setup(comports[i]);
if(irq_level==-1)
{
DbgPrint("Warning: IRQ not detected!\n");
} else {
DbgPrint("%s hooked to interrupt level %d\n", comname[i], irq_level);
};
};
};
};
// For testing purposes
void testserial(void)
{
int i=0;
char testc;
union {
unsigned val;
char character;
} x;
DbgPrint("Testing serial input...\n");
while(i==0) {
x.val=uart_getchar(COM1);
// if(!x.val) continue;
// if(x.val & 0x100)
testc=inb_p(COM1);
// DbgPrint("(%x-%c) %c\n", x.val, x.character, testc);
};
};
// nothing to do here yet
}
/*
* Standard DriverEntry method.
*/
NTSTATUS STDCALL
DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
DriverEntry(
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegPath)
{
DbgPrint("Serial Driver 0.0.2\n");
// InitializeSerial();
// testserial();
return(STATUS_SUCCESS);
};
ULONG i;
DriverObject->DriverUnload = DriverUnload;
DriverObject->DriverExtension->AddDevice = SerialAddDevice;
for (i = 0; i < IRP_MJ_MAXIMUM_FUNCTION; i++)
DriverObject->MajorFunction[i] = ForwardIrpAndForget;
DriverObject->MajorFunction[IRP_MJ_CREATE] = SerialCreate;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = SerialClose;
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = SerialCleanup;
DriverObject->MajorFunction[IRP_MJ_READ] = SerialRead;
DriverObject->MajorFunction[IRP_MJ_WRITE] = SerialWrite;
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = SerialDeviceControl;
DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = SerialQueryInformation;
DriverObject->MajorFunction[IRP_MJ_PNP] = SerialPnp;
DriverObject->MajorFunction[IRP_MJ_POWER] = SerialPower;
return DetectLegacyDevices(DriverObject);
}

View File

@@ -0,0 +1,318 @@
#if defined(__GNUC__)
#include <ddk/ntddk.h>
#include <ddk/ntddser.h>
#include <stdio.h>
#include <debug.h>
/* FIXME: these prototypes MUST NOT be here! */
NTSTATUS STDCALL
IoAttachDeviceToDeviceStackSafe(
IN PDEVICE_OBJECT SourceDevice,
IN PDEVICE_OBJECT TargetDevice,
OUT PDEVICE_OBJECT *AttachedToDeviceObject);
#elif defined(_MSC_VER)
#include <ntddk.h>
#include <ntddser.h>
#include <stdio.h>
#define STDCALL
#define DPRINT1 DbgPrint("(%s:%d) ", __FILE__, __LINE__), DbgPrint
#define CHECKPOINT1 DbgPrint("(%s:%d)\n")
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
NTSTATUS STDCALL
IoAttachDeviceToDeviceStackSafe(
IN PDEVICE_OBJECT SourceDevice,
IN PDEVICE_OBJECT TargetDevice,
OUT PDEVICE_OBJECT *AttachedToDeviceObject);
#ifdef NDEBUG2
#define DPRINT
#define CHECKPOINT
#else
#define DPRINT DPRINT1
#define CHECKPOINT CHECKPOINT1
#undef NDEBUG
#endif
#else
#error Unknown compiler!
#endif
typedef enum
{
dsStopped,
dsStarted,
dsPaused,
dsRemoved,
dsSurpriseRemoved
} SERIAL_DEVICE_STATE;
typedef enum
{
UartUnknown,
Uart8250,
Uart16450,
Uart16550,
Uart16550A
} UART_TYPE;
typedef struct _CIRCULAR_BUFFER
{
PUCHAR Buffer;
ULONG Length;
ULONG ReadPosition;
ULONG WritePosition;
} CIRCULAR_BUFFER, *PCIRCULAR_BUFFER;
typedef struct _SERIAL_DEVICE_EXTENSION
{
PDEVICE_OBJECT Pdo;
PDEVICE_OBJECT LowerDevice;
SERIAL_DEVICE_STATE PnpState;
IO_REMOVE_LOCK RemoveLock;
ULONG SerialPortNumber;
ULONG ComPort;
ULONG BaudRate;
ULONG BaseAddress;
PKINTERRUPT Interrupt;
KDPC ReceivedByteDpc;
KDPC SendByteDpc;
SERIAL_LINE_CONTROL SerialLineControl;
UART_TYPE UartType;
ULONG WaitMask;
SERIALPERF_STATS SerialPerfStats;
SERIAL_TIMEOUTS SerialTimeOuts;
BOOLEAN IsOpened;
CIRCULAR_BUFFER InputBuffer;
KSPIN_LOCK InputBufferLock;
CIRCULAR_BUFFER OutputBuffer;
KSPIN_LOCK OutputBufferLock;
/* Current values */
UCHAR IER; /* Base+1, Interrupt Enable Register */
UCHAR MCR; /* Base+4, Modem Control Register */
UCHAR MSR; /* Base+6, Modem Status Register */
} SERIAL_DEVICE_EXTENSION, *PSERIAL_DEVICE_EXTENSION;
#define SERIAL_TAG TAG('S', 'e', 'r', 'l')
#define INFINITE ((ULONG)-1)
/* Baud master clock */
#define BAUD_CLOCK 1843200
#define CLOCKS_PER_BIT 16
/* UART registers and bits */
#define SER_RBR(x) ((x)+0)
#define SER_THR(x) ((x)+0)
#define SER_DLL(x) ((x)+0)
#define SER_IER(x) ((x)+1)
#define SER_DLM(x) ((x)+1)
#define SER_IIR(x) ((x)+2)
#define SR_IIR_SELF 0x00
#define SR_IIR_ID_MASK 0x07
#define SR_IIR_MSR_CHANGE SR_IIR_SELF
#define SR_IIR_THR_EMPTY (SR_IIR_SELF | 2)
#define SR_IIR_DATA_RECEIVED (SR_IIR_SELF | 4)
#define SR_IIR_ERROR (SR_IIR_SELF | 6)
#define SER_FCR(x) ((x)+2)
#define SR_FCR_ENABLE_FIFO 0x01
#define SR_FCR_CLEAR_RCVR (0x02 | SR_FCR_ENABLE_FIFO)
#define SR_FCR_CLEAR_XMIT (0x04 | SR_FCR_ENABLE_FIFO)
#define SR_FCR_1_BYTE (0x00 | SR_FCR_ENABLE_FIFO)
#define SR_FCR_4_BYTES (0x40 | SR_FCR_ENABLE_FIFO)
#define SR_FCR_8_BYTES (0x80 | SR_FCR_ENABLE_FIFO)
#define SR_FCR_14_BYTES (0xC0 | SR_FCR_ENABLE_FIFO)
#define SER_LCR(x) ((x)+3)
#define SR_LCR_CS5 0x00
#define SR_LCR_CS6 0x01
#define SR_LCR_CS7 0x02
#define SR_LCR_CS8 0x03
#define SR_LCR_ST1 0x00
#define SR_LCR_ST2 0x04
#define SR_LCR_PNO 0x00
#define SR_LCR_POD 0x08
#define SR_LCR_PEV 0x18
#define SR_LCR_PMK 0x28
#define SR_LCR_PSP 0x38
#define SR_LCR_BRK 0x40
#define SR_LCR_DLAB 0x80
#define SER_MCR(x) ((x)+4)
#define SR_MCR_DTR 0x01
#define SR_MCR_RTS 0x02
#define SER_LSR(x) ((x)+5)
#define SR_LSR_DR 0x01
#define SR_LSR_TBE 0x20
#define SER_MSR(x) ((x)+6)
#define SR_MSR_CTS 0x10
#define SR_MSR_DSR 0x20
#define SER_SCR(x) ((x)+7)
/************************************ circularbuffer.c */
/* FIXME: transform these functions into #define? */
NTSTATUS
InitializeCircularBuffer(
IN PCIRCULAR_BUFFER pBuffer,
IN ULONG BufferSize);
NTSTATUS
FreeCircularBuffer(
IN PCIRCULAR_BUFFER pBuffer);
BOOLEAN
IsCircularBufferEmpty(
IN PCIRCULAR_BUFFER pBuffer);
NTSTATUS
PushCircularBufferEntry(
IN PCIRCULAR_BUFFER pBuffer,
IN UCHAR Entry);
NTSTATUS
PopCircularBufferEntry(
IN PCIRCULAR_BUFFER pBuffer,
OUT PUCHAR Entry);
NTSTATUS
IncreaseCircularBufferSize(
IN PCIRCULAR_BUFFER pBuffer,
IN ULONG NewBufferSize);
/************************************ cleanup.c */
NTSTATUS STDCALL
SerialCleanup(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
/************************************ close.c */
NTSTATUS STDCALL
SerialClose(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
/************************************ create.c */
NTSTATUS STDCALL
SerialCreate(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
/************************************ devctrl.c */
NTSTATUS STDCALL
SerialDeviceControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
NTSTATUS STDCALL
SerialSetBaudRate(
IN PSERIAL_DEVICE_EXTENSION DeviceExtension,
IN ULONG NewBaudRate);
NTSTATUS STDCALL
SerialSetLineControl(
IN PSERIAL_DEVICE_EXTENSION DeviceExtension,
IN PSERIAL_LINE_CONTROL NewSettings);
/************************************ info.c */
NTSTATUS STDCALL
SerialQueryInformation(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
/************************************ legacy.c */
UART_TYPE
SerialDetectUartType(
IN PUCHAR ComPortBase);
NTSTATUS
DetectLegacyDevices(
IN PDRIVER_OBJECT DriverObject);
/************************************ misc.c */
NTSTATUS
ForwardIrpAndWait(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
NTSTATUS STDCALL
ForwardIrpAndForget(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
VOID STDCALL
SerialReceiveByte(
IN PKDPC Dpc,
IN PVOID pDeviceExtension, // real type PSERIAL_DEVICE_EXTENSION
IN PVOID pByte, // real type UCHAR
IN PVOID Unused);
VOID STDCALL
SerialSendByte(
IN PKDPC Dpc,
IN PVOID pDeviceExtension, // real type PSERIAL_DEVICE_EXTENSION
IN PVOID Unused1,
IN PVOID Unused2);
BOOLEAN STDCALL
SerialInterruptService(
IN PKINTERRUPT Interrupt,
IN OUT PVOID ServiceContext);
/************************************ pnp.c */
NTSTATUS STDCALL
SerialAddDeviceInternal(
IN PDRIVER_OBJECT DriverObject,
IN PDEVICE_OBJECT Pdo,
IN UART_TYPE UartType,
OUT PDEVICE_OBJECT* pFdo OPTIONAL);
NTSTATUS STDCALL
SerialAddDevice(
IN PDRIVER_OBJECT DriverObject,
IN PDEVICE_OBJECT Pdo);
NTSTATUS STDCALL
SerialPnpStartDevice(
IN PDEVICE_OBJECT DeviceObject,
IN PCM_RESOURCE_LIST ResourceList);
NTSTATUS STDCALL
SerialPnp(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
/************************************ power.c */
NTSTATUS STDCALL
SerialPower(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
/************************************ rw.c */
NTSTATUS STDCALL
SerialRead(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
NTSTATUS STDCALL
SerialWrite(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);

View File

@@ -49,6 +49,7 @@ NpfsFindListeningServerInstance(PNPFS_PIPE Pipe)
{
PLIST_ENTRY CurrentEntry;
PNPFS_WAITER_ENTRY Waiter;
KIRQL oldIrql;
CurrentEntry = Pipe->WaiterListHead.Flink;
while (CurrentEntry != &Pipe->WaiterListHead)
@@ -58,11 +59,15 @@ NpfsFindListeningServerInstance(PNPFS_PIPE Pipe)
!Waiter->Irp->Cancel)
{
DPRINT("Server found! Fcb %p\n", Waiter->Fcb);
if (IoSetCancelRoutine(Waiter->Irp, NULL) != NULL)
{
IoAcquireCancelSpinLock(&oldIrql);
if (!Waiter->Irp->Cancel)
{
IoSetCancelRoutine(Waiter->Irp, NULL);
IoReleaseCancelSpinLock(oldIrql);
return Waiter->Fcb;
}
IoReleaseCancelSpinLock(oldIrql);
}
CurrentEntry = CurrentEntry->Flink;
@@ -87,9 +92,8 @@ NpfsSignalAndRemoveListeningServerInstance(PNPFS_PIPE Pipe,
{
DPRINT("Server found! Fcb %p\n", Waiter->Fcb);
KeSetEvent(Waiter->Irp->UserEvent, 0, FALSE);
Waiter->Irp->UserIosb->Status = FILE_PIPE_CONNECTED_STATE;
Waiter->Irp->UserIosb->Information = 0;
Waiter->Irp->IoStatus.Status = STATUS_PIPE_CONNECTED;
Waiter->Irp->IoStatus.Information = 0;
IoCompleteRequest(Waiter->Irp, IO_NO_INCREMENT);
RemoveEntryList(&Waiter->Entry);
@@ -175,7 +179,7 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
/* Initialize data list. */
if (Pipe->OutboundQuota)
{
ClientFcb->Data = ExAllocatePool(NonPagedPool, Pipe->OutboundQuota);
ClientFcb->Data = ExAllocatePool(PagedPool, Pipe->OutboundQuota);
if (ClientFcb->Data == NULL)
{
DPRINT("No memory!\n");
@@ -196,7 +200,7 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
ClientFcb->ReadDataAvailable = 0;
ClientFcb->WriteQuotaAvailable = Pipe->OutboundQuota;
ClientFcb->MaxDataLength = Pipe->OutboundQuota;
KeInitializeSpinLock(&ClientFcb->DataListLock);
ExInitializeFastMutex(&ClientFcb->DataListLock);
KeInitializeEvent(&ClientFcb->ConnectEvent, SynchronizationEvent, FALSE);
KeInitializeEvent(&ClientFcb->Event, SynchronizationEvent, FALSE);
@@ -456,13 +460,16 @@ NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject,
if (Pipe->InboundQuota)
{
Fcb->Data = ExAllocatePool(NonPagedPool, Pipe->InboundQuota);
Fcb->Data = ExAllocatePool(PagedPool, Pipe->InboundQuota);
if (Fcb->Data == NULL)
{
ExFreePool(Fcb);
if (NewPipe)
{
KeLockMutex(&DeviceExt->PipeListLock);
RemoveEntryList(&Pipe->PipeListEntry);
KeUnlockMutex(&DeviceExt->PipeListLock);
RtlFreeUnicodeString(&Pipe->PipeName);
ExFreePool(Pipe);
}
@@ -482,14 +489,10 @@ NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject,
Fcb->ReadDataAvailable = 0;
Fcb->WriteQuotaAvailable = Pipe->InboundQuota;
Fcb->MaxDataLength = Pipe->InboundQuota;
KeInitializeSpinLock(&Fcb->DataListLock);
ExInitializeFastMutex(&Fcb->DataListLock);
Pipe->CurrentInstances++;
KeLockMutex(&Pipe->FcbListLock);
InsertTailList(&Pipe->ServerFcbListHead, &Fcb->FcbListEntry);
KeUnlockMutex(&Pipe->FcbListLock);
Fcb->Pipe = Pipe;
Fcb->PipeEnd = FILE_PIPE_SERVER_END;
Fcb->PipeState = FILE_PIPE_LISTENING_STATE;
@@ -503,6 +506,10 @@ NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject,
SynchronizationEvent,
FALSE);
KeLockMutex(&Pipe->FcbListLock);
InsertTailList(&Pipe->ServerFcbListHead, &Fcb->FcbListEntry);
KeUnlockMutex(&Pipe->FcbListLock);
FileObject->FsContext = Fcb;
Irp->IoStatus.Status = STATUS_SUCCESS;
@@ -514,6 +521,125 @@ NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject,
}
NTSTATUS STDCALL
NpfsCleanup(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
PNPFS_DEVICE_EXTENSION DeviceExt;
PIO_STACK_LOCATION IoStack;
PFILE_OBJECT FileObject;
PNPFS_FCB Fcb;
PNPFS_PIPE Pipe;
BOOL Server;
DPRINT("NpfsCleanup(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
IoStack = IoGetCurrentIrpStackLocation(Irp);
DeviceExt = (PNPFS_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
FileObject = IoStack->FileObject;
Fcb = FileObject->FsContext;
if (Fcb == NULL)
{
DPRINT("Success!\n");
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_SUCCESS;
}
DPRINT("Fcb %x\n", Fcb);
Pipe = Fcb->Pipe;
DPRINT("Cleaning pipe %wZ\n", &Pipe->PipeName);
KeLockMutex(&Pipe->FcbListLock);
Server = (Fcb->PipeEnd == FILE_PIPE_SERVER_END);
if (Server)
{
/* FIXME: Clean up existing connections here ?? */
DPRINT("Server\n");
}
else
{
DPRINT("Client\n");
}
if (Fcb->PipeState == FILE_PIPE_CONNECTED_STATE)
{
if (Fcb->OtherSide)
{
Fcb->OtherSide->PipeState = FILE_PIPE_DISCONNECTED_STATE;
Fcb->OtherSide->OtherSide = NULL;
/*
* Signaling the write event. If is possible that an other
* thread waits for an empty buffer.
*/
KeSetEvent(&Fcb->OtherSide->Event, IO_NO_INCREMENT, FALSE);
}
}
else if (Fcb->PipeState == FILE_PIPE_LISTENING_STATE)
{
PLIST_ENTRY Entry;
PNPFS_WAITER_ENTRY WaitEntry = NULL;
BOOLEAN Complete = FALSE;
KIRQL oldIrql;
Entry = Fcb->Pipe->WaiterListHead.Flink;
while (Entry != &Fcb->Pipe->WaiterListHead)
{
WaitEntry = CONTAINING_RECORD(Entry, NPFS_WAITER_ENTRY, Entry);
if (WaitEntry->Fcb == Fcb)
{
RemoveEntryList(Entry);
IoAcquireCancelSpinLock(&oldIrql);
if (!Irp->Cancel)
{
IoSetCancelRoutine(WaitEntry->Irp, NULL);
Complete = TRUE;
}
IoReleaseCancelSpinLock(oldIrql);
break;
}
Entry = Entry->Flink;
}
if (Entry != &Fcb->Pipe->WaiterListHead)
{
if (Complete)
{
WaitEntry->Irp->IoStatus.Status = STATUS_PIPE_BROKEN;
WaitEntry->Irp->IoStatus.Information = 0;
IoCompleteRequest(WaitEntry->Irp, IO_NO_INCREMENT);
}
ExFreePool(WaitEntry);
}
}
Fcb->PipeState = FILE_PIPE_CLOSING_STATE;
KeUnlockMutex(&Pipe->FcbListLock);
ExAcquireFastMutex(&Fcb->DataListLock);
if (Fcb->Data)
{
ExFreePool(Fcb->Data);
Fcb->Data = NULL;
Fcb->ReadPtr = NULL;
Fcb->WritePtr = NULL;
}
ExReleaseFastMutex(&Fcb->DataListLock);
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
DPRINT("Success!\n");
return STATUS_SUCCESS;
}
NTSTATUS STDCALL
NpfsClose(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
@@ -552,7 +678,6 @@ NpfsClose(PDEVICE_OBJECT DeviceObject,
if (Server)
{
/* FIXME: Clean up existing connections here ?? */
DPRINT("Server\n");
Pipe->CurrentInstances--;
}
@@ -561,27 +686,12 @@ NpfsClose(PDEVICE_OBJECT DeviceObject,
DPRINT("Client\n");
}
if (Fcb->PipeState == FILE_PIPE_CONNECTED_STATE)
{
if (Fcb->OtherSide)
{
Fcb->OtherSide->PipeState = FILE_PIPE_CLOSING_STATE;
Fcb->OtherSide->OtherSide = NULL;
/*
* Signaling the write event. If is possible that an other
* thread waits for an empty buffer.
*/
KeSetEvent(&Fcb->OtherSide->Event, IO_NO_INCREMENT, FALSE);
}
Fcb->PipeState = 0;
}
ASSERT (Fcb->PipeState == FILE_PIPE_CLOSING_STATE);
FileObject->FsContext = NULL;
RemoveEntryList(&Fcb->FcbListEntry);
if (Fcb->Data)
ExFreePool(Fcb->Data);
ExFreePool(Fcb);
KeUnlockMutex(&Pipe->FcbListLock);

View File

@@ -18,7 +18,7 @@
/* FUNCTIONS *****************************************************************/
static VOID
static VOID STDCALL
NpfsListeningCancelRoutine(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
@@ -46,6 +46,7 @@ NpfsAddListeningServerInstance(PIRP Irp,
PNPFS_FCB Fcb)
{
PNPFS_WAITER_ENTRY Entry;
KIRQL oldIrql;
Entry = ExAllocatePool(NonPagedPool, sizeof(NPFS_WAITER_ENTRY));
if (Entry == NULL)
@@ -61,13 +62,15 @@ NpfsAddListeningServerInstance(PIRP Irp,
Irp->Tail.Overlay.DriverContext[0] = Entry;
InsertTailList(&Fcb->Pipe->WaiterListHead, &Entry->Entry);
IoSetCancelRoutine(Irp, NpfsListeningCancelRoutine);
IoAcquireCancelSpinLock(&oldIrql);
if (!Irp->Cancel)
{
IoSetCancelRoutine(Irp, NpfsListeningCancelRoutine);
IoReleaseCancelSpinLock(oldIrql);
KeUnlockMutex(&Fcb->Pipe->FcbListLock);
return STATUS_PENDING;
}
IoReleaseCancelSpinLock(oldIrql);
RemoveEntryList(&Entry->Entry);

View File

@@ -40,7 +40,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
NpfsSetInformation;
DriverObject->MajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] =
NpfsQueryVolumeInformation;
// DriverObject->MajorFunction[IRP_MJ_CLEANUP] = NpfsCleanup;
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = NpfsCleanup;
DriverObject->MajorFunction[IRP_MJ_FLUSH_BUFFERS] = NpfsFlushBuffers;
// DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] =
// NpfsDirectoryControl;
@@ -73,8 +73,10 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
/* initialize the device extension */
DeviceExtension = DeviceObject->DeviceExtension;
InitializeListHead(&DeviceExtension->PipeListHead);
InitializeListHead(&DeviceExtension->ThreadListHead);
KeInitializeMutex(&DeviceExtension->PipeListLock,
0);
DeviceExtension->EmptyWaiterCount = 0;
/* set the size quotas */
DeviceExtension->MinQuota = PAGE_SIZE;

View File

@@ -6,7 +6,9 @@
typedef struct _NPFS_DEVICE_EXTENSION
{
LIST_ENTRY PipeListHead;
LIST_ENTRY ThreadListHead;
KMUTEX PipeListLock;
ULONG EmptyWaiterCount;
ULONG MinQuota;
ULONG DefaultQuota;
ULONG MaxQuota;
@@ -20,6 +22,7 @@ typedef struct _NPFS_PIPE
LIST_ENTRY ServerFcbListHead;
LIST_ENTRY ClientFcbListHead;
LIST_ENTRY WaiterListHead;
LIST_ENTRY EmptyBufferListHead;
ULONG PipeType;
ULONG ReadMode;
ULONG WriteMode;
@@ -50,9 +53,29 @@ typedef struct _NPFS_FCB
PVOID WritePtr;
ULONG MaxDataLength;
KSPIN_LOCK DataListLock; /* Data queue lock */
FAST_MUTEX DataListLock; /* Data queue lock */
} NPFS_FCB, *PNPFS_FCB;
typedef struct _NPFS_CONTEXT
{
PDEVICE_OBJECT DeviceObject;
PIRP Irp;
PNPFS_FCB Fcb;
UCHAR MajorFunction;
BOOLEAN AllocatedFromPool;
} NPFS_CONTEXT, *PNPFS_CONTEXT;
typedef struct _NPFS_THREAD_CONTEXT
{
ULONG Count;
KEVENT Event;
PNPFS_DEVICE_EXTENSION DeviceExt;
LIST_ENTRY ListEntry;
PVOID WaitObjectArray[MAXIMUM_WAIT_OBJECTS];
KWAIT_BLOCK WaitBlockArray[MAXIMUM_WAIT_OBJECTS];
PNPFS_CONTEXT WaitContextArray[MAXIMUM_WAIT_OBJECTS];
} NPFS_THREAD_CONTEXT, *PNPFS_THREAD_CONTEXT;
typedef struct _NPFS_WAITER_ENTRY
{
LIST_ENTRY Entry;
@@ -76,6 +99,7 @@ extern NPAGED_LOOKASIDE_LIST NpfsPipeDataLookasideList;
NTSTATUS STDCALL NpfsCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS STDCALL NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS STDCALL NpfsCleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS STDCALL NpfsClose(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS STDCALL NpfsRead(PDEVICE_OBJECT DeviceObject, PIRP Irp);

View File

@@ -46,16 +46,197 @@ VOID HexDump(PUCHAR Buffer, ULONG Length)
}
#endif
static NTSTATUS
NpfsReadFromPipe(PNPFS_CONTEXT Context);
NTSTATUS STDCALL
NpfsRead(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
static VOID STDCALL
NpfsWaitingCancelRoutine(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PNPFS_CONTEXT Context;
PNPFS_DEVICE_EXTENSION DeviceExt;
DPRINT1("NpfsWaitingCancelRoutine() called\n");
IoReleaseCancelSpinLock(Irp->CancelIrql);
Context = Irp->Tail.Overlay.DriverContext[0];
DeviceExt = Context->DeviceObject->DeviceExtension;
KeLockMutex(&DeviceExt->PipeListLock);
KeSetEvent(&Context->Fcb->Event, IO_NO_INCREMENT, FALSE);
KeUnlockMutex(&DeviceExt->PipeListLock);
}
static VOID STDCALL
NpfsWaiterThread(PVOID Context)
{
PNPFS_THREAD_CONTEXT ThreadContext = (PNPFS_THREAD_CONTEXT) Context;
ULONG CurrentCount, Count = 0;
PNPFS_CONTEXT WaitContext = NULL;
NTSTATUS Status;
BOOLEAN Terminate = FALSE;
BOOLEAN Cancel = FALSE;
KIRQL oldIrql;
KeLockMutex(&ThreadContext->DeviceExt->PipeListLock);
while (1)
{
CurrentCount = ThreadContext->Count;
KeResetEvent(&ThreadContext->Event);
KeUnlockMutex(&ThreadContext->DeviceExt->PipeListLock);
if (WaitContext)
{
if (Cancel)
{
WaitContext->Irp->IoStatus.Status = STATUS_CANCELLED;
WaitContext->Irp->IoStatus.Information = 0;
IoCompleteRequest(WaitContext->Irp, IO_NO_INCREMENT);
ExFreePool(WaitContext);
}
else
{
switch (WaitContext->MajorFunction)
{
case IRP_MJ_READ:
NpfsReadFromPipe(WaitContext);
break;
default:
KEBUGCHECK(0);
}
}
}
if (Terminate)
{
break;
}
Status = KeWaitForMultipleObjects(CurrentCount,
ThreadContext->WaitObjectArray,
WaitAny,
Executive,
KernelMode,
FALSE,
NULL,
ThreadContext->WaitBlockArray);
KeLockMutex(&ThreadContext->DeviceExt->PipeListLock);
if (!NT_SUCCESS(Status))
{
KEBUGCHECK(0);
}
Count = Status - STATUS_SUCCESS;
ASSERT (Count <= CurrentCount);
if (Count > 0)
{
WaitContext = ThreadContext->WaitContextArray[Count];
ThreadContext->Count--;
ThreadContext->DeviceExt->EmptyWaiterCount++;
ThreadContext->WaitObjectArray[Count] = ThreadContext->WaitObjectArray[ThreadContext->Count];
ThreadContext->WaitContextArray[Count] = ThreadContext->WaitContextArray[ThreadContext->Count];
IoAcquireCancelSpinLock(&oldIrql);
Cancel = NULL == IoSetCancelRoutine(WaitContext->Irp, NULL);
IoReleaseCancelSpinLock(oldIrql);
}
else
{
/* someone has add a new wait request */
WaitContext = NULL;
}
if (ThreadContext->Count == 1 && ThreadContext->DeviceExt->EmptyWaiterCount >= MAXIMUM_WAIT_OBJECTS)
{
/* it exist an other thread with empty wait slots, we can remove our thread from the list */
RemoveEntryList(&ThreadContext->ListEntry);
ThreadContext->DeviceExt->EmptyWaiterCount -= MAXIMUM_WAIT_OBJECTS - 1;
Terminate = TRUE;
}
}
KeUnlockMutex(&ThreadContext->DeviceExt->PipeListLock);
ExFreePool(ThreadContext);
}
static NTSTATUS
NpfsAddWaitingReader(PNPFS_DEVICE_EXTENSION DeviceExt, PNPFS_CONTEXT Context, PNPFS_FCB Fcb)
{
PLIST_ENTRY ListEntry;
PNPFS_THREAD_CONTEXT ThreadContext;
NTSTATUS Status;
HANDLE hThread;
KIRQL oldIrql;
KeLockMutex(&DeviceExt->PipeListLock);
ListEntry = DeviceExt->ThreadListHead.Flink;
while (ListEntry != &DeviceExt->ThreadListHead)
{
ThreadContext = CONTAINING_RECORD(ListEntry, NPFS_THREAD_CONTEXT, ListEntry);
if (ThreadContext->Count < MAXIMUM_WAIT_OBJECTS)
{
break;
}
ListEntry = ListEntry->Flink;
}
if (ListEntry == &DeviceExt->ThreadListHead)
{
ThreadContext = ExAllocatePool(NonPagedPool, sizeof(NPFS_THREAD_CONTEXT));
if (ThreadContext == NULL)
{
KeUnlockMutex(&DeviceExt->PipeListLock);
return STATUS_NO_MEMORY;
}
ThreadContext->DeviceExt = DeviceExt;
KeInitializeEvent(&ThreadContext->Event, NotificationEvent, FALSE);
ThreadContext->Count = 1;
ThreadContext->WaitObjectArray[0] = &ThreadContext->Event;
DPRINT("Creating a new system thread for waiting read requests\n");
Status = PsCreateSystemThread(&hThread,
THREAD_ALL_ACCESS,
NULL,
NULL,
NULL,
NpfsWaiterThread,
(PVOID)ThreadContext);
if (!NT_SUCCESS(Status))
{
ExFreePool(ThreadContext);
KeUnlockMutex(&DeviceExt->PipeListLock);
return Status;
}
InsertHeadList(&DeviceExt->ThreadListHead, &ThreadContext->ListEntry);
DeviceExt->EmptyWaiterCount += MAXIMUM_WAIT_OBJECTS - 1;
}
IoMarkIrpPending(Context->Irp);
Context->Irp->Tail.Overlay.DriverContext[0] = Context;
IoAcquireCancelSpinLock(&oldIrql);
if (Context->Irp->Cancel)
{
IoReleaseCancelSpinLock(oldIrql);
Status = STATUS_CANCELLED;
}
else
{
IoSetCancelRoutine(Context->Irp, NpfsWaitingCancelRoutine);
IoReleaseCancelSpinLock(oldIrql);
ThreadContext->WaitObjectArray[ThreadContext->Count] = &Fcb->Event;
ThreadContext->WaitContextArray[ThreadContext->Count] = Context;
ThreadContext->Count++;
DeviceExt->EmptyWaiterCount--;
KeSetEvent(&ThreadContext->Event, IO_NO_INCREMENT, FALSE);
Status = STATUS_SUCCESS;
}
KeUnlockMutex(&DeviceExt->PipeListLock);
return Status;
}
static NTSTATUS
NpfsReadFromPipe(PNPFS_CONTEXT Context)
{
PIO_STACK_LOCATION IoStack;
PFILE_OBJECT FileObject;
NTSTATUS Status;
PNPFS_DEVICE_EXTENSION DeviceExt;
KIRQL OldIrql;
ULONG Information;
PNPFS_FCB Fcb;
PNPFS_FCB WriterFcb;
@@ -65,23 +246,14 @@ NpfsRead(PDEVICE_OBJECT DeviceObject,
ULONG CopyLength;
ULONG TempLength;
DPRINT("NpfsRead(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
DPRINT("NpfsReadFromPipe(Context %p)\n", Context);
DeviceExt = (PNPFS_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
IoStack = IoGetCurrentIrpStackLocation(Irp);
IoStack = IoGetCurrentIrpStackLocation(Context->Irp);
FileObject = IoStack->FileObject;
Fcb = FileObject->FsContext;
Pipe = Fcb->Pipe;
WriterFcb = Fcb->OtherSide;
if (Irp->MdlAddress == NULL)
{
DPRINT("Irp->MdlAddress == NULL\n");
Status = STATUS_UNSUCCESSFUL;
Information = 0;
goto done;
}
if (Fcb->Data == NULL)
{
DPRINT("Pipe is NOT readable!\n");
@@ -94,18 +266,17 @@ NpfsRead(PDEVICE_OBJECT DeviceObject,
Length = IoStack->Parameters.Read.Length;
Information = 0;
Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
KeAcquireSpinLock(&Fcb->DataListLock, &OldIrql);
Buffer = MmGetSystemAddressForMdl(Context->Irp->MdlAddress);
ExAcquireFastMutex(&Fcb->DataListLock);
while (1)
{
/* FIXME: check if in blocking mode */
if (Fcb->ReadDataAvailable == 0)
{
if (Fcb->PipeState == FILE_PIPE_CONNECTED_STATE)
{
KeSetEvent(&WriterFcb->Event, IO_NO_INCREMENT, FALSE);
}
KeReleaseSpinLock(&Fcb->DataListLock, OldIrql);
ExReleaseFastMutex(&Fcb->DataListLock);
if (Information > 0)
{
Status = STATUS_SUCCESS;
@@ -119,16 +290,46 @@ NpfsRead(PDEVICE_OBJECT DeviceObject,
goto done;
}
/* Wait for ReadEvent to become signaled */
DPRINT("Waiting for readable data (%S)\n", Pipe->PipeName.Buffer);
Status = KeWaitForSingleObject(&Fcb->Event,
UserRequest,
KernelMode,
FALSE,
NULL);
DPRINT("Finished waiting (%S)! Status: %x\n", Pipe->PipeName.Buffer, Status);
if (IoIsOperationSynchronous(Context->Irp))
{
/* Wait for ReadEvent to become signaled */
DPRINT("Waiting for readable data (%S)\n", Pipe->PipeName.Buffer);
Status = KeWaitForSingleObject(&Fcb->Event,
UserRequest,
KernelMode,
FALSE,
NULL);
DPRINT("Finished waiting (%S)! Status: %x\n", Pipe->PipeName.Buffer, Status);
}
else
{
PNPFS_CONTEXT NewContext;
KeAcquireSpinLock(&Fcb->DataListLock, &OldIrql);
NewContext = ExAllocatePool(NonPagedPool, sizeof(NPFS_CONTEXT));
if (NewContext == NULL)
{
Status = STATUS_NO_MEMORY;
goto done;
}
memcpy(NewContext, Context, sizeof(NPFS_CONTEXT));
NewContext->AllocatedFromPool = TRUE;
NewContext->Fcb = Fcb;
NewContext->MajorFunction = IRP_MJ_READ;
Status = NpfsAddWaitingReader(Context->DeviceObject->DeviceExtension, NewContext, Fcb);
if (NT_SUCCESS(Status))
{
Status = STATUS_PENDING;
}
else
{
ExFreePool(NewContext);
}
goto done;
}
ExAcquireFastMutex(&Fcb->DataListLock);
}
if (Pipe->ReadMode == FILE_PIPE_BYTE_STREAM_MODE)
@@ -217,19 +418,47 @@ NpfsRead(PDEVICE_OBJECT DeviceObject,
}
}
KeReleaseSpinLock(&Fcb->DataListLock, OldIrql);
ExReleaseFastMutex(&Fcb->DataListLock);
done:
Irp->IoStatus.Status = Status;
Irp->IoStatus.Information = Information;
Context->Irp->IoStatus.Status = Status;
Context->Irp->IoStatus.Information = Information;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
if (Status != STATUS_PENDING)
{
IoCompleteRequest(Context->Irp, IO_NO_INCREMENT);
}
if (Context->AllocatedFromPool)
{
ExFreePool(Context);
}
DPRINT("NpfsRead done (Status %lx)\n", Status);
return Status;
}
NTSTATUS STDCALL
NpfsRead(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
NPFS_CONTEXT Context;
Context.AllocatedFromPool = FALSE;
Context.DeviceObject = DeviceObject;
Context.Irp = Irp;
if (Irp->MdlAddress == NULL)
{
DPRINT("Irp->MdlAddress == NULL\n");
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_UNSUCCESSFUL;
}
return NpfsReadFromPipe(&Context);
}
NTSTATUS STDCALL
NpfsWrite(PDEVICE_OBJECT DeviceObject,
@@ -244,7 +473,6 @@ NpfsWrite(PDEVICE_OBJECT DeviceObject,
NTSTATUS Status = STATUS_SUCCESS;
ULONG Length;
ULONG Offset;
KIRQL OldIrql;
ULONG Information;
ULONG CopyLength;
ULONG TempLength;
@@ -296,7 +524,7 @@ NpfsWrite(PDEVICE_OBJECT DeviceObject,
Status = STATUS_SUCCESS;
Buffer = MmGetSystemAddressForMdl (Irp->MdlAddress);
KeAcquireSpinLock(&ReaderFcb->DataListLock, &OldIrql);
ExAcquireFastMutex(&ReaderFcb->DataListLock);
#ifndef NDEBUG
DPRINT("Length %d Buffer %x Offset %x\n",Length,Buffer,Offset);
HexDump(Buffer, Length);
@@ -307,7 +535,7 @@ NpfsWrite(PDEVICE_OBJECT DeviceObject,
if (ReaderFcb->WriteQuotaAvailable == 0)
{
KeSetEvent(&ReaderFcb->Event, IO_NO_INCREMENT, FALSE);
KeReleaseSpinLock(&ReaderFcb->DataListLock, OldIrql);
ExReleaseFastMutex(&ReaderFcb->DataListLock);
if (Fcb->PipeState != FILE_PIPE_CONNECTED_STATE)
{
Status = STATUS_PIPE_BROKEN;
@@ -332,7 +560,7 @@ NpfsWrite(PDEVICE_OBJECT DeviceObject,
Status = STATUS_PIPE_BROKEN;
goto done;
}
KeAcquireSpinLock(&ReaderFcb->DataListLock, &OldIrql);
ExAcquireFastMutex(&ReaderFcb->DataListLock);
}
if (Pipe->WriteMode == FILE_PIPE_BYTE_STREAM_MODE)
@@ -395,7 +623,7 @@ NpfsWrite(PDEVICE_OBJECT DeviceObject,
}
}
KeReleaseSpinLock(&ReaderFcb->DataListLock, OldIrql);
ExReleaseFastMutex(&ReaderFcb->DataListLock);
done:
Irp->IoStatus.Status = Status;

View File

@@ -268,69 +268,65 @@ VfatSetDispositionInformation(PFILE_OBJECT FileObject,
PDEVICE_OBJECT DeviceObject,
PFILE_DISPOSITION_INFORMATION DispositionInfo)
{
NTSTATUS Status = STATUS_SUCCESS;
#ifdef DBG
PDEVICE_EXTENSION DeviceExt = DeviceObject->DeviceExtension;
PDEVICE_EXTENSION DeviceExt = DeviceObject->DeviceExtension;
#endif
DPRINT ("FsdSetDispositionInformation()\n");
DPRINT ("FsdSetDispositionInformation()\n");
ASSERT(DeviceExt != NULL);
ASSERT(DeviceExt->FatInfo.BytesPerCluster != 0);
ASSERT(FCB != NULL);
ASSERT(DeviceExt != NULL);
ASSERT(DeviceExt->FatInfo.BytesPerCluster != 0);
ASSERT(FCB != NULL);
if (*FCB->Attributes & FILE_ATTRIBUTE_READONLY)
{
if (!DispositionInfo->DeleteFile)
{
/* undelete the file */
FCB->Flags &= ~FCB_DELETE_PENDING;
FileObject->DeletePending = FALSE;
return STATUS_SUCCESS;
}
if (FCB->Flags & FCB_DELETE_PENDING)
{
/* stream already marked for deletion. just update the file object */
FileObject->DeletePending = TRUE;
return STATUS_SUCCESS;
}
if (*FCB->Attributes & FILE_ATTRIBUTE_READONLY)
{
return STATUS_CANNOT_DELETE;
}
}
if (vfatFCBIsRoot(FCB) ||
if (vfatFCBIsRoot(FCB) ||
(FCB->LongNameU.Length == sizeof(WCHAR) && FCB->LongNameU.Buffer[0] == L'.') ||
(FCB->LongNameU.Length == 2 * sizeof(WCHAR) && FCB->LongNameU.Buffer[0] == L'.' && FCB->LongNameU.Buffer[1] == L'.'))
{
{
// we cannot delete a '.', '..' or the root directory
return STATUS_ACCESS_DENIED;
}
}
if (DispositionInfo->DeleteFile)
{
if (MmFlushImageSection (FileObject->SectionObjectPointer, MmFlushForDelete))
{
if (FCB->OpenHandleCount > 1)
{
DPRINT1("%d %x\n", FCB->OpenHandleCount, CcGetFileObjectFromSectionPtrs(FileObject->SectionObjectPointer));
Status = STATUS_ACCESS_DENIED;
}
else
{
FCB->Flags |= FCB_DELETE_PENDING;
FileObject->DeletePending = TRUE;
}
}
else
{
DPRINT("MmFlushImageSection returned FALSE\n");
Status = STATUS_CANNOT_DELETE;
}
if (NT_SUCCESS(Status) && vfatFCBIsDirectory(FCB))
{
if (!VfatIsDirectoryEmpty(FCB))
{
Status = STATUS_DIRECTORY_NOT_EMPTY;
FCB->Flags &= ~FCB_DELETE_PENDING;
FileObject->DeletePending = FALSE;
}
else
{
Status = STATUS_SUCCESS;
}
}
}
else
{
FileObject->DeletePending = FALSE;
}
return Status;
if (!MmFlushImageSection (FileObject->SectionObjectPointer, MmFlushForDelete))
{
/* can't delete a file if its mapped into a process */
DPRINT("MmFlushImageSection returned FALSE\n");
return STATUS_CANNOT_DELETE;
}
if (vfatFCBIsDirectory(FCB) && !VfatIsDirectoryEmpty(FCB))
{
/* can't delete a non-empty directory */
return STATUS_DIRECTORY_NOT_EMPTY;
}
/* all good */
FCB->Flags |= FCB_DELETE_PENDING;
FileObject->DeletePending = TRUE;
return STATUS_SUCCESS;
}
static NTSTATUS

View File

@@ -441,7 +441,7 @@ KbdDpcRoutine(PKDPC Dpc,
if (SystemArgument1 == NULL && DoSystemDebug != -1)
{
if (KbdWorkItem != NULL)
if (KbdWorkItem != NULL && DoSystemDebug == 10) /* 10 is Tab + K (enter kernel debugger) */
{
IoQueueWorkItem(KbdWorkItem, (PIO_WORKITEM_ROUTINE)KbdWorkItemRoutine, DelayedWorkQueue, NULL);
}

View File

@@ -209,3 +209,28 @@ PIP_INTERFACE FindOnLinkInterface(PIP_ADDRESS Address)
return NULL;
}
NTSTATUS GetInterfaceConnectionStatus
( PIP_INTERFACE Interface, PDWORD Result ) {
NTSTATUS Status = TcpipLanGetDwordOid
( Interface, OID_GEN_HARDWARE_STATUS, Result );
if( NT_SUCCESS(Status) ) switch( *Result ) {
case NdisHardwareStatusReady:
*Result = MIB_IF_OPER_STATUS_OPERATIONAL;
break;
case NdisHardwareStatusInitializing:
*Result = MIB_IF_OPER_STATUS_CONNECTING;
break;
case NdisHardwareStatusReset:
*Result = MIB_IF_OPER_STATUS_DISCONNECTED;
break;
case NdisHardwareStatusNotReady:
*Result = MIB_IF_OPER_STATUS_DISCONNECTED;
break;
case NdisHardwareStatusClosing:
default:
*Result = MIB_IF_OPER_STATUS_NON_OPERATIONAL;
break;
}
return Status;
}

View File

@@ -244,13 +244,29 @@ BOOLEAN IPRegisterInterface(
*/
{
KIRQL OldIrql;
UINT ChosenIndex = 1;
BOOLEAN IndexHasBeenChosen;
IP_ADDRESS NetworkAddress;
PNEIGHBOR_CACHE_ENTRY NCE;
IF_LIST_ITER(Interface);
TI_DbgPrint(MID_TRACE, ("Called. IF (0x%X).\n", IF));
TcpipAcquireSpinLock(&IF->Lock, &OldIrql);
/* Choose an index */
do {
IndexHasBeenChosen = TRUE;
ForEachInterface(Interface) {
if( Interface->Index == ChosenIndex ) {
ChosenIndex++;
IndexHasBeenChosen = FALSE;
}
} EndFor(Interface);
} while( !IndexHasBeenChosen );
IF->Index = ChosenIndex;
/* Add a permanent neighbor for this NTE */
NCE = NBAddNeighbor(IF, &IF->Unicast,
IF->Address, IF->AddressLength,

View File

@@ -20,8 +20,7 @@ VOID PortsStartup( PPORT_SET PortSet,
RtlInitializeBitMap( &PortSet->ProtoBitmap,
PortSet->ProtoBitBuffer,
PortSet->PortsToOversee );
RtlClearBits( &PortSet->ProtoBitmap,
PortSet->StartingPort, PortsToManage );
RtlClearAllBits( &PortSet->ProtoBitmap );
ExInitializeFastMutex( &PortSet->Mutex );
}
@@ -30,13 +29,17 @@ VOID PortsShutdown( PPORT_SET PortSet ) {
}
VOID DeallocatePort( PPORT_SET PortSet, ULONG Port ) {
RtlClearBits( &PortSet->ProtoBitmap,
PortSet->StartingPort + Port, 1 );
Port = htons(Port);
ASSERT(Port >= PortSet->StartingPort);
ASSERT(Port < PortSet->StartingPort + PortSet->PortsToOversee);
RtlClearBits( &PortSet->ProtoBitmap, Port - PortSet->StartingPort, 1 );
}
BOOLEAN AllocatePort( PPORT_SET PortSet, ULONG Port ) {
BOOLEAN Clear;
Port = htons(Port);
ASSERT(Port >= PortSet->StartingPort);
Port -= PortSet->StartingPort;
ExAcquireFastMutex( &PortSet->Mutex );
@@ -58,6 +61,8 @@ ULONG AllocateAnyPort( PPORT_SET PortSet ) {
}
ExReleaseFastMutex( &PortSet->Mutex );
AllocatedPort = htons(AllocatedPort);
return AllocatedPort;
}
@@ -76,5 +81,7 @@ ULONG AllocatePortFromRange( PPORT_SET PortSet, ULONG Lowest, ULONG Highest ) {
}
ExReleaseFastMutex( &PortSet->Mutex );
AllocatedPort = htons(AllocatedPort);
return AllocatedPort;
}

View File

@@ -109,16 +109,16 @@ VOID TCPAbortListenForSocket( PCONNECTION_ENDPOINT Listener,
TcpipRecursiveMutexEnter( &TCPLock, TRUE );
for( ListEntry = Listener->ListenRequest.Flink;
ListEntry != &Listener->ListenRequest;
ListEntry = ListEntry->Flink ) {
ListEntry = Listener->ListenRequest.Flink;
while ( ListEntry != &Listener->ListenRequest ) {
Bucket = CONTAINING_RECORD(ListEntry, TDI_BUCKET, Entry);
ListEntry = ListEntry->Flink;
if( Bucket->Request.Handle.ConnectionContext == Connection ) {
if( Bucket->AssociatedEndpoint == Connection ) {
#ifdef MEMTRACK
UntrackFL( __FILE__, __LINE__, Bucket->Request.RequestContext );
#endif
RemoveEntryList( ListEntry );
RemoveEntryList( ListEntry->Blink );
ExFreePool( Bucket );
}
}

View File

@@ -155,15 +155,28 @@ static VOID HandleSignalledConnection( PCONNECTION_ENDPOINT Connection,
}
if( NewState & SEL_FIN ) {
PLIST_ENTRY ListsToErase[4];
NTSTATUS IrpStatus[4];
UINT i;
TI_DbgPrint(DEBUG_TCP, ("EOF From socket\n"));
while( !IsListEmpty( &Connection->ReceiveRequest ) ) {
Entry = RemoveHeadList( &Connection->ReceiveRequest );
Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry );
Complete = Bucket->Request.RequestNotifyObject;
ListsToErase[0] = &Connection->ReceiveRequest;
IrpStatus [0] = STATUS_SUCCESS;
ListsToErase[1] = &Connection->ListenRequest;
IrpStatus [1] = STATUS_UNSUCCESSFUL;
ListsToErase[2] = &Connection->ConnectRequest;
IrpStatus [2] = STATUS_UNSUCCESSFUL;
ListsToErase[3] = 0;
Complete( Bucket->Request.RequestContext, STATUS_SUCCESS, 0 );
}
for( i = 0; ListsToErase[i]; i++ ) {
while( !IsListEmpty( ListsToErase[i] ) ) {
Entry = RemoveHeadList( ListsToErase[i] );
Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry );
Complete = Bucket->Request.RequestNotifyObject;
Complete( Bucket->Request.RequestContext, STATUS_SUCCESS, 0 );
}
}
}
Connection->Signalled = FALSE;
@@ -371,39 +384,6 @@ NTSTATUS TCPTranslateError( int OskitError ) {
return Status;
}
#if 0
NTSTATUS TCPBind
( PCONNECTION_ENDPOINT Connection,
PTDI_CONNECTION_INFORMATION ConnInfo ) {
NTSTATUS Status;
SOCKADDR_IN AddressToConnect;
PIP_ADDRESS LocalAddress;
USHORT LocalPort;
TI_DbgPrint(DEBUG_TCP,("Called\n"));
Status = AddrBuildAddress
((PTA_ADDRESS)ConnInfo->LocalAddress,
&LocalAddress,
&LocalPort);
AddressToBind.sin_family = AF_INET;
memcpy( &AddressToBind.sin_addr,
&LocalAddress->Address.IPv4Address,
sizeof(AddressToBind.sin_addr) );
AddressToBind.sin_port = LocalPort;
Status = OskitTCPBind( Connection->SocketContext,
Connection,
&AddressToBind,
sizeof(AddressToBind));
TI_DbgPrint(DEBUG_TCP,("Leaving %x\n", Status));
return Status;
}
#endif
NTSTATUS TCPConnect
( PCONNECTION_ENDPOINT Connection,
PTDI_CONNECTION_INFORMATION ConnInfo,
@@ -518,8 +498,9 @@ NTSTATUS TCPClose
Status = TCPTranslateError( OskitTCPClose( Connection->SocketContext ) );
if( Connection->Signalled )
RemoveEntryList( &Connection->SignalList );
/* Make our code remove all pending IRPs */
Connection->State |= SEL_FIN;
DrainSignals();
TcpipRecursiveMutexLeave( &TCPLock );
@@ -648,6 +629,8 @@ NTSTATUS TCPGetPeerAddress
OSK_UI16 LocalPort, RemotePort;
PTA_IP_ADDRESS AddressIP = (PTA_IP_ADDRESS)Address;
TcpipRecursiveMutexEnter( &TCPLock, TRUE );
OskitTCPGetAddress
( Connection->SocketContext,
&LocalAddress, &LocalPort,
@@ -658,6 +641,8 @@ NTSTATUS TCPGetPeerAddress
AddressIP->Address[0].AddressType = TDI_ADDRESS_TYPE_IP;
AddressIP->Address[0].Address[0].sin_port = RemotePort;
AddressIP->Address[0].Address[0].in_addr = RemoteAddress;
TcpipRecursiveMutexLeave( &TCPLock );
return STATUS_SUCCESS;
}

View File

@@ -80,6 +80,11 @@ NTSTATUS DDKAPI ListenComplete
PAFD_FCB FCB = (PAFD_FCB)Context;
PAFD_TDI_OBJECT_QELT Qelt;
if ( Irp->Cancel ) {
/* FIXME: is this anything else we need to do? */
return STATUS_SUCCESS;
}
if( !SocketAcquireStateLock( FCB ) ) return Status;
FCB->ListenIrp.InFlightRequest = NULL;

View File

@@ -165,6 +165,28 @@ VOID FreeAdapter(
}
NTSTATUS TcpipLanGetDwordOid
( PIP_INTERFACE Interface,
NDIS_OID Oid,
PDWORD Result ) {
/* Get maximum frame size */
if( Interface->Context ) {
return NDISCall((PLAN_ADAPTER)Interface->Context,
NdisRequestQueryInformation,
Oid,
Result,
sizeof(DWORD));
} else switch( Oid ) { /* Loopback Case */
case OID_GEN_HARDWARE_STATUS:
*Result = NdisHardwareStatusReady;
return STATUS_SUCCESS;
default:
return STATUS_INVALID_PARAMETER;
}
}
VOID STDCALL ProtocolOpenAdapterComplete(
NDIS_HANDLE BindingContext,
NDIS_STATUS Status,
@@ -916,11 +938,10 @@ VOID BindAdapter(
TI_DbgPrint(MID_TRACE,("BCAST(IF) %s\n", A2S(&IF->Broadcast)));
if(NT_SUCCESS(Status)) {
RtlZeroMemory( &IF->Name, sizeof(IF->Name) );
Status = ReadStringFromRegistry( RegHandle, L"DeviceDesc",
&IF->Name );
RtlZeroMemory( &IF->Name, sizeof( IF->Name ) );
/* I think that not getting a devicedesc is not a fatal error */
if( !NT_SUCCESS(Status) ) {
if( IF->Name.Buffer ) exFreePool( IF->Name.Buffer );
@@ -929,6 +950,8 @@ VOID BindAdapter(
Status = STATUS_SUCCESS;
}
TI_DbgPrint(MID_TRACE,("Adapter Name: %wZ\n", &IF->Name));
if(!NT_SUCCESS(Status))
{
TI_DbgPrint(MIN_TRACE, ("Unable to open protocol-specific registry key: 0x%x\n", Status));

View File

@@ -56,6 +56,14 @@ NTSTATUS DispTdiSetInformationEx(
PIRP Irp,
PIO_STACK_LOCATION IrpSp);
NTSTATUS DispTdiSetIPAddress(
PIRP Irp,
PIO_STACK_LOCATION IrpSp);
NTSTATUS DispTdiDeleteIPAddress(
PIRP Irp,
PIO_STACK_LOCATION IrpSp);
#endif /* __DISPATCH_H */
/* EOF */

View File

@@ -13,6 +13,8 @@ UINT CountInterfaceAddresses( PIP_INTERFACE Interface );
NTSTATUS GetInterfaceSpeed( PIP_INTERFACE Interface, PUINT Speed );
NTSTATUS GetInterfaceName( PIP_INTERFACE Interface, PCHAR NameBuffer,
UINT NameMaxLen );
NTSTATUS GetInterfaceConnectionStatus( PIP_INTERFACE Interface,
PDWORD OperStatus );
PIP_INTERFACE FindOnLinkInterface(PIP_ADDRESS Address);
#endif//_TCPIP_INTERFACE_H

View File

@@ -153,10 +153,16 @@ typedef struct _IP_INTERFACE {
UNICODE_STRING Name; /* Adapter name */
PUCHAR Address; /* Pointer to interface address */
UINT AddressLength; /* Length of address in bytes */
UINT Index; /* Index of adapter (used to add ip addr) */
LL_TRANSMIT_ROUTINE Transmit; /* Pointer to transmit function */
PVOID TCPContext; /* TCP Content for this interface */
} IP_INTERFACE, *PIP_INTERFACE;
typedef struct _IP_SET_ADDRESS {
ULONG NteIndex;
IPv4_RAW_ADDRESS Address;
IPv4_RAW_ADDRESS Netmask;
} IP_SET_ADDRESS, *PIP_SET_ADDRESS;
#define IP_PROTOCOL_TABLE_SIZE 0x100

View File

@@ -98,6 +98,9 @@ VOID LANUnregisterProtocol(
VOID LANStartup();
VOID LANShutdown();
NTSTATUS TcpipLanGetDwordOid( PIP_INTERFACE Interface, NDIS_OID Oid,
PDWORD Result );
NDIS_STATUS NDISCall(
PLAN_ADAPTER Adapter,
NDIS_REQUEST_TYPE Type,

View File

@@ -35,5 +35,6 @@
#include <oskittcp.h>
#include <interface.h>
#include <ports.h>
#include <ipifcons.h>
#define NTOS_MODE_USER
#include <ntos.h>

View File

@@ -136,7 +136,7 @@ typedef struct {
} TDIEntityInfo;
#ifndef htons
#define htons(x) (((x) << 16) | (((x) >> 8) & 0xff))
#define htons(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff))
#endif
/* Global variable */

View File

@@ -45,6 +45,12 @@
#define IOCTL_TCP_SET_INFORMATION_EX \
_TCP_CTL_CODE(1, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_SET_IP_ADDRESS \
_TCP_CTL_CODE(14, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_DELETE_IP_ADDRESS \
_TCP_CTL_CODE(16, METHOD_BUFFERED, FILE_WRITE_ACCESS)
/* Unique error values for log entries */
#define TI_ERROR_DRIVERENTRY 0

View File

@@ -219,6 +219,52 @@ VOID DDKAPI DispCancelRequest(
}
VOID DDKAPI DispCancelListenRequest(
PDEVICE_OBJECT Device,
PIRP Irp)
/*
* FUNCTION: Cancels a listen IRP
* ARGUMENTS:
* Device = Pointer to device object
* Irp = Pointer to an I/O request packet
*/
{
PIO_STACK_LOCATION IrpSp;
PTRANSPORT_CONTEXT TranContext;
PFILE_OBJECT FileObject;
PCONNECTION_ENDPOINT Connection;
/*NTSTATUS Status = STATUS_SUCCESS;*/
TI_DbgPrint(DEBUG_IRP, ("Called.\n"));
IrpSp = IoGetCurrentIrpStackLocation(Irp);
FileObject = IrpSp->FileObject;
TranContext = (PTRANSPORT_CONTEXT)FileObject->FsContext;
ASSERT( TDI_LISTEN == IrpSp->MinorFunction);
TI_DbgPrint(DEBUG_IRP, ("IRP at (0x%X).\n", Irp));
#ifdef DBG
if (!Irp->Cancel)
TI_DbgPrint(MIN_TRACE, ("Irp->Cancel is FALSE, should be TRUE.\n"));
#endif
/* Try canceling the request */
Connection = (PCONNECTION_ENDPOINT)TranContext->Handle.ConnectionContext;
TCPAbortListenForSocket(
Connection->AddressFile->Listener,
Connection );
IoReleaseCancelSpinLock(Irp->CancelIrql);
DispDataRequestComplete(Irp, STATUS_CANCELLED, 0);
DispCancelComplete(FileObject);
TI_DbgPrint(MAX_TRACE, ("Leaving.\n"));
}
NTSTATUS DispTdiAccept(
PIRP Irp)
/*
@@ -536,6 +582,12 @@ NTSTATUS DispTdiListen(
Status = TCPListen( Connection->AddressFile->Listener, 1024 );
/* BACKLOG */
}
if( NT_SUCCESS(Status) ) {
Status = DispPrepareIrpForCancel
(TranContext->Handle.ConnectionContext,
Irp,
(PDRIVER_CANCEL)DispCancelListenRequest);
}
if( NT_SUCCESS(Status) ) {
Status = TCPAccept
@@ -1413,4 +1465,56 @@ NTSTATUS DispTdiSetInformationEx(
return Status;
}
/* TODO: Support multiple addresses per interface.
* For now just set the nte context to the interface index.
*
* Later on, create an NTE context and NTE instance
*/
NTSTATUS DispTdiSetIPAddress( PIRP Irp, PIO_STACK_LOCATION IrpSp ) {
NTSTATUS Status = STATUS_DEVICE_DOES_NOT_EXIST;
PIP_SET_ADDRESS IpAddrChange =
(PIP_SET_ADDRESS)Irp->AssociatedIrp.SystemBuffer;
IF_LIST_ITER(IF);
ForEachInterface(IF) {
if( IF->Unicast.Address.IPv4Address == IpAddrChange->Address ) {
Status = STATUS_DUPLICATE_OBJECTID;
break;
}
if( IF->Index == IpAddrChange->NteIndex ) {
IF->Unicast.Type = IP_ADDRESS_V4;
IF->Unicast.Address.IPv4Address = IpAddrChange->Address;
IF->Netmask.Type = IP_ADDRESS_V4;
IF->Netmask.Address.IPv4Address = IpAddrChange->Netmask;
IpAddrChange->Address = IF->Index;
Status = STATUS_SUCCESS;
Irp->IoStatus.Information = IF->Index;
break;
}
} EndFor(IF);
Irp->IoStatus.Status = Status;
return Status;
}
NTSTATUS DispTdiDeleteIPAddress( PIRP Irp, PIO_STACK_LOCATION IrpSp ) {
NTSTATUS Status = STATUS_UNSUCCESSFUL;
PUSHORT NteIndex = Irp->AssociatedIrp.SystemBuffer;
IF_LIST_ITER(IF);
ForEachInterface(IF) {
if( IF->Index == *NteIndex ) {
IF->Unicast.Type = IP_ADDRESS_V4;
IF->Unicast.Address.IPv4Address = 0;
IF->Netmask.Type = IP_ADDRESS_V4;
IF->Netmask.Address.IPv4Address = 0;
Status = STATUS_SUCCESS;
}
} EndFor(IF);
Irp->IoStatus.Status = Status;
return Status;
}
/* EOF */

View File

@@ -33,15 +33,21 @@ TDI_STATUS InfoTdiQueryGetInterfaceMIB(TDIEntityID *ID,
RtlZeroMemory( OutData, sizeof(IFENTRY) + MAX_IFDESCR_LEN );
OutData->Index = ID->tei_instance + 1;
OutData->Index = Interface->Index;
/* viz: tcpip keeps those indices */
OutData->Type = Interface == Loopback ? IFENT_SOFTWARE_LOOPBACK : 0;
OutData->Type = Interface ==
Loopback ? MIB_IF_TYPE_LOOPBACK : MIB_IF_TYPE_ETHERNET;
OutData->Mtu = Interface->MTU;
TI_DbgPrint(MAX_TRACE,
("Getting interface speed\n"));
OutData->PhysAddrLen = Interface->AddressLength;
OutData->AdminStatus = 1; /* XXX Up -- How do I know? */
OutData->OperStatus = 1; /* XXX Up -- How do I know? */
OutData->AdminStatus = MIB_IF_ADMIN_STATUS_UP;
/* NDIS_HARDWARE_STATUS -> ROUTER_CONNECTION_STATE */
Status = GetInterfaceConnectionStatus( Interface, &OutData->OperStatus );
/* Not sure what to do here, but not ready seems a safe bet on failure */
if( !NT_SUCCESS(Status) )
OutData->OperStatus = NdisHardwareStatusNotReady;
IFDescr = (PCHAR)&OutData[1];
@@ -98,5 +104,7 @@ TDI_STATUS InfoInterfaceTdiSetEx( UINT InfoClass,
TDIEntityID *id,
PCHAR Buffer,
UINT BufferSize ) {
TI_DbgPrint(MAX_TRACE, ("Got Request: Class %x Type %x Id %x, EntityID %x:%x\n",
InfoClass, InfoId, id->tei_entity, id->tei_instance));
return TDI_INVALID_REQUEST;
}

View File

@@ -9,7 +9,7 @@
*/
#include "precomp.h"
#define NDEBUG
//#define NDEBUG
#ifndef NDEBUG
DWORD DebugTraceLevel = DEBUG_ULTRA & ~(DEBUG_LOCK | DEBUG_PBUFFER);
@@ -578,6 +578,16 @@ TiDispatch(
Status = DispTdiSetInformationEx(Irp, IrpSp);
break;
case IOCTL_SET_IP_ADDRESS:
TI_DbgPrint(MIN_TRACE, ("SET_IP_ADDRESS\n"));
Status = DispTdiSetIPAddress(Irp, IrpSp);
break;
case IOCTL_DELETE_IP_ADDRESS:
TI_DbgPrint(MIN_TRACE, ("DELETE_IP_ADDRESS\n"));
Status = DispTdiDeleteIPAddress(Irp, IrpSp);
break;
default:
TI_DbgPrint(MIN_TRACE, ("Unknown IOCTL 0x%X\n",
IrpSp->Parameters.DeviceIoControl.IoControlCode));

View File

@@ -210,6 +210,7 @@ IntInitScreenInfo(
pGdiInfo->ulLogPixelsX = pDevMode->dmLogPixels;
pGdiInfo->ulLogPixelsY = pDevMode->dmLogPixels;
pGdiInfo->flTextCaps = TC_RA_ABLE;
pGdiInfo->flRaster = 0;
pGdiInfo->ulDACRed = SelectedMode->NumberRedBits;
pGdiInfo->ulDACGreen = SelectedMode->NumberGreenBits;
pGdiInfo->ulDACBlue = SelectedMode->NumberBlueBits;

View File

@@ -329,6 +329,10 @@ IntVideoPortPnPStartDevice(
{
DeviceExtension->InterruptLevel = Descriptor->u.Interrupt.Level;
DeviceExtension->InterruptVector = Descriptor->u.Interrupt.Vector;
if (Descriptor->ShareDisposition == CmResourceShareShared)
DeviceExtension->InterruptShared = TRUE;
else
DeviceExtension->InterruptShared = FALSE;
}
}
}

View File

@@ -85,7 +85,7 @@ IntVideoPortSetupInterrupt(
Irql,
Irql,
ConfigInfo->InterruptMode,
FALSE,
DeviceExtension->InterruptShared,
Affinity,
FALSE);

View File

@@ -559,6 +559,10 @@ VideoPortGetAccessRanges(
{
DeviceExtension->InterruptLevel = Descriptor->u.Interrupt.Level;
DeviceExtension->InterruptVector = Descriptor->u.Interrupt.Vector;
if (Descriptor->ShareDisposition == CmResourceShareShared)
DeviceExtension->InterruptShared = TRUE;
else
DeviceExtension->InterruptShared = FALSE;
}
}
}

View File

@@ -492,7 +492,7 @@ IntVideoPortFindAdapter(
VOID FASTCALL
IntAttachToCSRSS(PEPROCESS *CallingProcess, PEPROCESS *PrevAttachedProcess)
{
{
*CallingProcess = PsGetCurrentProcess();
if (*CallingProcess != Csrss)
{

View File

@@ -93,6 +93,7 @@ typedef struct _VIDEO_PORT_DEVICE_EXTENSTION
PCM_RESOURCE_LIST AllocatedResources;
ULONG InterruptVector;
ULONG InterruptLevel;
BOOLEAN InterruptShared;
ULONG AdapterInterfaceType;
ULONG SystemIoBusNumber;
ULONG SystemIoSlotNumber;

View File

@@ -502,7 +502,7 @@ HalRestoreFont(VOID)
HalWriteGc(0x05, 0x00); /* Write mode 0; read mode 0. */
HalWriteGc(0x06, 0x05); /* Set graphics. */
memcpy(GraphVideoBuffer, SavedTextFont[i], FONT_AMOUNT);
}
}
HalBlankScreen(TRUE);
@@ -519,7 +519,6 @@ HalRestoreFont(VOID)
HalWriteSeq(0x04, Seq4);
}
VOID STATIC
HalRestoreMode(VOID)
{
@@ -629,6 +628,7 @@ HalInitializeDisplay (PLOADER_PARAMETER_BLOCK LoaderBlock)
}
}
/* PUBLIC FUNCTIONS *********************************************************/
VOID STDCALL
@@ -637,7 +637,6 @@ HalReleaseDisplayOwnership(VOID)
* FUNCTION: Release ownership of display back to HAL
*/
{
if (HalResetDisplayParameters == NULL)
return;
@@ -646,14 +645,12 @@ HalReleaseDisplayOwnership(VOID)
if (!HalResetDisplayParameters(SizeX, SizeY))
{
HalRestoreMode();
HalRestoreFont();
HalRestorePalette();
HalRestorePalette();
}
HalOwnsDisplay = TRUE;
HalClearDisplay(CHAR_ATTRIBUTE);
}

File diff suppressed because it is too large Load Diff

1132
reactos/include/d3d8.h Normal file

File diff suppressed because it is too large Load Diff

286
reactos/include/d3d8caps.h Normal file
View File

@@ -0,0 +1,286 @@
/*
* Copyright (C) 2002 Jason Edmeades
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_D3D8CAPS_H
#define __WINE_D3D8CAPS_H
/*
* Definitions
*/
#define D3DCAPS_READ_SCANLINE 0x20000
#define D3DCURSORCAPS_COLOR 1
#define D3DCURSORCAPS_LOWRES 2
#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x0000010
#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x0000020
#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x0000040
#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x0000080
#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x0000100
#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x0000200
#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x0000400
#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x0000800
#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x0001000
#define D3DDEVCAPS_DRAWPRIMITIVES2 0x0002000
#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x0004000
#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x0008000
#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x0010000
#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x0020000
#define D3DDEVCAPS_HWRASTERIZATION 0x0080000
#define D3DDEVCAPS_PUREDEVICE 0x0100000
#define D3DDEVCAPS_QUINTICRTPATCHES 0x0200000
#define D3DDEVCAPS_RTPATCHES 0x0400000
#define D3DDEVCAPS_RTPATCHHANDLEZERO 0x0800000
#define D3DDEVCAPS_NPATCHES 0x1000000
#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x00FFFF
#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x080000
#define D3DFVFCAPS_PSIZE 0x100000
#define D3DLINECAPS_TEXTURE 0x01
#define D3DLINECAPS_ZTEST 0x02
#define D3DLINECAPS_BLEND 0x04
#define D3DLINECAPS_ALPHACMP 0x08
#define D3DLINECAPS_FOG 0x10
#define D3DPBLENDCAPS_ZERO 0x0001
#define D3DPBLENDCAPS_ONE 0x0002
#define D3DPBLENDCAPS_SRCCOLOR 0x0004
#define D3DPBLENDCAPS_INVSRCCOLOR 0x0008
#define D3DPBLENDCAPS_SRCALPHA 0x0010
#define D3DPBLENDCAPS_INVSRCALPHA 0x0020
#define D3DPBLENDCAPS_DESTALPHA 0x0040
#define D3DPBLENDCAPS_INVDESTALPHA 0x0080
#define D3DPBLENDCAPS_DESTCOLOR 0x0100
#define D3DPBLENDCAPS_INVDESTCOLOR 0x0200
#define D3DPBLENDCAPS_SRCALPHASAT 0x0400
#define D3DPBLENDCAPS_BOTHSRCALPHA 0x0800
#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x1000
#define D3DPCMPCAPS_NEVER 0x01
#define D3DPCMPCAPS_LESS 0x02
#define D3DPCMPCAPS_EQUAL 0x04
#define D3DPCMPCAPS_LESSEQUAL 0x08
#define D3DPCMPCAPS_GREATER 0x10
#define D3DPCMPCAPS_NOTEQUAL 0x20
#define D3DPCMPCAPS_GREATEREQUAL 0x40
#define D3DPCMPCAPS_ALWAYS 0x80
#define D3DPMISCCAPS_MASKZ 0x0002
#define D3DPMISCCAPS_LINEPATTERNREP 0x0004
#define D3DPMISCCAPS_CULLNONE 0x0010
#define D3DPMISCCAPS_CULLCW 0x0020
#define D3DPMISCCAPS_CULLCCW 0x0040
#define D3DPMISCCAPS_COLORWRITEENABLE 0x0080
#define D3DPMISCCAPS_CLIPPLANESCALEDPOINTS 0x0100
#define D3DPMISCCAPS_CLIPTLVERTS 0x0200
#define D3DPMISCCAPS_TSSARGTEMP 0x0400
#define D3DPMISCCAPS_BLENDOP 0x0800
#define D3DPRASTERCAPS_DITHER 0x00000001
#define D3DPRASTERCAPS_PAT 0x00000008
#define D3DPRASTERCAPS_ZTEST 0x00000010
#define D3DPRASTERCAPS_FOGVERTEX 0x00000080
#define D3DPRASTERCAPS_FOGTABLE 0x00000100
#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000
#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000
#define D3DPRASTERCAPS_ZBIAS 0x00004000
#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000
#define D3DPRASTERCAPS_FOGRANGE 0x00010000
#define D3DPRASTERCAPS_ANISOTROPY 0x00020000
#define D3DPRASTERCAPS_WBUFFER 0x00040000
#define D3DPRASTERCAPS_WFOG 0x00100000
#define D3DPRASTERCAPS_ZFOG 0x00200000
#define D3DPRASTERCAPS_COLORPERSPECTIVE 0x00400000
#define D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE 0x00800000
#define D3DPRESENT_INTERVAL_DEFAULT 0x00000000
#define D3DPRESENT_INTERVAL_ONE 0x00000001
#define D3DPRESENT_INTERVAL_TWO 0x00000002
#define D3DPRESENT_INTERVAL_THREE 0x00000004
#define D3DPRESENT_INTERVAL_FOUR 0x00000008
#define D3DPRESENT_INTERVAL_IMMEDIATE 0x80000000
#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00008
#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00200
#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x04000
#define D3DPSHADECAPS_FOGGOURAUD 0x80000
#define D3DPTADDRESSCAPS_WRAP 0x01
#define D3DPTADDRESSCAPS_MIRROR 0x02
#define D3DPTADDRESSCAPS_CLAMP 0x04
#define D3DPTADDRESSCAPS_BORDER 0x08
#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x10
#define D3DPTADDRESSCAPS_MIRRORONCE 0x20
#define D3DPTEXTURECAPS_PERSPECTIVE 0x00001
#define D3DPTEXTURECAPS_POW2 0x00002
#define D3DPTEXTURECAPS_ALPHA 0x00004
#define D3DPTEXTURECAPS_SQUAREONLY 0x00020
#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00040
#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00080
#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00100
#define D3DPTEXTURECAPS_PROJECTED 0x00400
#define D3DPTEXTURECAPS_CUBEMAP 0x00800
#define D3DPTEXTURECAPS_VOLUMEMAP 0x02000
#define D3DPTEXTURECAPS_MIPMAP 0x04000
#define D3DPTEXTURECAPS_MIPVOLUMEMAP 0x08000
#define D3DPTEXTURECAPS_MIPCUBEMAP 0x10000
#define D3DPTEXTURECAPS_CUBEMAP_POW2 0x20000
#define D3DPTEXTURECAPS_VOLUMEMAP_POW2 0x40000
#define D3DPTFILTERCAPS_MINFPOINT 0x00000100
#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200
#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400
#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000
#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000
#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000
#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000
#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000
#define D3DPTFILTERCAPS_MAGFAFLATCUBIC 0x08000000
#define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000
#define D3DSTENCILCAPS_KEEP 0x01
#define D3DSTENCILCAPS_ZERO 0x02
#define D3DSTENCILCAPS_REPLACE 0x04
#define D3DSTENCILCAPS_INCRSAT 0x08
#define D3DSTENCILCAPS_DECRSAT 0x10
#define D3DSTENCILCAPS_INVERT 0x20
#define D3DSTENCILCAPS_INCR 0x40
#define D3DSTENCILCAPS_DECR 0x80
#define D3DTEXOPCAPS_DISABLE 0x0000001
#define D3DTEXOPCAPS_SELECTARG1 0x0000002
#define D3DTEXOPCAPS_SELECTARG2 0x0000004
#define D3DTEXOPCAPS_MODULATE 0x0000008
#define D3DTEXOPCAPS_MODULATE2X 0x0000010
#define D3DTEXOPCAPS_MODULATE4X 0x0000020
#define D3DTEXOPCAPS_ADD 0x0000040
#define D3DTEXOPCAPS_ADDSIGNED 0x0000080
#define D3DTEXOPCAPS_ADDSIGNED2X 0x0000100
#define D3DTEXOPCAPS_SUBTRACT 0x0000200
#define D3DTEXOPCAPS_ADDSMOOTH 0x0000400
#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x0000800
#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x0001000
#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x0002000
#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x0004000
#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x0008000
#define D3DTEXOPCAPS_PREMODULATE 0x0010000
#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x0020000
#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x0040000
#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x0080000
#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x0100000
#define D3DTEXOPCAPS_BUMPENVMAP 0x0200000
#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x0400000
#define D3DTEXOPCAPS_DOTPRODUCT3 0x0800000
#define D3DTEXOPCAPS_MULTIPLYADD 0x1000000
#define D3DTEXOPCAPS_LERP 0x2000000
#define D3DVTXPCAPS_TEXGEN 0x01
#define D3DVTXPCAPS_MATERIALSOURCE7 0x02
#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x08
#define D3DVTXPCAPS_POSITIONALLIGHTS 0x10
#define D3DVTXPCAPS_LOCALVIEWER 0x20
#define D3DVTXPCAPS_TWEENING 0x40
#define D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD 0x00000020
#define D3DCAPS3_RESERVED 0x8000001f
#define D3DCAPS2_CANCALIBRATEGAMMA 0x0100000
#define D3DCAPS2_CANRENDERWINDOWED 0x0080000
#define D3DCAPS2_CANMANAGERESOURCE 0x10000000
#define D3DCAPS2_DYNAMICTEXTURES 0x20000000
#define D3DCAPS2_FULLSCREENGAMMA 0x0020000
#define D3DCAPS2_NO2DDURING3DSCENE 0x0000002
#define D3DCAPS2_RESERVED 0x2000000
/*
* The d3dcaps8 structure
*/
typedef struct _D3DCAPS8 {
D3DDEVTYPE DeviceType;
UINT AdapterOrdinal;
DWORD Caps;
DWORD Caps2;
DWORD Caps3;
DWORD PresentationIntervals;
DWORD CursorCaps;
DWORD DevCaps;
DWORD PrimitiveMiscCaps;
DWORD RasterCaps;
DWORD ZCmpCaps;
DWORD SrcBlendCaps;
DWORD DestBlendCaps;
DWORD AlphaCmpCaps;
DWORD ShadeCaps;
DWORD TextureCaps;
DWORD TextureFilterCaps;
DWORD CubeTextureFilterCaps;
DWORD VolumeTextureFilterCaps;
DWORD TextureAddressCaps;
DWORD VolumeTextureAddressCaps;
DWORD LineCaps;
DWORD MaxTextureWidth, MaxTextureHeight;
DWORD MaxVolumeExtent;
DWORD MaxTextureRepeat;
DWORD MaxTextureAspectRatio;
DWORD MaxAnisotropy;
float MaxVertexW;
float GuardBandLeft;
float GuardBandTop;
float GuardBandRight;
float GuardBandBottom;
float ExtentsAdjust;
DWORD StencilCaps;
DWORD FVFCaps;
DWORD TextureOpCaps;
DWORD MaxTextureBlendStages;
DWORD MaxSimultaneousTextures;
DWORD VertexProcessingCaps;
DWORD MaxActiveLights;
DWORD MaxUserClipPlanes;
DWORD MaxVertexBlendMatrices;
DWORD MaxVertexBlendMatrixIndex;
float MaxPointSize;
DWORD MaxPrimitiveCount;
DWORD MaxVertexIndex;
DWORD MaxStreams;
DWORD MaxStreamStride;
DWORD VertexShaderVersion;
DWORD MaxVertexShaderConst;
DWORD PixelShaderVersion;
float MaxPixelShaderValue;
} D3DCAPS8;
#endif /* __WINE_D3D8CAPS_H */

1210
reactos/include/d3d8types.h Normal file

File diff suppressed because it is too large Load Diff

1486
reactos/include/d3d9.h Normal file

File diff suppressed because it is too large Load Diff

391
reactos/include/d3d9caps.h Normal file
View File

@@ -0,0 +1,391 @@
/*
* Copyright (C) 2002-2003 Jason Edmeades
* Raphael Junqueira
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_D3D9CAPS_H
#define __WINE_D3D9CAPS_H
/*
* Definitions
*/
#define D3DCAPS_READ_SCANLINE 0x20000
#define D3DCURSORCAPS_COLOR 1
#define D3DCURSORCAPS_LOWRES 2
#define D3DDEVCAPS2_STREAMOFFSET 0x00000001L
#define D3DDEVCAPS2_DMAPNPATCH 0x00000002L
#define D3DDEVCAPS2_ADAPTIVETESSRTPATCH 0x00000004L
#define D3DDEVCAPS2_ADAPTIVETESSNPATCH 0x00000008L
#define D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES 0x00000010L
#define D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH 0x00000020L
#define D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET 0x00000040L
#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x0000010
#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x0000020
#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x0000040
#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x0000080
#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x0000100
#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x0000200
#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x0000400
#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x0000800
#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x0001000
#define D3DDEVCAPS_DRAWPRIMITIVES2 0x0002000
#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x0004000
#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x0008000
#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x0010000
#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x0020000
#define D3DDEVCAPS_HWRASTERIZATION 0x0080000
#define D3DDEVCAPS_PUREDEVICE 0x0100000
#define D3DDEVCAPS_QUINTICRTPATCHES 0x0200000
#define D3DDEVCAPS_RTPATCHES 0x0400000
#define D3DDEVCAPS_RTPATCHHANDLEZERO 0x0800000
#define D3DDEVCAPS_NPATCHES 0x1000000
#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x00FFFF
#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x080000
#define D3DFVFCAPS_PSIZE 0x100000
#define D3DLINECAPS_TEXTURE 0x01
#define D3DLINECAPS_ZTEST 0x02
#define D3DLINECAPS_BLEND 0x04
#define D3DLINECAPS_ALPHACMP 0x08
#define D3DLINECAPS_FOG 0x10
#define D3DPBLENDCAPS_ZERO 0x00000001
#define D3DPBLENDCAPS_ONE 0x00000002
#define D3DPBLENDCAPS_SRCCOLOR 0x00000004
#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008
#define D3DPBLENDCAPS_SRCALPHA 0x00000010
#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020
#define D3DPBLENDCAPS_DESTALPHA 0x00000040
#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080
#define D3DPBLENDCAPS_DESTCOLOR 0x00000100
#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200
#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400
#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800
#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000
#define D3DPBLENDCAPS_BLENDFACTOR 0x00002000
#define D3DPCMPCAPS_NEVER 0x01
#define D3DPCMPCAPS_LESS 0x02
#define D3DPCMPCAPS_EQUAL 0x04
#define D3DPCMPCAPS_LESSEQUAL 0x08
#define D3DPCMPCAPS_GREATER 0x10
#define D3DPCMPCAPS_NOTEQUAL 0x20
#define D3DPCMPCAPS_GREATEREQUAL 0x40
#define D3DPCMPCAPS_ALWAYS 0x80
#define D3DPMISCCAPS_MASKZ 0x00000002L
#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L
#define D3DPMISCCAPS_CULLNONE 0x00000010L
#define D3DPMISCCAPS_CULLCW 0x00000020L
#define D3DPMISCCAPS_CULLCCW 0x00000040L
#define D3DPMISCCAPS_COLORWRITEENABLE 0x00000080L
#define D3DPMISCCAPS_CLIPPLANESCALEDPOINTS 0x00000100L
#define D3DPMISCCAPS_CLIPTLVERTS 0x00000200L
#define D3DPMISCCAPS_TSSARGTEMP 0x00000400L
#define D3DPMISCCAPS_BLENDOP 0x00000800L
#define D3DPMISCCAPS_NULLREFERENCE 0x00001000L
#define D3DPMISCCAPS_INDEPENDENTWRITEMASKS 0x00004000L
#define D3DPMISCCAPS_PERSTAGECONSTANT 0x00008000L
#define D3DPMISCCAPS_FOGANDSPECULARALPHA 0x00010000L
#define D3DPMISCCAPS_SEPARATEALPHABLEND 0x00020000L
#define D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS 0x00040000L
#define D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING 0x00080000L
#define D3DPMISCCAPS_FOGVERTEXCLAMPED 0x00100000L
#define D3DPRASTERCAPS_DITHER 0x00000001L
#define D3DPRASTERCAPS_PAT 0x00000008L
#define D3DPRASTERCAPS_ZTEST 0x00000010L
#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L
#define D3DPRASTERCAPS_FOGTABLE 0x00000100L
#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L
#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L
#define D3DPRASTERCAPS_ZBIAS 0x00004000L
#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L
#define D3DPRASTERCAPS_FOGRANGE 0x00010000L
#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L
#define D3DPRASTERCAPS_WBUFFER 0x00040000L
#define D3DPRASTERCAPS_WFOG 0x00100000L
#define D3DPRASTERCAPS_ZFOG 0x00200000L
#define D3DPRASTERCAPS_COLORPERSPECTIVE 0x00400000L
#define D3DPRASTERCAPS_SCISSORTEST 0x01000000L
#define D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS 0x02000000L
#define D3DPRASTERCAPS_DEPTHBIAS 0x04000000L
#define D3DPRASTERCAPS_MULTISAMPLE_TOGGLE 0x08000000L
#define D3DPRESENT_INTERVAL_DEFAULT 0x00000000
#define D3DPRESENT_INTERVAL_ONE 0x00000001
#define D3DPRESENT_INTERVAL_TWO 0x00000002
#define D3DPRESENT_INTERVAL_THREE 0x00000004
#define D3DPRESENT_INTERVAL_FOUR 0x00000008
#define D3DPRESENT_INTERVAL_IMMEDIATE 0x80000000
#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00008
#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00200
#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x04000
#define D3DPSHADECAPS_FOGGOURAUD 0x80000
#define D3DPTADDRESSCAPS_WRAP 0x01
#define D3DPTADDRESSCAPS_MIRROR 0x02
#define D3DPTADDRESSCAPS_CLAMP 0x04
#define D3DPTADDRESSCAPS_BORDER 0x08
#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x10
#define D3DPTADDRESSCAPS_MIRRORONCE 0x20
#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L
#define D3DPTEXTURECAPS_POW2 0x00000002L
#define D3DPTEXTURECAPS_ALPHA 0x00000004L
#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L
#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L
#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L
#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L
#define D3DPTEXTURECAPS_PROJECTED 0x00000400L
#define D3DPTEXTURECAPS_CUBEMAP 0x00000800L
#define D3DPTEXTURECAPS_VOLUMEMAP 0x00002000L
#define D3DPTEXTURECAPS_MIPMAP 0x00004000L
#define D3DPTEXTURECAPS_MIPVOLUMEMAP 0x00008000L
#define D3DPTEXTURECAPS_MIPCUBEMAP 0x00010000L
#define D3DPTEXTURECAPS_CUBEMAP_POW2 0x00020000L
#define D3DPTEXTURECAPS_VOLUMEMAP_POW2 0x00040000L
#define D3DPTEXTURECAPS_NOPROJECTEDBUMPENV 0x00200000L
#define D3DPTFILTERCAPS_MINFPOINT 0x00000100
#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200
#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400
#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000
#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000
#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000
#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000
#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000
#define D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD 0x08000000
#define D3DPTFILTERCAPS_MAGFGAUSSIANQUAD 0x10000000
#define D3DSTENCILCAPS_KEEP 0x01
#define D3DSTENCILCAPS_ZERO 0x02
#define D3DSTENCILCAPS_REPLACE 0x04
#define D3DSTENCILCAPS_INCRSAT 0x08
#define D3DSTENCILCAPS_DECRSAT 0x10
#define D3DSTENCILCAPS_INVERT 0x20
#define D3DSTENCILCAPS_INCR 0x40
#define D3DSTENCILCAPS_DECR 0x80
#define D3DTEXOPCAPS_DISABLE 0x0000001
#define D3DTEXOPCAPS_SELECTARG1 0x0000002
#define D3DTEXOPCAPS_SELECTARG2 0x0000004
#define D3DTEXOPCAPS_MODULATE 0x0000008
#define D3DTEXOPCAPS_MODULATE2X 0x0000010
#define D3DTEXOPCAPS_MODULATE4X 0x0000020
#define D3DTEXOPCAPS_ADD 0x0000040
#define D3DTEXOPCAPS_ADDSIGNED 0x0000080
#define D3DTEXOPCAPS_ADDSIGNED2X 0x0000100
#define D3DTEXOPCAPS_SUBTRACT 0x0000200
#define D3DTEXOPCAPS_ADDSMOOTH 0x0000400
#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x0000800
#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x0001000
#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x0002000
#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x0004000
#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x0008000
#define D3DTEXOPCAPS_PREMODULATE 0x0010000
#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x0020000
#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x0040000
#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x0080000
#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x0100000
#define D3DTEXOPCAPS_BUMPENVMAP 0x0200000
#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x0400000
#define D3DTEXOPCAPS_DOTPRODUCT3 0x0800000
#define D3DTEXOPCAPS_MULTIPLYADD 0x1000000
#define D3DTEXOPCAPS_LERP 0x2000000
#define D3DVTXPCAPS_TEXGEN 0x00000001L
#define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L
#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L
#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L
#define D3DVTXPCAPS_LOCALVIEWER 0x00000020L
#define D3DVTXPCAPS_TWEENING 0x00000040L
#define D3DVTXPCAPS_TEXGEN_SPHEREMAP 0x00000100L
#define D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER 0x00000200L
#define D3DDTCAPS_UBYTE4 0x00000001L
#define D3DDTCAPS_UBYTE4N 0x00000002L
#define D3DDTCAPS_SHORT2N 0x00000004L
#define D3DDTCAPS_SHORT4N 0x00000008L
#define D3DDTCAPS_USHORT2N 0x00000010L
#define D3DDTCAPS_USHORT4N 0x00000020L
#define D3DDTCAPS_UDEC3 0x00000040L
#define D3DDTCAPS_DEC3N 0x00000080L
#define D3DDTCAPS_FLOAT16_2 0x00000100L
#define D3DDTCAPS_FLOAT16_4 0x00000200L
#define D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD 0x00000020L
#define D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION 0x00000080L
#define D3DCAPS3_COPY_TO_VIDMEM 0x00000100L
#define D3DCAPS3_COPY_TO_SYSTEMMEM 0x00000200L
#define D3DCAPS3_RESERVED 0x8000001FL
#define D3DCAPS2_NO2DDURING3DSCENE 0x00000002L
#define D3DCAPS2_FULLSCREENGAMMA 0x00020000L
#define D3DCAPS2_CANRENDERWINDOWED 0x00080000L
#define D3DCAPS2_CANCALIBRATEGAMMA 0x00100000L
#define D3DCAPS2_RESERVED 0x02000000L
#define D3DCAPS2_CANMANAGERESOURCE 0x10000000L
#define D3DCAPS2_DYNAMICTEXTURES 0x20000000L
#define D3DCAPS2_CANAUTOGENMIPMAP 0x40000000L
#define D3DVS20_MAX_DYNAMICFLOWCONTROLDEPTH 24
#define D3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH 0
#define D3DVS20_MAX_NUMTEMPS 32
#define D3DVS20_MIN_NUMTEMPS 12
#define D3DVS20_MAX_STATICFLOWCONTROLDEPTH 4
#define D3DVS20_MIN_STATICFLOWCONTROLDEPTH 1
#define D3DVS20CAPS_PREDICATION (1 << 0)
#define D3DPS20CAPS_ARBITRARYSWIZZLE (1 << 0)
#define D3DPS20CAPS_GRADIENTINSTRUCTIONS (1 << 1)
#define D3DPS20CAPS_PREDICATION (1 << 2)
#define D3DPS20CAPS_NODEPENDENTREADLIMIT (1 << 3)
#define D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT (1 << 4)
#define D3DPS20_MAX_DYNAMICFLOWCONTROLDEPTH 24
#define D3DPS20_MIN_DYNAMICFLOWCONTROLDEPTH 0
#define D3DPS20_MAX_NUMTEMPS 32
#define D3DPS20_MIN_NUMTEMPS 12
#define D3DPS20_MAX_STATICFLOWCONTROLDEPTH 4
#define D3DPS20_MIN_STATICFLOWCONTROLDEPTH 0
#define D3DPS20_MAX_NUMINSTRUCTIONSLOTS 512
#define D3DPS20_MIN_NUMINSTRUCTIONSLOTS 96
#define D3DMIN30SHADERINSTRUCTIONS 512
#define D3DMAX30SHADERINSTRUCTIONS 32768
typedef struct _D3DVSHADERCAPS2_0 {
DWORD Caps;
INT DynamicFlowControlDepth;
INT NumTemps;
INT StaticFlowControlDepth;
} D3DVSHADERCAPS2_0;
typedef struct _D3DPSHADERCAPS2_0 {
DWORD Caps;
INT DynamicFlowControlDepth;
INT NumTemps;
INT StaticFlowControlDepth;
INT NumInstructionSlots;
} D3DPSHADERCAPS2_0;
/*
* The d3dcaps9 structure
*/
typedef struct _D3DCAPS9 {
D3DDEVTYPE DeviceType;
UINT AdapterOrdinal;
DWORD Caps;
DWORD Caps2;
DWORD Caps3;
DWORD PresentationIntervals;
DWORD CursorCaps;
DWORD DevCaps;
DWORD PrimitiveMiscCaps;
DWORD RasterCaps;
DWORD ZCmpCaps;
DWORD SrcBlendCaps;
DWORD DestBlendCaps;
DWORD AlphaCmpCaps;
DWORD ShadeCaps;
DWORD TextureCaps;
DWORD TextureFilterCaps;
DWORD CubeTextureFilterCaps;
DWORD VolumeTextureFilterCaps;
DWORD TextureAddressCaps;
DWORD VolumeTextureAddressCaps;
DWORD LineCaps;
DWORD MaxTextureWidth, MaxTextureHeight;
DWORD MaxVolumeExtent;
DWORD MaxTextureRepeat;
DWORD MaxTextureAspectRatio;
DWORD MaxAnisotropy;
float MaxVertexW;
float GuardBandLeft;
float GuardBandTop;
float GuardBandRight;
float GuardBandBottom;
float ExtentsAdjust;
DWORD StencilCaps;
DWORD FVFCaps;
DWORD TextureOpCaps;
DWORD MaxTextureBlendStages;
DWORD MaxSimultaneousTextures;
DWORD VertexProcessingCaps;
DWORD MaxActiveLights;
DWORD MaxUserClipPlanes;
DWORD MaxVertexBlendMatrices;
DWORD MaxVertexBlendMatrixIndex;
float MaxPointSize;
DWORD MaxPrimitiveCount;
DWORD MaxVertexIndex;
DWORD MaxStreams;
DWORD MaxStreamStride;
DWORD VertexShaderVersion;
DWORD MaxVertexShaderConst;
DWORD PixelShaderVersion;
float MaxPixelShaderValue;
/* DX 9 */
DWORD DevCaps2;
float MaxNpatchTessellationLevel;
DWORD Reserved5;
UINT MasterAdapterOrdinal;
UINT AdapterOrdinalInGroup;
UINT NumberOfAdaptersInGroup;
DWORD DeclTypes;
DWORD NumSimultaneousRTs;
DWORD StretchRectFilterCaps;
D3DVSHADERCAPS2_0 VS20Caps;
D3DPSHADERCAPS2_0 PS20Caps;
DWORD VertexTextureFilterCaps;
DWORD MaxVShaderInstructionsExecuted;
DWORD MaxPShaderInstructionsExecuted;
DWORD MaxVertexShader30InstructionSlots;
DWORD MaxPixelShader30InstructionSlots;
} D3DCAPS9;
#endif

1518
reactos/include/d3d9types.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2003 Martin Fuchs
* Copyright (C) 2005 Peter Berg Larsen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -16,29 +16,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __D3DRM_H__
#define __D3DRM_H__
//
// Explorer and Desktop clone
//
// shellhook.h
//
// Martin Fuchs, 17.08.2003
//
#include <ddraw.h>
/* #include <d3drmobj.h> */
#ifdef _SHELLHOOK_IMPL
#define DECL_SHELLHOOK __declspec(dllexport)
#else
#define DECL_SHELLHOOK __declspec(dllimport)
#endif
#ifdef __cplusplus
extern "C" {
#endif
DECL_SHELLHOOK void InstallShellHook(HWND callback_hwnd, UINT callback_msg);
DECL_SHELLHOOK void DeinstallShellHook();
#ifdef __cplusplus
};
#endif
#endif /* __D3DRM_H__ */

View File

@@ -25,12 +25,13 @@
#ifndef __WINE_D3DTYPES_H
#define __WINE_D3DTYPES_H
/* #include <windows.h> FIXME: Need to include for compatibility. Inclusion caused compile fail */
#include <float.h>
#include <ddraw.h>
#define D3DVALP(val, prec) ((float)(val))
#define D3DVAL(val) ((float)(val))
typedef float D3DVALUE,*LPD3DVALUE;
#define D3DDivide(a, b) (float)((double) (a) / (double) (b))
#define D3DMultiply(a, b) ((a) * (b))
@@ -75,53 +76,16 @@ typedef HRESULT (CALLBACK *LPD3DVALIDATECALLBACK)(LPVOID lpUserArg, DWORD dwOffs
typedef HRESULT (CALLBACK *LPD3DENUMTEXTUREFORMATSCALLBACK)(LPDDSURFACEDESC lpDdsd, LPVOID lpContext);
typedef HRESULT (CALLBACK *LPD3DENUMPIXELFORMATSCALLBACK)(LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext);
#ifndef DX_SHARED_DEFINES
typedef float D3DVALUE,*LPD3DVALUE;
#ifndef D3DCOLOR_DEFINED
typedef DWORD D3DCOLOR, *LPD3DCOLOR;
#define D3DCOLOR_DEFINED
#endif
typedef DWORD D3DMATERIALHANDLE, *LPD3DMATERIALHANDLE;
typedef DWORD D3DTEXTUREHANDLE, *LPD3DTEXTUREHANDLE;
typedef DWORD D3DMATRIXHANDLE, *LPD3DMATRIXHANDLE;
typedef struct _D3DCOLORVALUE {
union {
D3DVALUE r;
D3DVALUE dvR;
} DUMMYUNIONNAME1;
union {
D3DVALUE g;
D3DVALUE dvG;
} DUMMYUNIONNAME2;
union {
D3DVALUE b;
D3DVALUE dvB;
} DUMMYUNIONNAME3;
union {
D3DVALUE a;
D3DVALUE dvA;
} DUMMYUNIONNAME4;
} D3DCOLORVALUE,*LPD3DCOLORVALUE;
typedef struct _D3DRECT {
union {
LONG x1;
LONG lX1;
} DUMMYUNIONNAME1;
union {
LONG y1;
LONG lY1;
} DUMMYUNIONNAME2;
union {
LONG x2;
LONG lX2;
} DUMMYUNIONNAME3;
union {
LONG y2;
LONG lY2;
} DUMMYUNIONNAME4;
} D3DRECT, *LPD3DRECT;
#ifndef D3DVECTOR_DEFINED
typedef struct _D3DVECTOR {
union {
D3DVALUE x;
@@ -173,6 +137,53 @@ public:
friend _D3DVECTOR CrossProduct(const _D3DVECTOR& v1, const _D3DVECTOR& v2);
#endif
} D3DVECTOR,*LPD3DVECTOR;
#define D3DVECTOR_DEFINED
#endif
#define DX_SHARED_DEFINES
#endif /* DX_SHARED_DEFINES */
typedef DWORD D3DMATERIALHANDLE, *LPD3DMATERIALHANDLE;
typedef DWORD D3DTEXTUREHANDLE, *LPD3DTEXTUREHANDLE;
typedef DWORD D3DMATRIXHANDLE, *LPD3DMATRIXHANDLE;
typedef struct _D3DCOLORVALUE {
union {
D3DVALUE r;
D3DVALUE dvR;
} DUMMYUNIONNAME1;
union {
D3DVALUE g;
D3DVALUE dvG;
} DUMMYUNIONNAME2;
union {
D3DVALUE b;
D3DVALUE dvB;
} DUMMYUNIONNAME3;
union {
D3DVALUE a;
D3DVALUE dvA;
} DUMMYUNIONNAME4;
} D3DCOLORVALUE,*LPD3DCOLORVALUE;
typedef struct _D3DRECT {
union {
LONG x1;
LONG lX1;
} DUMMYUNIONNAME1;
union {
LONG y1;
LONG lY1;
} DUMMYUNIONNAME2;
union {
LONG x2;
LONG lX2;
} DUMMYUNIONNAME3;
union {
LONG y2;
LONG lY2;
} DUMMYUNIONNAME4;
} D3DRECT, *LPD3DRECT;
typedef struct _D3DHVERTEX {
DWORD dwFlags;
@@ -330,7 +341,7 @@ typedef struct _D3DMATRIX {
} D3DMATRIX, *LPD3DMATRIX;
#if defined(__cplusplus) && defined(D3D_OVERLOADS)
#include "d3dvec.inl"
#include <d3dvec.inl>
#endif
typedef struct _D3DVIEWPORT {

141
reactos/include/d3dvec.inl Normal file
View File

@@ -0,0 +1,141 @@
/*
* Copyright (C) 2000 Ove Kaaven
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_D3DVEC_INL
#define __WINE_D3DVEC_INL
/*** constructors ***/
inline _D3DVECTOR::_D3DVECTOR(D3DVALUE f)
{
x = y = z = f;
}
inline _D3DVECTOR::_D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z)
{
x = _x; y = _y; z = _z;
}
/*** assignment operators ***/
inline _D3DVECTOR& _D3DVECTOR::operator += (const _D3DVECTOR& v)
{
x += v.x; y += v.y; z += v.z;
return *this;
}
inline _D3DVECTOR& _D3DVECTOR::operator -= (const _D3DVECTOR& v)
{
x -= v.x; y -= v.y; z -= v.z;
return *this;
}
inline _D3DVECTOR& _D3DVECTOR::operator *= (const _D3DVECTOR& v)
{
x *= v.x; y *= v.y; z *= v.z;
return *this;
}
inline _D3DVECTOR& _D3DVECTOR::operator /= (const _D3DVECTOR& v)
{
x /= v.x; y /= v.y; z /= v.z;
return *this;
}
inline _D3DVECTOR& _D3DVECTOR::operator *= (D3DVALUE s)
{
x *= s; y *= s; z *= s;
return *this;
}
inline _D3DVECTOR& _D3DVECTOR::operator /= (D3DVALUE s)
{
x /= s; y /= s; z /= s;
return *this;
}
/*** unary operators ***/
inline _D3DVECTOR operator + (const _D3DVECTOR& v)
{
return v;
}
inline _D3DVECTOR operator - (const _D3DVECTOR& v)
{
return _D3DVECTOR(-v.x, -v.y, -v.z);
}
/*** binary operators ***/
inline _D3DVECTOR operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return _D3DVECTOR(v1.x+v2.x, v1.y+v2.y, v1.z+v2.z);
}
inline _D3DVECTOR operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return _D3DVECTOR(v1.x-v2.x, v1.y-v2.y, v1.z-v2.z);
}
inline _D3DVECTOR operator * (const _D3DVECTOR& v, D3DVALUE s)
{
return _D3DVECTOR(v.x*s, v.y*s, v.z*s);
}
inline _D3DVECTOR operator * (D3DVALUE s, const _D3DVECTOR& v)
{
return _D3DVECTOR(v.x*s, v.y*s, v.z*s);
}
inline _D3DVECTOR operator / (const _D3DVECTOR& v, D3DVALUE s)
{
return _D3DVECTOR(v.x/s, v.y/s, v.z/s);
}
inline D3DVALUE SquareMagnitude(const _D3DVECTOR& v)
{
return v.x*v.x + v.y*v.y + v.z*v.z; /* DotProduct(v, v) */
}
inline D3DVALUE Magnitude(const _D3DVECTOR& v)
{
return sqrt(SquareMagnitude(v));
}
inline _D3DVECTOR Normalize(const _D3DVECTOR& v)
{
return v / Magnitude(v);
}
inline D3DVALUE DotProduct(const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z;
}
inline _D3DVECTOR CrossProduct(const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
_D3DVECTOR res;
/* this is a left-handed cross product, right? */
res.x = v1.y * v2.z - v1.z * v2.y;
res.y = v1.z * v2.x - v1.x * v2.z;
res.z = v1.x * v2.y - v1.y * v2.x;
return res;
}
#endif

128
reactos/include/d3dx8core.h Normal file
View File

@@ -0,0 +1,128 @@
/*
* Copyright (C) 2002 Raphael Junqueira
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_D3DX8CORE_H
#define __WINE_D3DX8CORE_H
#include <objbase.h>
#include <d3d8.h>
#include <d3d8types.h>
#include <d3d8caps.h>
/*****************************************************************************
* #defines and error codes
*/
#define D3DXASM_DEBUG 1
#define D3DXASM_SKIPVALIDATION 2
#define _FACD3D 0x876
#define MAKE_D3DXHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code )
/*
* Direct3D Errors
*/
#define D3DXERR_CANNOTATTRSORT MAKE_D3DXHRESULT(2158)
#define D3DXERR_CANNOTMODIFYINDEXBUFFER MAKE_D3DXHRESULT(2159)
#define D3DXERR_INVALIDMESH MAKE_D3DXHRESULT(2160)
#define D3DXERR_SKINNINGNOTSUPPORTED MAKE_D3DXHRESULT(2161)
#define D3DXERR_TOOMANYINFLUENCES MAKE_D3DXHRESULT(2162)
#define D3DXERR_INVALIDDATA MAKE_D3DXHRESULT(2163)
/*****************************************************************************
* Predeclare the interfaces
*/
DEFINE_GUID(IID_ID3DXBuffer, 0x1,0x1,0x4,0xB0,0xCF,0x98,0xFE,0xFD,0xFF,0x95,0x12);/* FIXME */
typedef struct ID3DXBuffer ID3DXBuffer, *LPD3DXBUFFER;
DEFINE_GUID(IID_ID3DXFont, 0x1,0x1,0x4,0xB0,0xCF,0x98,0xFE,0xFD,0xFF,0x95,0x13);/* FIXME */
typedef struct ID3DXFont ID3DXFont, *LPD3DXFONT;
/*****************************************************************************
* ID3DXBuffer interface
*/
#define INTERFACE ID3DXBuffer
DECLARE_INTERFACE_(ID3DXBuffer,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** ID3DXBuffer methods ***/
STDMETHOD_(LPVOID,GetBufferPointer)(THIS) PURE;
STDMETHOD_(DWORD,GetBufferSize)(THIS) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define ID3DXBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ID3DXBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ID3DXBuffer_Release(p) (p)->lpVtbl->Release(p)
/*** ID3DXBuffer methods ***/
#define ID3DXBuffer_GetBufferPointer(p) (p)->lpVtbl->GetBufferPointer(p)
#define ID3DXBuffer_GetBufferSize(p) (p)->lpVtbl->GetBufferSize(p)
#endif
/*****************************************************************************
* ID3DXFont interface
*/
#define INTERFACE ID3DXFont
DECLARE_INTERFACE_(ID3DXFont,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** ID3DXFont methods ***/
STDMETHOD(Begin)(THIS) PURE;
STDMETHOD(DrawTextA)(THIS) PURE;
STDMETHOD(End)(THIS) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define ID3DXFont_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ID3DXFont_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ID3DXFont_Release(p) (p)->lpVtbl->Release(p)
/*** ID3DXFont methods ***/
#define ID3DXFont_Begin(p) (p)->lpVtbl->Begin(p)
#define ID3DXFont_DrawTextA(p,a,b,c,d,e)(p)->lpVtbl->DrawText(p,a,b,c,d,e)
#define ID3DXFont_End(p) (p)->lpVtbl->End(p)
#endif
/*************************************************************************************
* Define entrypoints
*/
HRESULT WINAPI D3DXCreateBuffer(DWORD NumBytes, LPD3DXBUFFER* ppBuffer);
HRESULT WINAPI D3DXCreateFont(LPDIRECT3DDEVICE8 pDevice, HFONT hFont, LPD3DXFONT* ppFont);
UINT WINAPI D3DXGetFVFVertexSize(DWORD FVF);
HRESULT WINAPI D3DXAssembleShader(LPCVOID pSrcData, UINT SrcDataLen, DWORD Flags,
LPD3DXBUFFER* ppConstants,
LPD3DXBUFFER* ppCompiledShader,
LPD3DXBUFFER* ppCompilationErrors);
HRESULT WINAPI D3DXAssembleShaderFromFileA(LPSTR pSrcFile, DWORD Flags,
LPD3DXBUFFER* ppConstants,
LPD3DXBUFFER* ppCompiledShader,
LPD3DXBUFFER* ppCompilationErrors);
HRESULT WINAPI D3DXAssembleShaderFromFileW(LPSTR pSrcFile, DWORD Flags,
LPD3DXBUFFER* ppConstants,
LPD3DXBUFFER* ppCompiledShader,
LPD3DXBUFFER* ppCompilationErrors);
#endif /* __WINE_D3DX8CORE_H */

View File

@@ -10,7 +10,10 @@ typedef enum _KEY_INFORMATION_CLASS
{
KeyBasicInformation,
KeyNodeInformation,
KeyFullInformation
KeyFullInformation,
KeyNameInformation,
KeyCachedInformation,
KeyFlagsInformation
} KEY_INFORMATION_CLASS;
typedef struct _KEY_BASIC_INFORMATION

View File

@@ -46,7 +46,6 @@ typedef struct _EX_WORK_QUEUE {
EX_QUEUE_WORKER_INFO Info;
} EX_WORK_QUEUE, *PEX_WORK_QUEUE;
typedef ULONG_PTR ERESOURCE_THREAD, *PERESOURCE_THREAD;
typedef struct _OWNER_ENTRY
@@ -257,10 +256,6 @@ typedef VOID STDCALL_FUNC
PVOID Argument1,
PVOID Argument2);
extern struct _OBJECT_TYPE EXPORTED *ExMutantObjectType;
extern struct _OBJECT_TYPE EXPORTED *ExSemaphoreObjectType;
extern struct _OBJECT_TYPE EXPORTED *ExTimerType;
#endif /* __INCLUDE_DDK_EXTYPES_H */
/* EOF */

View File

@@ -42,6 +42,15 @@ VOID STDCALL KeAcquireSpinLock (PKSPIN_LOCK SpinLock,
#ifndef __USE_W32API
static __inline
VOID
KeMemoryBarrier(
VOID)
{
volatile LONG Barrier;
__asm__ __volatile__ ("xchg %%eax, %0" : : "m" (Barrier) : "%eax");
}
VOID STDCALL KeAcquireSpinLockAtDpcLevel (IN PKSPIN_LOCK SpinLock);
#define KefAcquireSpinLockAtDpcLevel KeAcquireSpinLockAtDpcLevel

View File

@@ -14,12 +14,12 @@ LdrFindResource_U(IN PVOID BaseAddress,
IN ULONG Level,
OUT PIMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntry);
/*NTSTATUS STDCALL
NTSTATUS STDCALL
LdrFindResourceDirectory_U( IN PVOID BaseAddress,
IN PLDR_RESOURCE_INFO ResourceInfo,
IN PLDR_RESOURCE_INFO ResourceInfo,
IN ULONG Level,
OUT PIMAGE_RESOURCE_DIRECTORY *ResourceDirectory);
*/
NTSTATUS STDCALL
LdrEnumResources(IN PVOID BaseAddress,
IN PLDR_RESOURCE_INFO ResourceInfo,

File diff suppressed because it is too large Load Diff

View File

@@ -269,6 +269,7 @@ typedef struct _DDNONLOCALVIDMEMCAPS {
#define DDSCAPS_EXECUTEBUFFER DDSCAPS_RESERVED2
#define DDSCAPS2_VERTEXBUFFER DDSCAPS2_RESERVED1
#define DDSCAPS2_COMMANDBUFFER DDSCAPS2_RESERVED2

View File

@@ -0,0 +1,19 @@
/*
* Plug and Play Manager interface definition
*/
#define WORD unsigned short
[
uuid (809F4e40-A03D-11CE-8F69-08003E30051B),
version(1.0),
pointer_default(unique),
explicit_handle
]
interface pnp
{
// unsigned long PNP_GetRootDeviceInstance(handle_t BindingHandle,
// [out, string, size_is(Length)] wchar_t *DeviceInstance,
// [in] unsigned long Length);
WORD PNP_GetVersion(handle_t BindingHandle);
}

View File

@@ -87,12 +87,38 @@ typedef struct _OBJECT_ATTRIBUTES
PVOID SecurityQualityOfService;
} OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
typedef struct _HANDLE_TABLE_ENTRY_INFO {
ULONG AuditMask;
} HANDLE_TABLE_ENTRY_INFO, *PHANDLE_TABLE_ENTRY_INFO;
typedef struct _HANDLE_TABLE_ENTRY {
union {
PVOID Object;
ULONG_PTR ObAttributes;
PHANDLE_TABLE_ENTRY_INFO InfoTable;
ULONG_PTR Value;
} u1;
union {
ULONG GrantedAccess;
USHORT GrantedAccessIndex;
LONG NextFreeTableEntry;
} u2;
} HANDLE_TABLE_ENTRY, *PHANDLE_TABLE_ENTRY;
#endif /* __USE_W32API */
typedef struct _HANDLE_TABLE
{
LIST_ENTRY ListHead;
KSPIN_LOCK ListLock;
ULONG Flags;
LONG HandleCount;
PHANDLE_TABLE_ENTRY **Table;
PEPROCESS QuotaProcess;
HANDLE UniqueProcessId;
LONG FirstFreeTableEntry;
LONG NextIndexNeedingPool;
ERESOURCE HandleTableLock;
LIST_ENTRY HandleTableList;
KEVENT HandleContentionEvent;
} HANDLE_TABLE;
#ifndef __USE_W32API

View File

@@ -492,6 +492,7 @@ typedef struct _ADDRESS_RANGE
#define MB_FLAGS_BOOT_LOADER_NAME (0x200)
#define MB_FLAGS_APM_TABLE (0x400)
#define MB_FLAGS_GRAPHICS_TABLE (0x800)
#define MB_FLAGS_ACPI_TABLE (0x1000)
typedef struct _LOADER_MODULE
{

View File

@@ -490,6 +490,19 @@ struct _SYSTEM_CACHE_INFORMATION
} SYSTEM_CACHE_INFORMATION;
// SystemInterruptInformation (23)
typedef
struct _SYSTEM_INTERRUPT_INFORMATION
{
ULONG ContextSwitches;
ULONG DpcCount;
ULONG DpcRate;
ULONG TimeIncrement;
ULONG DpcBypassCount;
ULONG ApcBypassCount;
} SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
// SystemDpcInformation (24)
typedef
struct _SYSTEM_DPC_INFORMATION

View File

@@ -590,6 +590,7 @@ typedef struct _IMAGE_RESOURCE_DIRECTORY {
#define IMAGE_SUBSYSTEM_OS2_CUI 5
#define IMAGE_SUBSYSTEM_POSIX_GUI 6
#define IMAGE_SUBSYSTEM_POSIX_CUI 7
#define IMAGE_SUBSYSTEM_NATIVE_WINDOWS 8
#define IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 9
#define IMAGE_SUBSYSTEM_EFI_APPLICATION 10
#define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11

View File

@@ -3,21 +3,31 @@
/* $Id$ */
/* smdll/connect.c */
/* smlib/connect.c */
NTSTATUS STDCALL
SmConnectApiPort (IN PUNICODE_STRING pSbApiPortName OPTIONAL,
IN HANDLE hSbApiPort OPTIONAL,
IN DWORD dwSubsystem OPTIONAL, /* pe.h */
IN OUT PHANDLE phSmApiPort);
/* smdll/compses.c */
/* smlib/compses.c */
NTSTATUS STDCALL
SmCompleteSession (IN HANDLE hSmApiPort,
IN HANDLE hSbApiPort,
IN HANDLE hApiPort);
/* smdll/execpgm.c */
/* smlib/execpgm.c */
NTSTATUS STDCALL
SmExecuteProgram (IN HANDLE hSmApiPort,
IN PUNICODE_STRING Pgm
);
/* smdll/query.c */
typedef enum {
SM_BASE_INFORMATION
} SM_INFORMATION_CLASS, *PSM_INFORMATION_CLASS;
NTSTATUS STDCALL
SmQuery (IN HANDLE SmApiPort,
IN SM_INFORMATION_CLASS SmInformationClass,
IN OUT PVOID Data,
IN OUT PULONG DataLength);
#endif /* ndef INCLUDE_SM_HELPER_H */

View File

@@ -37,4 +37,10 @@
#define IOCTL_TCP_SET_INFORMATION_EX \
_TCP_CTL_CODE(1, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_SET_IP_ADDRESS \
_TCP_CTL_CODE(14, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_DELETE_IP_ADDRESS \
_TCP_CTL_CODE(16, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#endif/*_TCPIOCTL_H*/

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