Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
284c9b92
Commit
284c9b92
authored
Apr 11, 1999
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made SELECTOR_ReallocBlock preserve the current selector access rights
(problem reported by Andreas Mohr).
parent
06bcab8a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
selectors.h
include/selectors.h
+1
-3
global.c
memory/global.c
+2
-2
selector.c
memory/selector.c
+5
-3
No files found.
include/selectors.h
View file @
284c9b92
...
...
@@ -13,9 +13,7 @@
extern
WORD
SELECTOR_AllocBlock
(
const
void
*
base
,
DWORD
size
,
enum
seg_type
type
,
BOOL
is32bit
,
BOOL
readonly
);
extern
WORD
SELECTOR_ReallocBlock
(
WORD
sel
,
const
void
*
base
,
DWORD
size
,
enum
seg_type
type
,
BOOL
is32bit
,
BOOL
readonly
);
extern
WORD
SELECTOR_ReallocBlock
(
WORD
sel
,
const
void
*
base
,
DWORD
size
);
extern
void
SELECTOR_MoveBlock
(
WORD
sel
,
const
void
*
new_base
);
extern
void
SELECTOR_FreeBlock
(
WORD
sel
,
WORD
count
);
...
...
memory/global.c
View file @
284c9b92
...
...
@@ -361,7 +361,7 @@ HGLOBAL16 WINAPI GlobalReAlloc16(
* change the selector if we are shrinking the block.
* FIXME: shouldn't we keep selectors until the block is deleted?
*/
SELECTOR_ReallocBlock
(
sel
,
0
,
1
,
SEGMENT_DATA
,
0
,
0
);
SELECTOR_ReallocBlock
(
sel
,
0
,
1
);
return
handle
;
}
...
...
@@ -398,7 +398,7 @@ HGLOBAL16 WINAPI GlobalReAlloc16(
/* Reallocate the selector(s) */
sel
=
SELECTOR_ReallocBlock
(
sel
,
ptr
,
size
,
SEGMENT_DATA
,
0
,
0
);
sel
=
SELECTOR_ReallocBlock
(
sel
,
ptr
,
size
);
if
(
!
sel
)
{
HeapFree
(
SystemHeap
,
0
,
ptr
);
...
...
memory/selector.c
View file @
284c9b92
...
...
@@ -198,14 +198,15 @@ void SELECTOR_FreeBlock( WORD sel, WORD count )
*
* Change the size of a block of selectors.
*/
WORD
SELECTOR_ReallocBlock
(
WORD
sel
,
const
void
*
base
,
DWORD
size
,
enum
seg_type
type
,
BOOL
is32bit
,
BOOL
readonly
)
WORD
SELECTOR_ReallocBlock
(
WORD
sel
,
const
void
*
base
,
DWORD
size
)
{
ldt_entry
entry
;
WORD
i
,
oldcount
,
newcount
;
if
(
!
size
)
size
=
1
;
oldcount
=
(
GET_SEL_LIMIT
(
sel
)
>>
16
)
+
1
;
newcount
=
(
size
+
0xffff
)
>>
16
;
LDT_GetEntry
(
SELECTOR_TO_ENTRY
(
sel
),
&
entry
);
if
(
oldcount
<
newcount
)
/* We need to add selectors */
{
...
...
@@ -231,7 +232,8 @@ WORD SELECTOR_ReallocBlock( WORD sel, const void *base, DWORD size,
SELECTOR_FreeBlock
(
ENTRY_TO_SELECTOR
(
SELECTOR_TO_ENTRY
(
sel
)
+
newcount
),
oldcount
-
newcount
);
}
if
(
sel
)
SELECTOR_SetEntries
(
sel
,
base
,
size
,
type
,
is32bit
,
readonly
);
if
(
sel
)
SELECTOR_SetEntries
(
sel
,
base
,
size
,
entry
.
type
,
entry
.
seg_32bit
,
entry
.
read_only
);
return
sel
;
}
...
...
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