Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
c559f3fc
Commit
c559f3fc
authored
Feb 12, 2001
by
James Abbatiello
Committed by
Alexandre Julliard
Feb 12, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
In CreateDIBSection, the offset into the file mapping does not have to
be a multiple of the memory allocation granularity.
parent
e19c60ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
4 deletions
+23
-4
dib.c
graphics/x11drv/dib.c
+17
-3
dib.c
objects/dib.c
+6
-1
No files found.
graphics/x11drv/dib.c
View file @
c559f3fc
...
...
@@ -3793,6 +3793,7 @@ HBITMAP X11DRV_DIB_CreateDIBSection(
BITMAPINFOHEADER
*
bi
=
&
bmi
->
bmiHeader
;
INT
effHeight
,
totalSize
;
BITMAP
bm
;
LPVOID
mapBits
=
NULL
;
TRACE
(
"format (%ld,%ld), planes %d, bpp %d, size %ld, colors %ld (%s)
\n
"
,
bi
->
biWidth
,
bi
->
biHeight
,
bi
->
biPlanes
,
bi
->
biBitCount
,
...
...
@@ -3814,8 +3815,21 @@ HBITMAP X11DRV_DIB_CreateDIBSection(
?
bi
->
biSizeImage
:
bm
.
bmWidthBytes
*
effHeight
;
if
(
section
)
bm
.
bmBits
=
MapViewOfFile
(
section
,
FILE_MAP_ALL_ACCESS
,
0L
,
offset
,
totalSize
);
{
SYSTEM_INFO
SystemInfo
;
DWORD
mapOffset
;
INT
mapSize
;
GetSystemInfo
(
&
SystemInfo
);
mapOffset
=
offset
-
(
offset
%
SystemInfo
.
dwAllocationGranularity
);
mapSize
=
totalSize
+
(
offset
-
mapOffset
);
mapBits
=
MapViewOfFile
(
section
,
FILE_MAP_ALL_ACCESS
,
0L
,
mapOffset
,
mapSize
);
bm
.
bmBits
=
(
char
*
)
mapBits
+
(
offset
-
mapOffset
);
}
else
if
(
ovr_pitch
&&
offset
)
bm
.
bmBits
=
(
LPVOID
)
offset
;
else
{
...
...
@@ -3916,7 +3930,7 @@ HBITMAP X11DRV_DIB_CreateDIBSection(
if
(
bm
.
bmBits
)
{
if
(
section
)
UnmapViewOfFile
(
bm
.
bm
Bits
),
bm
.
bmBits
=
NULL
;
UnmapViewOfFile
(
map
Bits
),
bm
.
bmBits
=
NULL
;
else
if
(
!
offset
)
VirtualFree
(
bm
.
bmBits
,
0L
,
MEM_RELEASE
),
bm
.
bmBits
=
NULL
;
}
...
...
objects/dib.c
View file @
c559f3fc
...
...
@@ -930,7 +930,12 @@ void DIB_DeleteDIBSection( BITMAPOBJ *bmp )
if
(
dib
->
dsBm
.
bmBits
)
{
if
(
dib
->
dshSection
)
UnmapViewOfFile
(
dib
->
dsBm
.
bmBits
);
{
SYSTEM_INFO
SystemInfo
;
GetSystemInfo
(
&
SystemInfo
);
UnmapViewOfFile
(
(
char
*
)
dib
->
dsBm
.
bmBits
-
(
dib
->
dsOffset
%
SystemInfo
.
dwAllocationGranularity
)
);
}
else
if
(
!
dib
->
dsOffset
)
VirtualFree
(
dib
->
dsBm
.
bmBits
,
0L
,
MEM_RELEASE
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment