[Webkit-unassigned] [Bug 29666] ClipboardWin::files() isn't implemented in Windows
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Oct 19 08:33:36 PDT 2009
https://bugs.webkit.org/show_bug.cgi?id=29666
Adam Roben (aroben) <aroben at apple.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #41405|review? |review-
Flag| |
--- Comment #11 from Adam Roben (aroben) <aroben at apple.com> 2009-10-19 08:33:35 PDT ---
(From update of attachment 41405)
> + STGMEDIUM medium;
> + if (FAILED(m_dataObject->GetData(cfHDropFormat(), &medium)))
> + return files.release();
> +
> + HDROP hdrop = reinterpret_cast<HDROP>(GlobalLock(medium.hGlobal));
> + if (!hdrop)
> + return files.release();
> +
> + WCHAR filename[MAX_PATH];
> + UINT fileCount = DragQueryFileW(hdrop, 0xFFFFFFFF, 0, 0);
> + for (UINT i = 0; i < fileCount; i++) {
> + if (!DragQueryFileW(hdrop, i, filename, ARRAYSIZE(filename)))
> + continue;
> + files->append(File::create(reinterpret_cast<UChar*>(filename)));
> + }
> +
> + ReleaseStgMedium(&medium);
> + GlobalUnlock(medium.hGlobal);
I think you should reverse the calls to ReleaseStgMedium and GlobalUnlock here.
Otherwise you're using the medium after releasing it, which, while it may
happen to work, doesn't seem like a good thing to do.
Once that's fixed, I think we're good to go!
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list