Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-8627

AHK: Word Viewer 2003 copy test causes a crash

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • None
    • None
    • VMWare Workstation 10.0.0 build-1295980

    Description

      https://reactos.org/sites/all/modules/reactos/testman/detail.php?id=16407056&prev=16399684

      I have tried to figure out what is going on and I noticed that the test doesn't crash here locally, but test fails. I tried doing it manually and there is what I have found out:

      Copying text in notepad:
      (win32ss/user/ntuser/focus.c:578) err: Mouse Active
      (win32ss/user/ntuser/focus.c:578) err: Mouse Active
      err:(win32ss/user/user32/windows/clipboard.c:303) Edijs: here1
      err:(win32ss/user/user32/windows/clipboard.c:315) Edijs: here2
      err:(win32ss/user/user32/windows/clipboard.c:325) Edijs: here3
      err:(win32ss/user/user32/windows/clipboard.c:328) Edijs: here4
      err:(win32ss/user/user32/windows/clipboard.c:338) Edijs: here5 00000000
      err:(win32ss/user/user32/windows/clipboard.c:344) Edijs: here6 00110194
      err:(win32ss/user/user32/windows/clipboard.c:349) Edijs: here == 00110194
      err:(win32ss/user/user32/windows/clipboard.c:364) Edijs: here8

      Pasting text in notepad:
      (win32ss/user/ntuser/focus.c:578) err: Mouse Active

      Copying text from doc:
      (win32ss/user/ntuser/focus.c:578) err: Mouse Active
      (win32ss/user/ntuser/focus.c:578) err: Mouse Active
      (win32ss/user/ntuser/focus.c:578) err: Mouse Active
      err:(win32ss/user/user32/windows/clipboard.c:303) Edijs: here1
      err:(win32ss/user/user32/windows/clipboard.c:315) Edijs: here2
      err:(win32ss/user/user32/windows/clipboard.c:325) Edijs: here3
      err:(win32ss/user/user32/windows/clipboard.c:328) Edijs: here4
      err:(win32ss/user/user32/windows/clipboard.c:338) Edijs: here5 00000000
      err:(win32ss/user/user32/windows/clipboard.c:344) Edijs: here6 00120194
      err:(win32ss/user/user32/windows/clipboard.c:349) Edijs: here == 00120194
      err:(win32ss/user/user32/windows/clipboard.c:364) Edijs: here8
      err:(win32ss/user/user32/windows/clipboard.c:303) Edijs: here1
      err:(win32ss/user/user32/windows/clipboard.c:315) Edijs: here2
      err:(win32ss/user/user32/windows/clipboard.c:325) Edijs: here3
      err:(win32ss/user/user32/windows/clipboard.c:328) Edijs: here4
      err:(win32ss/user/user32/windows/clipboard.c:338) Edijs: here5 00000000
      err:(win32ss/user/user32/windows/clipboard.c:344) Edijs: here6 009301D4
      err:(win32ss/user/user32/windows/clipboard.c:349) Edijs: here == 009301D4
      err:(win32ss/user/user32/windows/clipboard.c:364) Edijs: here8
      err:(win32ss/user/user32/windows/clipboard.c:303) Edijs: here1
      err:(win32ss/user/user32/windows/clipboard.c:315) Edijs: here2
      err:(win32ss/user/user32/windows/clipboard.c:325) Edijs: here3
      err:(win32ss/user/user32/windows/clipboard.c:328) Edijs: here4
      err:(win32ss/user/user32/windows/clipboard.c:338) Edijs: here5 00000000
      err:(win32ss/user/user32/windows/clipboard.c:344) Edijs: here6 00D501E8
      err:(win32ss/user/user32/windows/clipboard.c:349) Edijs: here == 00D501E8
      err:(win32ss/user/user32/windows/clipboard.c:364) Edijs: here8

      Pasting text to notepad:
      (win32ss/user/ntuser/focus.c:578) err: Mouse Active
      (win32ss/user/ntuser/focus.c:578) err: Mouse Active
      err:(win32ss/user/user32/windows/clipboard.c:303) Edijs: here1
      err:(win32ss/user/user32/windows/clipboard.c:315) Edijs: here2
      err:(win32ss/user/user32/windows/clipboard.c:325) Edijs: here3
      err:(win32ss/user/user32/windows/clipboard.c:328) Edijs: here4
      err:(win32ss/user/user32/windows/clipboard.c:338) Edijs: here5 00000000
      (win32ss/user/ntuser/clipboard.c:939) err: Access denied!
      err:(win32ss/user/user32/windows/clipboard.c:344) Edijs: here6 00000000
      err:(win32ss/user/user32/windows/clipboard.c:364) Edijs: here8
      err:(win32ss/user/user32/windows/clipboard.c:367) Edijs: err
      err:(win32ss/user/user32/windows/clipboard.c:368) SetClipboardData(13, 007800D4) failed

      HANDLE
      WINAPI
      SetClipboardData(UINT uFormat, HANDLE hMem)
      {
      DWORD dwSize;
      HANDLE hGlobal;
      LPVOID pMem;
      HANDLE hRet = NULL;
      SETCLIPBDATA scd =

      {FALSE, FALSE}

      ;

      /* Check if this is delayed render */
      if (hMem == NULL)
      return NtUserSetClipboardData(uFormat, NULL, &scd);

      ERR("Edijs: here1\n");
      if (hMem <= (HANDLE)4)
      SetLastError(ERROR_INVALID_PARAMETER);
      /* Bitmaps and palette does not use global handles */
      else if (uFormat == CF_BITMAP || uFormat == CF_DSPBITMAP || uFormat == CF_PALETTE)
      hRet = NtUserSetClipboardData(uFormat, hMem, &scd);
      /* Meta files are probably checked for validity */
      else if (uFormat == CF_DSPMETAFILEPICT || uFormat == CF_METAFILEPICT ||
      uFormat == CF_DSPENHMETAFILE || uFormat == CF_ENHMETAFILE)
      hRet = NULL; // not supported yet
      else
      {
      ERR("Edijs: here2\n");
      /* Some formats accept only global handles, other accept global handles or integer values */
      pMem = GlobalLock(hMem);
      dwSize = GlobalSize(hMem);

      if (pMem || uFormat == CF_DIB || uFormat == CF_DIBV5 ||
      uFormat == CF_DSPTEXT || uFormat == CF_LOCALE ||
      uFormat == CF_OEMTEXT || uFormat == CF_TEXT ||
      uFormat == CF_UNICODETEXT)
      {
      ERR("Edijs: here3\n");
      if (pMem)
      {
      ERR("Edijs: here4\n");
      /* This is a local memory. Make global memory object */
      hGlobal = NtUserConvertMemHandle(pMem, dwSize);

      /* Unlock memory */
      GlobalUnlock(hMem);
      /* FIXME: free hMem when CloseClipboard is called */

      if (hGlobal)

      { ERR("Edijs: here5 %p\n", hRet); /* Save data */ scd.fGlobalHandle = TRUE; hRet = NtUserSetClipboardData(uFormat, hGlobal, &scd); }

      ERR("Edijs: here6 %p\n", hRet);
      /* On success NtUserSetClipboardData returns pMem
      however caller expects us to return hMem */
      if (hRet == hGlobal)

      { ERR("Edijs: here == %p\n", hRet); hRet = hMem; }

      }
      else
      SetLastError(ERROR_INVALID_HANDLE);
      }
      else

      { ERR("Edijs: here7\n"); /* Save a number */ hRet = NtUserSetClipboardData(uFormat, hMem, &scd); }

      }

      ERR("Edijs: here8 %u\n", uFormat);
      if (!hRet)

      { ERR("Edijs: err\n"); ERR("SetClipboardData(%u, %p) failed\n", uFormat, hMem); }

      return hRet;
      }

      As you can see when pasting doc text somewhy paste calls SetClipboardData. If you ask me, that sounds odd.

      r64698

      Attachments

        Issue Links

          Activity

            People

              bug zilla Bug Zilla
              EDIJS EDIJS
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: