PC Review


Reply
Thread Tools Rate Thread

Bug in mspaint.exe found

 
 
mdjr
Guest
Posts: n/a
 
      18th Apr 2009
Hello.

I found a bug in MSPAINT.EXE. A MS employee told me to post it here but I do
not know if this forum is the correct one:

When starting MS Paint the program will calculate the display resolution
using the following formula:
pixels_per_meter_X = 1000*screen_width_in_pixels/screen_width_in_millimeters
The same is done for the Y-Direction.

Unfortunately in some cases (in my case I had a video projector connected to
my Laptop) the GetDeviceCaps() function returns a screen width and height of
0 millimeters. This will cause the mspaint.exe application to crash because
of a division-by-zero exception.

My suggestion is to change mspaint.exe the following way:
if(screen_width_in_millimeters>MINIMUM_WIDTH)
pixels_per_meter_X = ...
else pixels_per_meter_X = DEFAULT_RES;

The bug occurred in Windows XP but a look at the disassembly of mspaint.exe
in Windows Vista showed that it is also present in Windows Vista.

Martin

 
Reply With Quote
 
 
 
 
Gurpreet Singh
Guest
Posts: n/a
 
      18th Apr 2009
I don't know how many people would be using a projector to use/draw in
MSpaint. Also not sure if all projectors being used like this would be
returning a zero to cause that devide by zero error. It would be interesting
to do a repro of the issue though, will try it today.

Do you have a user dump of the mspaint process for reviewing.

Your MS friend would have known a better forum to have the issue addressed,
this may not be the right forum to submit such a bug.
--
Regards
Gurpreet Singh


"mdjr" wrote:

> Hello.
>
> I found a bug in MSPAINT.EXE. A MS employee told me to post it here but I do
> not know if this forum is the correct one:
>
> When starting MS Paint the program will calculate the display resolution
> using the following formula:
> pixels_per_meter_X = 1000*screen_width_in_pixels/screen_width_in_millimeters
> The same is done for the Y-Direction.
>
> Unfortunately in some cases (in my case I had a video projector connected to
> my Laptop) the GetDeviceCaps() function returns a screen width and height of
> 0 millimeters. This will cause the mspaint.exe application to crash because
> of a division-by-zero exception.
>
> My suggestion is to change mspaint.exe the following way:
> if(screen_width_in_millimeters>MINIMUM_WIDTH)
> pixels_per_meter_X = ...
> else pixels_per_meter_X = DEFAULT_RES;
>
> The bug occurred in Windows XP but a look at the disassembly of mspaint.exe
> in Windows Vista showed that it is also present in Windows Vista.
>
> Martin
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Entry Point Not Found - MSPAINT.EXE - IMM32.DLL vpnavy@gmail.com Windows XP General 8 31st May 2008 06:31 PM
MSPaint Marilyn and Bob Windows XP General 7 17th Aug 2004 09:50 PM
mspaint vivian williamson Windows XP General 0 9th Apr 2004 03:20 PM
mspaint noobish Windows XP General 1 24th Jan 2004 08:41 PM
MSPAINT David Microsoft Windows 2000 Multimedia 0 4th Sep 2003 05:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:11 AM.