Arwinss

From ReactOS Wiki
Revision as of 12:49, 15 April 2010 by Unxed (talk | contribs)
Jump to: navigation, search

Arwinss is an alternative implementation of the core Win32 subsystem components. Technical information about implementation details is available at this page: Arwinss technical.

Usage

Checkout the arwinss branch (svn://svn.reactos.org/reactos/branches/arwinss/reactos), and compile using following command:

makex comctl32 user32 gdi32 win32k winent win32csr freetype kernel32 explorer winlogon

This will build all needed modules of a new subsystem, which you need to copy over to the installed ReactOS version (see Transfer files from the host OS to the virtual drive). A modified KERNEL32.DLL is needed only for a compatible global atoms support.

If you want to build winex11 module, you need to firstly copy lib/3rdparty/libX11/libX11.a file from your working copy to the obj-i386/lib/3rdparty/libX11 directory (creating it if it does not exist). This will fix the winex11.drv linking issues, and you can just type

makex winex11

to build this optional module.

Architecture

Arwinss uses parts of the Wine architecture and parts of Windows NT architecture in appropriate places and in a good way.The overall call flow / architecture of Arwinss looks like this:

Arwinss.png


It consists of the following modules, one of them being optional (winex11.drv):

  • dll/3rdparty/freetype - implements usermode font rendering (FreeType library, with small ReactOS glue), used by GDI32.DLL
  • dll/win32/user32 - implements USER API
  • dll/win32/gdi32 - implements GDI API
  • dll/win32/winent.drv - implements native graphics and user drivers
  • dll/win32/winex11.drv - implements X11 X-windows graphics and user drivers
  • subsystems/win32/win32k - implements kernel mode counter part of the native graphics driver, a Simple Window Manager (SWM) and a kernel mode USER server.
  • subsystems/win32/csrss/win32csr - implements needed parts of the CSR subsystem along with handling user input

Hacking

Most of the hacking happens in WINENT.DRV and WIN32K.SYS, with very rare fixes to the user32/gdi32 (mainly, because it's a tested Wine's code with only minor changes).

Convention for marking changes. C++ code comments (//) mean that the place has some special mark up for debugging. A typical use is for a

// FIXME: Something

Potential Benefits

These bugs would be fixed if Arwinss was ready (just a short list):

  • #933 "OO.114 - Installation wizard with blank text"
  • #1175 "listbox does not hide scrollbars in listbox"
  • #1239 "Winamp's Main Window Unclickable"
  • #1546 "Two carets on the screen at one with two edit areas opened"
  • #1776 "Microsoft remote desktop client can't connect, computername can't be entered"
  • #2393 "Firefox 1.5 Download, you need move the mouse."
  • #2769 "Redraw bug using ShowWindow for a child window of a dialog"
  • #2788 "Wrong right click behaviour - unwanted multiple selection"
  • #2835 "Opera 9.64: Unable to locate timer in message queue for W..."
  • #3500 "Charmap redrawing bug"
  • #3542 "background image is clipped in some installers (abiword) in first page"
  • #3893 "Properties for Date/Time: mouse pointer disappears"
  • #3966 "can't hit enter on a selected item to open it"
  • #4066 "Notepad, uses two different fonts / highlighted text invisible"
  • #4443 "Firefox 3 - Can't scroll page with mouse wheel."
  • #4501 "When closing one window, Firefox gets restored if it was minimized"
  • #4612 "tn5250: can't move window"
  • #4779 "K-Meleon popup menus don't work"
  • #5069 "JPEG artifacts in installers"

As one can see from these bug titles it mainly boils down to drastically improved user32 and gdi32 support.

TODO

This list is legacy and will be removed soon! A new place for this is ReactOS Bugzilla (component "Arwinss") http://www.reactos.org/bugzilla

  1. [Fixed] Check situation with desktop and top windows - need to ensure there is no auto "one desktop per application" creation happens!
  2. [Fixed] Check all places which use PsLookupThreadByThreadId and fix reference counting
  3. [Fixed] No desktop background (hacked away in win32csr)
  4. [Fixed] Fix absence of a background color in windows, and general lacking of windows painting
  5. [Fixed] Fix a "err:(dll\win32\gdi32\freetype.c:3068) FT_New_Face rets 85" problem, resulting in a hack in RosDrv_GetTextMetrics
  6. [Fixed] Fix RosGdiSelectBitmap with an incorrect user bitmap handle (probably a stock bitmap?)
  7. [Fixed] Make user/kernel handles mapping multithread aware. NOTE: It already was.
  8. [Fixed] Add some real locking to GDI_ObjGetPtr / GDI_ObjRelease. NOTE: Just added multithread safety to GDI_ObjGetPtr, but pointers to objects are not locked in any way, so release is a noop.
  9. [Fixed] Implement surface bits locking for concurrent accesses
  10. [Fixed] Implement mouse cursor support in win32k
  11. [Fixed] Implement user input in win32k and winent.drv
  12. [Fixed] Implement a locking mechanism for GDI kernel mode objects
  13. [Fixed] Add commented out CombinedClipping region back into all graphics operations
  14. [Fixed] Make /CONSOLE booting from working perfectly
  15. [Fixed] Purge user->kernel handles mapping when a process is destroyed
  16. [Fixed] Get rid of hardcoded 800x600 (and 640x480 in monitor functions) display size
  17. [Fixed] Fix black icons problem
  18. [Fixed] Fix mouse cursor being black problem
  19. [Fixed] Implement moving of windows
  20. [Fixed] [Assembla #5]Implement scrolling support
  21. [Fixed]Hang in 2nd stage with "CMP_WaitNoPendingInstallEvents() failed! Rebooting now!"
  22. Enable commented out places in the font output code (ET_OPAQUE, etc)
  23. [Assembla #2]Make win32k/wine/queue.c (timer callback and timeout callback) multithread aware. Right now it doesn't lock its lists
  24. [Fixed] arwinss takes ages to boot on 1st stage and 2nd stage showing: WARNING: IoReportResourceUsage at ntoskrnl\io\iomgr\iorsrce.c:700 is UNIMPLEMENTED!
  25. Explorer taskbar does not appear automatically
  26. [Fixed] Text displaying issues in cmd
  27. [Fixed]Shutdown isn't working
  28. [Fixed]Some images are flipped horizontally and vertically
  29. [Fixed]Moving windows produces graphical glitches (fixed in 46778, glitches may still appear during resizing)
  30. [Fixed]Minimize, restore and close icons are wrong
  31. [Fixed]Scroll bar arrows and the bar itself aren't displayed correctly
  32. When the taskbar is visible no window is displayed
  33. Implement support for multiple desktops
  34. Implement hotkeys support
  35. can't click on buttons inside groupboxes

Testing

You can get the lastest ARWINSS ISO in the first message of this thread or here.

Changelog (recent revisions)

46872

- Enable clipped text output. Solves issues like caption text being printed outside of window's caption when window is being made too small.

46871

- Add a clipping region cache to the usermode DC structure and use it in SetDeviceClipping calls instead of creating an empty region all the time. Speed increase and also it's needed for further text output improvements.

46861

- Grab a USER lock when entering timer worker routines, fixes race conditions (were exhibited by user32_winetest msg)

46827

- A user server inside the win32k should have its own error state and must not change thread's last error! Implement this by using a global_error variable, having in mind that handling a server request is an atomic operation.

- Number of winetest failures is dramatically reduced.

46778

- Copy whole window bits when moving a window, SWM's job. Fixes "repainting" issues when moving a window.

46773

- Temporarily comment out freeing the message queue at thread termination. Fixes "hangs" after exiting any application.

46772

- Code cleanup: remove unnecessary PTHREADINFO/PPROCESSINFO casts, reduce diff to the original code, make the code smaller by querying the current thread info only once per function.

46772

- Code cleanup: remove unnecessary PTHREADINFO/PPROCESSINFO casts, reduce diff to the original code, make the code smaller by querying the current thread info only once per function.

46759

- Store a handle to the idle event, not just a pointer to the event object in a per process structure.

- Dereference and properly close idle event object when terminating a process.

46756

- Finally implement timeout removal from the old desktop when setting a new one for the process.

46755

- Add thread termination cleanup (destroying windows, freeing a message queue, dereferencing its desktop).

46753

- Create and use idle_event as expected by Wine. It creates idle_event for every gui process (TODO: investigate if CUI process in ReactOS should have it).

- Rewrite get_process_idle_event handler in a NT way.

46752

- Import process.s from wineserver, clean it up to contain only ported get_process_idle_event handler. Not included into the build now.

46715

- Sync up to Wine-1.1.42.

46322

- Sync up to Wine-1.1.41.

45981 (by Maarten Kroese)

- Apply same Marlett-font charset fix to the system menu drawing.

- Also slightly adjust symbol's position. (Should be sent upstream).

45949

- Sync up to Wine-1.1.40.

- winent.drv: Since GetObject doesn't report negative height for topdown bitmaps anymore, rely on information from bmi. In future, it should be fixed to just provide a boolean topdown flag to the kernelmode GDI driver counterpart.

45810

- GetBitmapBits and SetBitmapBits should get/set bitmaps bits in a particular format described in MSDN, not in the format they are stored in internally. Reimplement them based on winex11.drv implementation. Could use some optimisation, but they are deprecated non time-critical functions. Thanks to Maarten Kroese for finding this problem. Fixes issue #28 in Arwinss wiki.

45808

- GreSetDIBits: Don't leak a surface lock in case parameters check fails.

- GreSetDIBits: Add a (now commented out) optimisation for directly copying bits if source and target bitmaps parameters closely match. Based on a similar winex11.drv optimisation in this function.

45689

- Merge 45687:45688 by Maarten Kroese. Fixes issues with context menus in ReactOS Explorer.

45678 (by Maarten Kroese)

UITOOLS95_DrawFrameCaption improvements:

- Change FIXED_PITCH to DEFAULT_PITCH (because Marlett is not a fixed pitch font).

- Change from SYMBOL_CHARSET to DEFAULT_CHARSET, it's correct according to MSDN, because SYMBOL_CHARSET implies that it can fall back to another font, but that is never what we want.

- FW_NORMAL to FW_DONTCARE.

- This patch should be sent to Wine, however their Marlett font hides these problems.

45651

- Sync up to Wine-1.1.39.

45630

- Merge 45011: "avoid warning messages on Explorer startup when missing configuration files".

Most of code written by fireball, if not specially mentioned.