Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
jacob-wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
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
Jacob Czekalla
jacob-wine
Commits
4b058e6e
Commit
4b058e6e
authored
13 years ago
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
server: OpenMutex should perform a real access check instead of validating access flags.
This reverts
7b63fa65
.
parent
fa2420d6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/kernel32/tests/sync.c
+20
-0
20 additions, 0 deletions
dlls/kernel32/tests/sync.c
server/mutex.c
+0
-8
0 additions, 8 deletions
server/mutex.c
with
20 additions
and
8 deletions
dlls/kernel32/tests/sync.c
+
20
−
0
View file @
4b058e6e
...
...
@@ -133,12 +133,23 @@ static void test_mutex(void)
int
i
;
DWORD
failed
=
0
;
SetLastError
(
0xdeadbeef
);
hOpened
=
OpenMutex
(
0
,
FALSE
,
"WineTestMutex"
);
ok
(
hOpened
==
NULL
,
"OpenMutex succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
hCreated
=
CreateMutex
(
NULL
,
FALSE
,
"WineTestMutex"
);
ok
(
hCreated
!=
NULL
,
"CreateMutex failed with error %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
hOpened
=
OpenMutex
(
0
,
FALSE
,
"WineTestMutex"
);
todo_wine
ok
(
hOpened
==
NULL
,
"OpenMutex succeeded
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"wrong error %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
hOpened
=
OpenMutex
(
GENERIC_EXECUTE
,
FALSE
,
"WineTestMutex"
);
ok
(
hOpened
!=
NULL
,
"OpenMutex failed with error %d
\n
"
,
GetLastError
());
wait_ret
=
WaitForSingleObject
(
hOpened
,
INFINITE
);
...
...
@@ -151,6 +162,7 @@ static void test_mutex(void)
ok
(
wait_ret
==
WAIT_OBJECT_0
,
"WaitForSingleObject failed with error 0x%08x
\n
"
,
wait_ret
);
}
SetLastError
(
0xdeadbeef
);
hOpened
=
OpenMutex
(
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
"WineTestMutex"
);
ok
(
hOpened
!=
NULL
,
"OpenMutex failed with error %d
\n
"
,
GetLastError
());
wait_ret
=
WaitForSingleObject
(
hOpened
,
INFINITE
);
...
...
@@ -159,22 +171,30 @@ static void test_mutex(void)
for
(
i
=
0
;
i
<
32
;
i
++
)
{
SetLastError
(
0xdeadbeef
);
hOpened
=
OpenMutex
(
0x1
<<
i
,
FALSE
,
"WineTestMutex"
);
if
(
hOpened
!=
NULL
)
{
SetLastError
(
0xdeadbeef
);
ret
=
ReleaseMutex
(
hOpened
);
ok
(
ret
,
"ReleaseMutex failed with error %d, access %x
\n
"
,
GetLastError
(),
1
<<
i
);
CloseHandle
(
hOpened
);
}
else
{
if
((
1
<<
i
)
==
ACCESS_SYSTEM_SECURITY
)
todo_wine
ok
(
GetLastError
()
==
ERROR_PRIVILEGE_NOT_HELD
,
"wrong error %u, access %x
\n
"
,
GetLastError
(),
1
<<
i
);
else
todo_wine
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"wrong error %u, , access %x
\n
"
,
GetLastError
(),
1
<<
i
);
ReleaseMutex
(
hCreated
);
failed
|=
0x1
<<
i
;
}
}
todo_wine
ok
(
failed
==
0x0de0fffe
,
"open succeeded when it shouldn't: %x
\n
"
,
failed
);
SetLastError
(
0xdeadbeef
);
ret
=
ReleaseMutex
(
hCreated
);
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_NOT_OWNER
),
"ReleaseMutex should have failed with ERROR_NOT_OWNER instead of %d
\n
"
,
GetLastError
());
...
...
This diff is collapsed.
Click to expand it.
server/mutex.c
+
0
−
8
View file @
4b058e6e
...
...
@@ -238,14 +238,6 @@ DECL_HANDLER(open_mutex)
struct
directory
*
root
=
NULL
;
struct
mutex
*
mutex
;
if
((
req
->
access
&
~
(
GENERIC_READ
|
GENERIC_WRITE
|
GENERIC_EXECUTE
|
GENERIC_ALL
|
MUTEX_ALL_ACCESS
|
STANDARD_RIGHTS_ALL
|
MAXIMUM_ALLOWED
))
||
!
req
->
access
)
{
set_error
(
STATUS_INVALID_PARAMETER
);
return
;
}
get_req_unicode_str
(
&
name
);
if
(
req
->
rootdir
&&
!
(
root
=
get_directory_obj
(
current
->
process
,
req
->
rootdir
,
0
)))
return
;
...
...
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