Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jason Beetham
wine
Commits
284c9b92
Commit
284c9b92
authored
25 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
Made SELECTOR_ReallocBlock preserve the current selector access rights
(problem reported by Andreas Mohr).
parent
06bcab8a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/selectors.h
+1
-3
1 addition, 3 deletions
include/selectors.h
memory/global.c
+2
-2
2 additions, 2 deletions
memory/global.c
memory/selector.c
+5
-3
5 additions, 3 deletions
memory/selector.c
with
8 additions
and
8 deletions
include/selectors.h
+
1
−
3
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
);
...
...
This diff is collapsed.
Click to expand it.
memory/global.c
+
2
−
2
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
);
...
...
This diff is collapsed.
Click to expand it.
memory/selector.c
+
5
−
3
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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment