[Bug 47490] New: GlobalLock different behavior
https://bugs.winehq.org/show_bug.cgi?id=47490 Bug ID: 47490 Summary: GlobalLock different behavior Product: Wine Version: 1.6.2 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs(a)winehq.org Reporter: ghotik2002(a)yahoo.com Distribution: --- Different behavior of GlobalLock in DxWnd GUI routine. This is an extract of source code: IStream *pStream = 0; CreateStreamOnHGlobal(0, TRUE, &pStream); LONG cbSize = 0; hr = pPicture->SaveAsFile(pStream, TRUE, &cbSize); if(FAILED(hr)) { OutTrace("GrayIcon: SveAsFile error hr=%#x\n", hr); return NULL; } HGLOBAL hBuf = 0; hr = GetHGlobalFromStream(pStream, &hBuf); if(FAILED(hr)) { OutTrace("GrayIcon: GetHGlobalFromStream error hr=%#x\n", hr); return NULL; } buf = (BYTE *)GlobalLock(hBuf); if(buf == NULL) { OutTrace("GrayIcon: GlobalLock error err=%d\n", GetLastError()); return NULL; } the stream holds an icon picture, everything is ok but the GlobalLock call: - in Windows it returns a valid memory address - in Wine/Linux it returns NULL errno 157 ERROR_DISCARDED - The segment is already discarded and cannot be locked. All this is in DxWnd program run on Wine/Linux environment. P.s. my first bug report here - hope everything is more or less ok ... ;) -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=47490 Zebediah Figura <z.figura12(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12(a)gmail.com --- Comment #1 from Zebediah Figura <z.figura12(a)gmail.com> --- 1.6.2 is ancient; can you please test with 4.0 or newer? See <https://wiki.winehq.org/Download>. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=47490 Fabian Maurer <dark.shadow4(a)web.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4(a)web.de Ever confirmed|0 |1 Status|UNCONFIRMED |NEEDINFO -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=47490 --- Comment #2 from ghotik <ghotik2002(a)yahoo.com> --- Tested again with wine 4.0.1 on ubuntu 16.04 LTS platform Intel 32 The bug is still there ... -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=47490 Le Gluon du Net <legluondunet(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |legluondunet(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=47490 Damjan Jovanovic <damjan.jov(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |damjan.jov(a)gmail.com --- Comment #3 from Damjan Jovanovic <damjan.jov(a)gmail.com> --- Created attachment 65492 --> https://bugs.winehq.org/attachment.cgi?id=65492 standalone test I copied your code and changing it to C, made it take a path to the image as its first command line parameter, and write the image to /tmp/test.bmp at the end. Not only does it work, but the input and output images are byte-for-byte identical. The problem must be earlier in your code, where you load/generate the image. Please attach that part of your code too. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=47490 --- Comment #4 from Damjan Jovanovic <damjan.jov(a)gmail.com> --- (In reply to Damjan Jovanovic from comment #3)
Created attachment 65492 [details] standalone test
I copied your code and changing it to C
Built with mingw-w64, command: gcc lockpic.c -o lockpic.exe -loleaut32 -luuid -lole32 -lshlwapi -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=47490 --- Comment #5 from Fabian Maurer <dark.shadow4(a)web.de> --- Any news on this? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (2)
-
wine-bugs@winehq.org -
WineHQ Bugzilla