Closed
Bug 396592
Opened 17 years ago
Closed 17 years ago
Drag and drop images from the content area fail
Categories
(Core :: Widget: Win32, defect)
Tracking
()
VERIFIED
FIXED
mozilla1.9beta1
People
(Reporter: jimm, Assigned: jimm)
Details
Attachments
(1 file, 3 obsolete files)
3.08 KB,
patch
|
Details | Diff | Splinter Review |
Vista only, I checked XP and it's working fine. Dragging an image from the content area to the desktop or some other folder you have permissions in fails to copy the image over. The file copy dialog will show, but the file never shows up.
Assignee | ||
Updated•17 years ago
|
Assignee: nobody → jmathies
Assignee | ||
Updated•17 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•17 years ago
|
||
Appears to be caused by our half hearted implementation of IStream in widget/src/windows/nsDataObj.cpp.
Assignee | ||
Comment 2•17 years ago
|
||
Yep, that's it. Stat and Seek need to return valid information.
Assignee | ||
Comment 3•17 years ago
|
||
Assignee | ||
Updated•17 years ago
|
Attachment #281555 -
Flags: review?(emaijala)
Comment 4•17 years ago
|
||
Comment on attachment 281555 [details] [diff] [review] vista drag image patch v.1 Sorry, I can't test Vista yet (I'll try to get it installed in the next week or two...).
Updated•17 years ago
|
Attachment #281555 -
Flags: review?(emaijala) → review?
Comment 5•17 years ago
|
||
Comment on attachment 281555 [details] [diff] [review] vista drag image patch v.1 + PRUint32 nMaxNameLength = (wideFileName.Length()*2) + 2; + void * retBuf = CoTaskMemAlloc(nMaxNameLength); // freed by caller + if (!retBuf) + return STG_E_INSUFFICIENTMEMORY; + + ZeroMemory(retBuf, nMaxNameLength); + wcsncpy(statstg->pwcsName, wideFileName.get(), nMaxNameLength); This is wrong, retBuf is allocated but wcsncpy's destination is statstg->pwcsName. Why ZeroMemory as you're allocating just what's needed? + if (!mChannel) + return E_NOTIMPL; . . . + if (mChannel) + mChannel->GetContentLength(&nLength); Which one did you mean? Return error if !mChannel or return what's possible. I'd go for the latter. Also, wouldn't E_FAIL be the correct return value instead of E_NOTIMPL in the error cases?
Attachment #281555 -
Flags: review? → review-
Assignee | ||
Comment 6•17 years ago
|
||
>This is wrong, retBuf is allocated but wcsncpy's destination is
>statstg->pwcsName. Why ZeroMemory as you're allocating just what's needed?
I'm adding a character on the end, and zeroing out the entire buffer to null terminate it. There's really no harm in that afaict. I'll fix the buffer issue and repost here in a sec.
Assignee | ||
Comment 7•17 years ago
|
||
This addresses the missing buffer asignment. I've also changed the not implemented returns to E_FAIL.
Attachment #281555 -
Attachment is obsolete: true
Assignee | ||
Updated•17 years ago
|
Attachment #284002 -
Flags: review?(emaijala)
Comment 8•17 years ago
|
||
Comment on attachment 284002 [details] [diff] [review] vista drag image patch v.2 r=emaijala
Attachment #284002 -
Flags: review?(emaijala) → review+
Assignee | ||
Updated•17 years ago
|
Flags: blocking-firefox3?
Assignee | ||
Updated•17 years ago
|
Attachment #284002 -
Flags: superreview?(roc)
Updated•17 years ago
|
Flags: blocking-firefox3? → blocking-firefox3+
+ if (nMove.LowPart == 0 && + nNewPos && + (dwOrigin == STREAM_SEEK_SET || dwOrigin == STREAM_SEEK_CUR)) { + nNewPos->LowPart = NULL; + nNewPos->HighPart = NULL; + return S_OK; + } Shouldn't we test nMove.HighPart == 0 as well? Shouldn't we return S_OK even when nNewPos is null? (or should we return some other error in that case?) And shouldn't those NULLs be 0s? + wcsncpy((wchar_t *)retBuf, wideFileName.get(), wideFileName.Length()); Can't we just use memcpy here? + SystemTimeToFileTime((const SYSTEMTIME*)&st, (LPFILETIME)&statstg->ctime); + SystemTimeToFileTime((const SYSTEMTIME*)&st, (LPFILETIME)&statstg->atime); Can't these just be "*statstg->ctime = *statstg->atime = *statstg->mtime;"?
Assignee | ||
Comment 10•17 years ago
|
||
>Shouldn't we test nMove.HighPart updated. >Shouldn't we return S_OK even when nNewPos is null? msdn suggested we use STG_E_INVALIDPOINTER. >Can't we just use memcpy here? updated. >"*statstg->ctime = *statstg->atime = *statstg->mtime;"? updated (without the dreferences which weren't needed).
Attachment #285235 -
Flags: superreview?(roc)
Assignee | ||
Updated•17 years ago
|
Attachment #284002 -
Flags: superreview?(roc)
Assignee | ||
Comment 11•17 years ago
|
||
sorry, minor touch up, removed the unneeded nNewPos check in the if statement.
Attachment #285235 -
Flags: superreview?(roc) → superreview+
Assignee | ||
Updated•17 years ago
|
Attachment #284002 -
Attachment is obsolete: true
Assignee | ||
Updated•17 years ago
|
Attachment #285235 -
Attachment is obsolete: true
Assignee | ||
Updated•17 years ago
|
Keywords: checkin-needed
Updated•17 years ago
|
Component: OS Integration → Widget: Win32
Flags: blocking-firefox3+
Product: Firefox → Core
QA Contact: os.integration → win32
Target Milestone: --- → mozilla1.9 M9
Comment 13•17 years ago
|
||
Checking in widget/src/windows/nsDataObj.cpp; /cvsroot/mozilla/widget/src/windows/nsDataObj.cpp,v <-- nsDataObj.cpp new revision: 1.85; previous revision: 1.84 done
I tested: * email addresses (shortcut created was a mailto:) * links (shortcut created was a hyperlink) * images (the raw image was copied to the desktop, to where I dragged it) Verified FIXED using Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9a9pre) Gecko/2007102407 Minefield/3.0a9pre
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•