Core ReactOS
  1. Core ReactOS
  2. CORE-12649

[NTUSER]: Implement NtUserExcludeUpdateRgn

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Fix Version/s: 0.4.4
    • Component/s: Win32SS
    • Labels:
      None

      Description

      Needed by Office products >= 2003.
      Kills the

      WARNING:  NtUserExcludeUpdateRgn at H:\trunk\reactos_clean\win32ss\user\ntuser\ntstubs.c:113 is UNIMPLEMENTED!

      warnings.

      1. CORE-12649_hbm_WIP.patch
        2 kB
        HBelusca
      2. ExcludeUpdateRgn.patch
        3 kB
        jimtabor
      1. snapshot97.png
        85 kB
      2. snapshot98.png
        131 kB

        Issue Links

          Activity

          Hide
          jimtabor
          added a comment -

          Have this already done, just need to commit it. Not here at work.

          Show
          jimtabor
          added a comment - Have this already done, just need to commit it. Not here at work.
          Hide
          HBelusca
          added a comment - - edited

          Oh! Then please assign this issue to you jimtabor!

          Show
          HBelusca
          added a comment - - edited Oh! Then please assign this issue to you jimtabor !
          Hide
          HBelusca
          added a comment -

          CORE-12649_hbm_WIP.patch: this was my work-in-progress patch:

          • I moved NtUserExcludeUpdateRgn from ntuser/ntstubs.c to ntuser/painting.c (and placed it in alphabetical order, after NtUserDrawCaption);
          • I fixed the NtUserExcludeUpdateRgn prototype to return INT instead of DWORD, as it is done for the other NtUserXxx functions that return region complexity values;
          • I added a co_UserExcludeUpdateRgn helper that should do the big work: this is the WIP part that you have certainly implemented.
          Show
          HBelusca
          added a comment - CORE-12649_hbm_WIP.patch : this was my work-in-progress patch: I moved NtUserExcludeUpdateRgn from ntuser/ntstubs.c to ntuser/painting.c (and placed it in alphabetical order, after NtUserDrawCaption ); I fixed the NtUserExcludeUpdateRgn prototype to return INT instead of DWORD, as it is done for the other NtUserXxx functions that return region complexity values; I added a co_UserExcludeUpdateRgn helper that should do the big work: this is the WIP part that you have certainly implemented.
          Hide
          jimtabor
          added a comment -

          Here is the patch modified based on yours. Needs a good test case. One thing is known, it does not produce a Erase and/or NC Paint message like wine does.

          Show
          jimtabor
          added a comment - Here is the patch modified based on yours. Needs a good test case. One thing is known, it does not produce a Erase and/or NC Paint message like wine does.
          Hide
          HBelusca
          added a comment -

          The core of the wine code directly does:

                  GetDCOrgEx( hdc, &pt );
                  MapWindowPoints( 0, hwnd, &pt, 1 );
                  OffsetRgn( update_rgn, -pt.x, -pt.y );
                  ret = ExtSelectClipRgn( hdc, update_rgn, RGN_DIFF );

          i.e. they call ExtSelectClipRgn( hdc, update_rgn, RGN_DIFF ); with RGN_DIFF ?

          Show
          HBelusca
          added a comment - The core of the wine code directly does: GetDCOrgEx( hdc, &pt ); MapWindowPoints( 0, hwnd, &pt, 1 ); OffsetRgn( update_rgn, -pt.x, -pt.y ); ret = ExtSelectClipRgn( hdc, update_rgn, RGN_DIFF ); i.e. they call ExtSelectClipRgn( hdc, update_rgn, RGN_DIFF ); with RGN_DIFF ?
          Hide
          jimtabor
          added a comment - - edited

          I think it is done by;
          NtGdiCombineRgn(hrgn, hrgn, Window->hrgnUpdate, RGN_DIFF);
          wine retrieves the Update region from WM_NCPAINT code.
          Wine;
          INT ret = GetUpdateRgn( hwnd, update_rgn, FALSE );
          then CombineRgn is copied.

          Show
          jimtabor
          added a comment - - edited I think it is done by; NtGdiCombineRgn(hrgn, hrgn, Window->hrgnUpdate, RGN_DIFF); wine retrieves the Update region from WM_NCPAINT code. Wine; INT ret = GetUpdateRgn( hwnd, update_rgn, FALSE ); then CombineRgn is copied.
          Hide
          jimtabor
          added a comment - - edited

          LOL, this code been laying around for years, lost it from a hard drive crash, managed to get it back when the drive decided to work. Quickly copied the whole drive, then had the new hard drive crash the next year and lost everything. Yeah, this patch has been around for a while.

          Show
          jimtabor
          added a comment - - edited LOL, this code been laying around for years, lost it from a hard drive crash, managed to get it back when the drive decided to work. Quickly copied the whole drive, then had the new hard drive crash the next year and lost everything. Yeah, this patch has been around for a while.
          Hide
          jimtabor
          added a comment -

          Test code committed in revision 73888.

          Show
          jimtabor
          added a comment - Test code committed in revision 73888.
          Hide
          HBelusca
          added a comment -

          I'll try to rerun Word/Excel with your commit and see what I get

          Show
          HBelusca
          added a comment - I'll try to rerun Word/Excel with your commit and see what I get
          Hide
          jimtabor
          added a comment -

          I've tested Office Pro 2003 and I did not notice it being called. Is this for 2010 or which one?

          Show
          jimtabor
          added a comment - I've tested Office Pro 2003 and I did not notice it being called. Is this for 2010 or which one?
          Hide
          HBelusca
          added a comment - - edited

          Word/Excel viewer 2007 and Word/Excel 2010 (the viewers are available in our RAPPs).

          Show
          HBelusca
          added a comment - - edited Word/Excel viewer 2007 and Word/Excel 2010 (the viewers are available in our RAPPs).
          Hide
          jimtabor
          added a comment -

          Open a simple test xls file~!

          (../../win32ss/user/ntuser/painting.c:2546) err: Enter NtUserExcludeUpdateRgn
          (../../win32ss/user/ntuser/painting.c:2554) err: Leave NtUserExcludeUpdateRgn, ret=1
          (../../win32ss/user/ntuser/painting.c:2546) err: Enter NtUserExcludeUpdateRgn
          (../../win32ss/user/ntuser/painting.c:2554) err: Leave NtUserExcludeUpdateRgn, ret=1
          

          SS97, does that look okay?

          Show
          jimtabor
          added a comment - Open a simple test xls file~! (../../win32ss/user/ntuser/painting.c:2546) err: Enter NtUserExcludeUpdateRgn (../../win32ss/user/ntuser/painting.c:2554) err: Leave NtUserExcludeUpdateRgn, ret=1 (../../win32ss/user/ntuser/painting.c:2546) err: Enter NtUserExcludeUpdateRgn (../../win32ss/user/ntuser/painting.c:2554) err: Leave NtUserExcludeUpdateRgn, ret=1 SS97, does that look okay?
          Hide
          HBelusca
          added a comment -

          Possibly, but can you try changing the focused cell? Does it still draw a black rectangle shifted wrt. the selected cell?

          Show
          HBelusca
          added a comment - Possibly, but can you try changing the focused cell? Does it still draw a black rectangle shifted wrt. the selected cell?
          Hide
          jimtabor
          added a comment - - edited

          Zoomed (SS98) in and there might be an alignment issue here, not sure if its NtUEUR or stretch BLT. Zoom out the blinking cursor goes to the above row like SS97 shows.
          There are update issues too, while selecting other row cells.

          Show
          jimtabor
          added a comment - - edited Zoomed (SS98) in and there might be an alignment issue here, not sure if its NtUEUR or stretch BLT. Zoom out the blinking cursor goes to the above row like SS97 shows. There are update issues too, while selecting other row cells.
          Hide
          HBelusca
          added a comment -

          Hmm ok, so the NtUserExcludeUpdateRgn might be only one tiny part in the whole issue.

          Show
          HBelusca
          added a comment - Hmm ok, so the NtUserExcludeUpdateRgn might be only one tiny part in the whole issue.
          Hide
          HBelusca
          added a comment -

          Small "example" of usage: http://www.delphigroups.info/3/e6/40448.html
          I'm wondering whether we have some (possibly interactive) tests for ExcludeUpdateRgn.

          Show
          HBelusca
          added a comment - Small "example" of usage: http://www.delphigroups.info/3/e6/40448.html I'm wondering whether we have some (possibly interactive) tests for ExcludeUpdateRgn.
          Hide
          Giannis Adamopoulos
          added a comment -

          I don't think interactive tests are needed to test this.

          Show
          Giannis Adamopoulos
          added a comment - I don't think interactive tests are needed to test this.

            People

            • Assignee:
              jimtabor
              Reporter:
              HBelusca
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: