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@winehq.org Reporter: ghotik2002@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 ... ;)
https://bugs.winehq.org/show_bug.cgi?id=47490
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com
--- Comment #1 from Zebediah Figura z.figura12@gmail.com --- 1.6.2 is ancient; can you please test with 4.0 or newer? See https://wiki.winehq.org/Download.
https://bugs.winehq.org/show_bug.cgi?id=47490
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de Ever confirmed|0 |1 Status|UNCONFIRMED |NEEDINFO
https://bugs.winehq.org/show_bug.cgi?id=47490
--- Comment #2 from ghotik ghotik2002@yahoo.com --- Tested again with wine 4.0.1 on ubuntu 16.04 LTS platform Intel 32 The bug is still there ...
https://bugs.winehq.org/show_bug.cgi?id=47490
Le Gluon du Net legluondunet@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |legluondunet@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=47490
Damjan Jovanovic damjan.jov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |damjan.jov@gmail.com
--- Comment #3 from Damjan Jovanovic damjan.jov@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.
https://bugs.winehq.org/show_bug.cgi?id=47490
--- Comment #4 from Damjan Jovanovic damjan.jov@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
https://bugs.winehq.org/show_bug.cgi?id=47490
--- Comment #5 from Fabian Maurer dark.shadow4@web.de --- Any news on this?