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
06b735ae
Commit
06b735ae
authored
Mar 10, 2015
by
Vincent Povirk
Committed by
Alexandre Julliard
Mar 11, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Test the entire range lock block for synchronization.
parent
6dfcb296
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
23 deletions
+29
-23
storage32.h
dlls/ole32/storage32.h
+5
-2
storage32.c
dlls/ole32/tests/storage32.c
+24
-21
No files found.
dlls/ole32/storage32.h
View file @
06b735ae
...
...
@@ -505,7 +505,10 @@ StgStreamImpl* StgStreamImpl_Construct(
/* Range lock constants.
*
* The storage format reserves the region from 0x7fffff00-0x7fffffff for
* locking and synchronization. Unfortunately, the spec doesn't say which bytes
* locking and synchronization. Because it reserves the entire block containing
* that range, and the minimum block size is 512 bytes, 0x7ffffe00-0x7ffffeff
* also cannot be used for any other purpose.
* Unfortunately, the spec doesn't say which bytes
* within that range are used, and for what. These are guesses based on testing.
* In particular, ends of ranges may be wrong.
...
...
@@ -524,7 +527,7 @@ StgStreamImpl* StgStreamImpl_Construct(
0xe2 through 0xff: Unknown. Causes read-only exclusive opens to fail.
*/
#define RANGELOCK_UNK1_FIRST 0x7ffff
f
00
#define RANGELOCK_UNK1_FIRST 0x7ffff
e
00
#define RANGELOCK_UNK1_LAST 0x7fffff57
#define RANGELOCK_PRIORITY1_FIRST 0x7fffff58
#define RANGELOCK_PRIORITY1_LAST 0x7fffff6b
...
...
dlls/ole32/tests/storage32.c
View file @
06b735ae
...
...
@@ -3153,22 +3153,22 @@ struct lock_test
BOOL
todo
;
};
static
const
int
priority_locked_bytes
[]
=
{
0x
58
,
0x81
,
0x
93
,
-
1
};
static
const
int
rwex_locked_bytes
[]
=
{
0x
93
,
0xa7
,
0xbb
,
0x
cf
,
-
1
};
static
const
int
rw_locked_bytes
[]
=
{
0x
93
,
0x
a7
,
-
1
};
static
const
int
nosn_locked_bytes
[]
=
{
0x
6c
,
0x93
,
0xa7
,
0x
cf
,
-
1
};
static
const
int
rwdw_locked_bytes
[]
=
{
0x
93
,
0xa7
,
0x
cf
,
-
1
};
static
const
int
wodw_locked_bytes
[]
=
{
0x
a7
,
0x
cf
,
-
1
};
static
const
int
tr_locked_bytes
[]
=
{
0x93
,
-
1
};
static
const
int
priority_locked_bytes
[]
=
{
0x
158
,
0x181
,
0x1
93
,
-
1
};
static
const
int
rwex_locked_bytes
[]
=
{
0x
193
,
0x1a7
,
0x1bb
,
0x1
cf
,
-
1
};
static
const
int
rw_locked_bytes
[]
=
{
0x
193
,
0x1
a7
,
-
1
};
static
const
int
nosn_locked_bytes
[]
=
{
0x
16c
,
0x193
,
0x1a7
,
0x1
cf
,
-
1
};
static
const
int
rwdw_locked_bytes
[]
=
{
0x
193
,
0x1a7
,
0x1
cf
,
-
1
};
static
const
int
wodw_locked_bytes
[]
=
{
0x
1a7
,
0x1
cf
,
-
1
};
static
const
int
tr_locked_bytes
[]
=
{
0x
1
93
,
-
1
};
static
const
int
no_locked_bytes
[]
=
{
-
1
};
static
const
int
roex_locked_bytes
[]
=
{
0x
93
,
0xbb
,
0x
cf
,
-
1
};
static
const
int
rwex_fail_ranges
[]
=
{
0x
93
,
0x
e3
,
-
1
};
static
const
int
rw_fail_ranges
[]
=
{
0x
bb
,
0x
e3
,
-
1
};
static
const
int
rwdw_fail_ranges
[]
=
{
0x
a7
,
0x
e3
,
-
1
};
static
const
int
dw_fail_ranges
[]
=
{
0x
a7
,
0x
cf
,
-
1
};
static
const
int
tr_fail_ranges
[]
=
{
0x
bb
,
0x
cf
,
-
1
};
static
const
int
pr_fail_ranges
[]
=
{
0x
80
,
0x81
,
0xbb
,
0x
cf
,
-
1
};
static
const
int
roex_locked_bytes
[]
=
{
0x
193
,
0x1bb
,
0x1
cf
,
-
1
};
static
const
int
rwex_fail_ranges
[]
=
{
0x
193
,
0x1
e3
,
-
1
};
static
const
int
rw_fail_ranges
[]
=
{
0x
1bb
,
0x1
e3
,
-
1
};
static
const
int
rwdw_fail_ranges
[]
=
{
0x
1a7
,
0x1
e3
,
-
1
};
static
const
int
dw_fail_ranges
[]
=
{
0x
1a7
,
0x1
cf
,
-
1
};
static
const
int
tr_fail_ranges
[]
=
{
0x
1bb
,
0x1
cf
,
-
1
};
static
const
int
pr_fail_ranges
[]
=
{
0x
180
,
0x181
,
0x1bb
,
0x1
cf
,
-
1
};
static
const
int
roex_fail_ranges
[]
=
{
0x0
,
-
1
};
static
const
struct
lock_test
lock_tests
[]
=
{
...
...
@@ -3313,7 +3313,7 @@ static void test_locking(void)
ol
.
u
.
s
.
OffsetHigh
=
0
;
ol
.
hEvent
=
NULL
;
for
(
ol
.
u
.
s
.
Offset
=
0x7ffff
f
00
;
ol
.
u
.
s
.
Offset
!=
0x80000000
;
ol
.
u
.
s
.
Offset
++
)
for
(
ol
.
u
.
s
.
Offset
=
0x7ffff
e
00
;
ol
.
u
.
s
.
Offset
!=
0x80000000
;
ol
.
u
.
s
.
Offset
++
)
{
if
(
LockFileEx
(
hfile
,
LOCKFILE_EXCLUSIVE_LOCK
|
LOCKFILE_FAIL_IMMEDIATELY
,
0
,
1
,
0
,
&
ol
))
locked
=
FALSE
;
...
...
@@ -3325,7 +3325,7 @@ static void test_locking(void)
UnlockFileEx
(
hfile
,
0
,
1
,
0
,
&
ol
);
if
((
ol
.
u
.
s
.
Offset
&
0xff
)
==
*
next_lock
)
if
((
ol
.
u
.
s
.
Offset
&
0x
1
ff
)
==
*
next_lock
)
{
expect_locked
=
TRUE
;
next_lock
++
;
...
...
@@ -3362,14 +3362,17 @@ static void test_locking(void)
ol
.
u
.
s
.
OffsetHigh
=
0
;
ol
.
hEvent
=
NULL
;
for
(
ol
.
u
.
s
.
Offset
=
0x7ffff
f
00
;
ol
.
u
.
s
.
Offset
!=
0x80000000
;
ol
.
u
.
s
.
Offset
++
)
for
(
ol
.
u
.
s
.
Offset
=
0x7ffff
e
00
;
ol
.
u
.
s
.
Offset
!=
0x80000000
;
ol
.
u
.
s
.
Offset
++
)
{
if
(
ol
.
u
.
s
.
Offset
==
0x7fffff92
||
(
ol
.
u
.
s
.
Offset
==
0x7fffff80
&&
current
->
stg_mode
==
(
STGM_TRANSACTED
|
STGM_READWRITE
))
||
(
ol
.
u
.
s
.
Offset
==
0x7fffff80
&&
current
->
stg_mode
==
(
STGM_TRANSACTED
|
STGM_READ
)))
continue
;
/* This makes opens hang */
LockFileEx
(
hfile
,
LOCKFILE_EXCLUSIVE_LOCK
,
0
,
1
,
0
,
&
ol
);
if
(
ol
.
u
.
s
.
Offset
<
0x7fffff00
)
LockFileEx
(
hfile
,
0
,
0
,
1
,
0
,
&
ol
);
else
LockFileEx
(
hfile
,
LOCKFILE_EXCLUSIVE_LOCK
,
0
,
1
,
0
,
&
ol
);
hr
=
StgOpenStorage
(
filename
,
NULL
,
current
->
stg_mode
,
NULL
,
0
,
&
stg
);
ok
(
hr
==
S_OK
||
hr
==
STG_E_LOCKVIOLATION
||
hr
==
STG_E_SHAREVIOLATION
,
"failed with unexpected hr %x
\n
"
,
hr
);
...
...
@@ -3379,11 +3382,11 @@ static void test_locking(void)
failed
=
FAILED
(
hr
);
if
(
!
expect_failed
&&
(
ol
.
u
.
s
.
Offset
&
0xff
)
==
next_range
[
0
])
if
(
!
expect_failed
&&
(
ol
.
u
.
s
.
Offset
&
0x
1
ff
)
==
next_range
[
0
])
{
expect_failed
=
TRUE
;
}
else
if
(
expect_failed
&&
(
ol
.
u
.
s
.
Offset
&
0xff
)
==
next_range
[
1
])
else
if
(
expect_failed
&&
(
ol
.
u
.
s
.
Offset
&
0x
1
ff
)
==
next_range
[
1
])
{
expect_failed
=
FALSE
;
next_range
+=
2
;
...
...
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