http://bugs.winehq.com/show_bug.cgi?id=1534
Summary: CreateBitmap is supposed to return the stock object
Product: Wine
Version: unspecified
Platform: Other
OS/Version: other
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: wine-gdi
AssignedTo: wine-bugs(a)winehq.com
ReportedBy: pete_a90(a)hotmail.com
Note, I don't have wine but I use the source code as a reference because msdn
is terrible at times. I noticed that the author of CreateCompatibleBitmap and
CreateBitmap (and CreateBitmapIndirect too but that calls CreateBitmap
directly) misinterpreted the gdi documentation. It returns *the* (as in
GetStockObject(DEFALT_BITMAP) in wine) handle to a 1x1
monochrome bitmap if the width or height is 0. Here is some test code that I
wrote in windows that verifies this is true:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
int main()
{
HDC screenDC = GetDC(0);
HDC hdc = CreateCompatibleDC(screenDC);
// all of these are the stock (in wine) monochrome bitmap
HBITMAP bm = CreateCompatibleBitmap(hdc, 0, 0);
HBITMAP bm1 = CreateCompatibleBitmap(hdc, 0, 0);
HBITMAP bm4 = CreateBitmap(0, 1, 0, 0, 0);
HBITMAP bm5 = CreateDiscardableBitmap(hdc, 0, 0);
HBITMAP curObj = (HBITMAP)GetCurrentObject(hdc, OBJ_BITMAP);
HBITMAP bm2 = CreateCompatibleBitmap(hdc, 1, 1);
HBITMAP bm3 = CreateBitmap(1, 1, 1, 1, 0);
HBITMAP old = (HBITMAP)SelectObject(hdc, (HGDIOBJ)bm2);
SelectObject(hdc, (HGDIOBJ)old);
// old == the stock monochrome bitmaps above
{
HBITMAP screenBM = (HBITMAP)GetCurrentObject(screenDC,
OBJ_BITMAP);
// weird: screenBM != bm
BITMAP bitmap1;
int ret = GetObject(screenBM, 0, 0); // returns sizeof(BITMAP)
BITMAP bitmap2;
memset(&bitmap1, 0xDA, sizeof(bitmap1));
ret = GetObject(screenBM, ret, &bitmap1);
// ret = 0, doesn't touch bitmap1 at all.
ret = GetObject(bm, sizeof(bitmap2), &bitmap2);
// ret = 18, bitmap2 is filled in with the monochrome bitmap info
}
DeleteObject(bm);
DeleteObject(bm1);
DeleteObject(bm2);
DeleteObject(bm3);
DeleteObject(bm4);
DeleteObject(bm5);
DeleteDC(hdc);
ReleaseDC(0, screenDC);
return 0;
}
Looks like an easy fix though (don't quote me on that since I don't use linux
and I don't have a local copy of the code [sorry for no path either]):
In CreateCompatibleBitmap replace the following:
/* MS doc says if width or height is 0, return 1-by-1 pixel, monochrome bitmap
*/
if (!width || !height)
hbmpRet = CreateBitmap( 1, 1, 1, 1, NULL );
else
hbmpRet = CreateBitmap( width, height, 1, dc->bitsPerPixel, NULL );
with just:
hbmpRet = CreateBitmap( width, height, 1, dc->bitsPerPixel, NULL );
and in CreateBitmap replace:
if (!height || !width)
{
height = 1;
width = 1;
planes = 1;
bpp = 1;
}
with:
if (!height || !width)
return GetStockObject(DEFAULT_BITMAP);
--
Configure bugmail: http://bugs.winehq.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.winehq.com/show_bug.cgi?id=268
------- Additional Comments From spetreolle(a)yahoo.fr 2003-20-06 14:49 -------
Wojciech,
now you could try with 20030618...
many improvements have been made into the directx library these times...
--
Configure bugmail: http://bugs.winehq.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.winehq.com/show_bug.cgi?id=268
lionel.ulmer(a)free.fr changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
------- Additional Comments From lionel.ulmer(a)free.fr 2003-20-06 13:47 -------
Could you attach a +ddraw trace (--debugmsg +ddraw) to the bug ?
I'm curious to see what kind of surface the game requests...
--
Configure bugmail: http://bugs.winehq.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.winehq.com/show_bug.cgi?id=900
------- Additional Comments From z_god(a)wanadoo.nl 2003-20-06 08:19 -------
Bug comments restored from Gmane.org:
Upon upgrading from 20020605 to 20020710, whenever I try to use ORcad Capture (a
part of the PSpice Lite software), I get window popup with a tilebar of DSM0006
and an error message unable to save <the file I was trying to create> and on the
next line, "system error". What's interesting is the file does get created, but
the program refuses to register that it exists (still prompts me to save unsaved
stuff. If you need more detailed information, please e-mail back. Thankyou
--Greg
------- Additional Comments From tony_lambregts <at> telusplanet.net 2002-07-20
15:46 -------
This is a regression bug from your description. As bugs go this is easy to find
and fix using regression testing as outlined in the following link:
http://www.winehq.org/Docs/wine-devel/cvs-regression.shtml
If there is a downloadable version of this program then it is possible for
someone else to do the regression testing. If there isn't then it is up to you.
------- Additional Comments From hogger2 <at> mushworld.dnsart.com 2002-07-21
11:28 -------
There is no download for this program, however there is a for to fill out to get
the lite version on cd mailed to you for free. This is the version I used. I
have a relatively old computer, so regression testing would be very very time
consuming. However below is the url to the form to get a copy of the cd for
anyone willing to help.
http://www.cadencepcb.com/products/downloads/orcaddemo/frmorcaddemocd.asp
------- Additional Comments From tony_lambregts <at> telusplanet.net 2002-07-21
12:23 -------
Out of curiosity how old is your computer? I do regression testing all the time
on mine.
P233 with 96 mb RAM and 40GB hardDrive. I did regression testing with a 3GB
harddrive and 32 mb ram using the same computer.
Yes it is time consuming but you can use your computer while it is doing a
compile. With the timeframe you are talking about it should take at most 6
itinerations to narrow it down to the day the patch was applied.
------- Additional Comments From hogger2 <at> mushworld.dnsart.com 2002-07-22
15:34 -------
I've got a 233 with 64 megs of ram. THe CPU is ok for compiling in the
background. THe memory is a big problem, as is my only 16 GB of storage space
(of which, 800 MB is currently free. I do video recording with real time
compression on my computer, so I need all the CPU power I can get. Also, with
mozilla taking up 30 MB of memory, openoffice another 20MB, memory gets a bit
tight on this college workhorse. I've got summer school finals coming up right
now so I can't do much of my own testing. Upgrading from Debian potato to Debian
Woody is my next project. My main constraint though is the disk space.
------- Additional Comments From tony_lambregts <at> telusplanet.net 2002-07-22
16:48 -------
OK, I sent away for the cd and will do the testing when it gets here. They say
about 2 weeks or less.
Ok Thanks alot. I've just upgraded to woody, and I've run into some
pressing problems that require immediate attention. But I'll be glad to
tell you the steps I use to determine if the software works if you like.
--Greg
------- Additional Comments From tony_lambregts <at> telusplanet.net 2002-07-31
14:36 -------
I was able to install Capture, Layout and PSpice with the following setup
wine snapshot 20020605
[Version] "windows" = "win98" (in .wine/config)
actual windows installed win98
I could not install this program using the current CVS so I should start another
bug for that. Also I had trouble installing it useing other windows versions
"NT40" and "win2k" sort of worked but gave me too many problems probably due to
not actualy having nt40 or win2k dlls
If you could give a step by step procedure to reproduce the bug I would
appreciate it.
------- Additional Comments From tony_lambregts <at> telusplanet.net 2002-08-01
10:20 -------
I have no idea on how to reproduce the error you described, Wine snapshot
20020710
------- Additional Comments From tony_lambregts <at> telusplanet.net 2002-11-10
09:07 -------
I recieved these instructions about a month ago but things got in the way.
Once installed, however, you should create a new project by
going file-new. type in a project name, and select "Analog or Mixed A/D".
The location needs to be specified, but can be anywhere you want the
program to create it's data files for this project. After hitting ok,
select "Create a blank Project". At this point, it should take you to a
work space with a big white screen. But on the newer versions of wine, it
will bring up the error message before reaching this screen.
--
Configure bugmail: http://bugs.winehq.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.winehq.com/show_bug.cgi?id=899
------- Additional Comments From z_god(a)wanadoo.nl 2003-20-06 08:16 -------
Bug comments restored from Gmane.org:
Well. I've runned myself some starcraft 1.00. But there is a problem. When the
window get's created I have no graphics. The game itself "thinks" everything is
ok though. Now if I have Desktop commented out and "Managed" = "Y" it's kind of
easy to get the graphics working. Simply switching focus to another window, and
then clicking back on starcrafts window get's the graphics back. IMHO this has
something to do with some messages (wm_paint?) not being sent to the starcraft
window upon creation.
Note1: twm has the same behaviour :)
Note2: same thing with a snapshot from 200204 and current cvs winex. So this has
to be old.
Note3: guess what happens when I turn "DXGrab" = "Y". Alt+Tab doesn't work, and
I'm blind enough not to be able to get out of starcraft :) Thank Linus for SysRq :)
--
Configure bugmail: http://bugs.winehq.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.winehq.com/show_bug.cgi?id=898
------- Additional Comments From z_god(a)wanadoo.nl 2003-20-06 08:15 -------
Bug comments restored from Gmane.org:
fixme:dc:GetDCEx not supported yet on other process window 10021
--
Configure bugmail: http://bugs.winehq.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.winehq.com/show_bug.cgi?id=897
------- Additional Comments From z_god(a)wanadoo.nl 2003-20-06 08:15 -------
Bug comments restored from Gmane.org:
The make target [winetest.exe.spec.c] does not compile. Winebuild has an
unrecognized option "-s" error.
--
Configure bugmail: http://bugs.winehq.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.winehq.com/show_bug.cgi?id=896
------- Additional Comments From z_god(a)wanadoo.nl 2003-20-06 08:14 -------
Bug comments restored from Gmane.org:
I've got Wine 20020605 and Terragen 0.8.44. Almost everything is working - including
rendering -
except the following operations "lock up" WineTerragen execution. Landscape ->
Surface
Map -> Edit Color, Landscape -> Surface Map -> Tex, Cloudscape -> Edit Cloud Color,
Water
-> Edit Diffuse/Transparent Color. Process kill is the only recovery, back to the
console
terminal.Another clue - Builtin COMCTL32.DLL gives landscape sculpture buttons but
no main window
left column child-window buttons. Native COMCTL32.DLL gives no landscape
sculpture buttons, but does
give main window left column child-window buttons properly.Already installed
DCOM95.exe and ran
regsvr32 OLEAUT32.DLL in the application directory. Thanks!
------- Additional Comments From fgouget <at> codeweavers.com 2002-07-19 19:40
-------
*** This bug has been marked as a duplicate of 894 ***
------- Additional Comments From apa3a <at> yahoo.com 2002-07-22 10:19 -------
Close
--
Configure bugmail: http://bugs.winehq.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.winehq.com/show_bug.cgi?id=895
------- Additional Comments From z_god(a)wanadoo.nl 2003-20-06 08:13 -------
Bug comments restored from Gmane.org:
I've got Wine 20020605 and Terragen 0.8.44. Almost everything is working - including
rendering -
except the following operations "lock up" WineTerragen execution. Landscape ->
Surface
Map -> Edit Color, Landscape -> Surface Map -> Tex, Cloudscape -> Edit Cloud Color,
Water
-> Edit Diffuse/Transparent Color,Process kill is the only recovery, back to the console
terminal.Another clue - Builtin COMCTL32.DLL gives landscape sculpture buttons but
no main window
left column child-window buttons. Native COMCTL32.DLL gives no landscape
sculpture buttons, but does
give main window left column child-window buttons properly.Already installed
DCOM95.exe and ran
regsvr32 OLEAUT32.DLL in the application directory. Thanks!
------- Additional Comments From fgouget <at> codeweavers.com 2002-07-19 19:40
-------
*** This bug has been marked as a duplicate of 894 ***
------- Additional Comments From apa3a <at> yahoo.com 2002-07-22 10:19 -------
Close
--
Configure bugmail: http://bugs.winehq.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.winehq.com/show_bug.cgi?id=894
------- Additional Comments From z_god(a)wanadoo.nl 2003-20-06 08:12 -------
Bug comments restored from Gmane.org:
I've got Wine 20020605 and Terragen 0.8.44. Almost everything is working - including
rendering -
except the following operations "lock up" WineTerragen execution. Landscape ->
Surface
Map -> Edit Color Landscape -> Surface Map -> Tex Cloudscape -> Edit Cloud Color
Water
-> Edit Diffuse/Transparent ColorProcess kill is the only recovery, back to the console
terminal.Another clue - Builtin COMCTL32.DLL gives landscape sculpture buttons but
no main window
left column child-window buttons. Native COMCTL32.DLL gives no landscape
sculpture buttons, but does
give main window left column child-window buttons properly.Already installed
DCOM95.exe and ran
regsvr32 OLEAUT32.DLL in the application directory. Thanks!
------- Additional Comments From fgouget <at> codeweavers.com 2002-07-19 19:33
-------
The original URL was: http://www.bowlvisions.com/
???
I replaced it with the URL of the Terragen download page.
------- Additional Comments From fgouget <at> codeweavers.com 2002-07-19 19:40
-------
*** Bug 895 has been marked as a duplicate of this bug. ***
--
Configure bugmail: http://bugs.winehq.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.