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 ... ;)