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
Sam Joan Roque-Worcel
wine
Commits
116297d0
Commit
116297d0
authored
16 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
kernel32: Semaphore names are case sensitive.
parent
c96752c0
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/sync.c
+2
-3
2 additions, 3 deletions
dlls/kernel32/sync.c
dlls/kernel32/tests/sync.c
+37
-0
37 additions, 0 deletions
dlls/kernel32/tests/sync.c
with
39 additions
and
3 deletions
dlls/kernel32/sync.c
+
2
−
3
View file @
116297d0
...
...
@@ -794,8 +794,7 @@ HANDLE WINAPI CreateSemaphoreW( SECURITY_ATTRIBUTES *sa, LONG initial,
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
ObjectName
=
NULL
;
attr
.
Attributes
=
OBJ_CASE_INSENSITIVE
|
OBJ_OPENIF
|
((
sa
&&
sa
->
bInheritHandle
)
?
OBJ_INHERIT
:
0
);
attr
.
Attributes
=
OBJ_OPENIF
|
((
sa
&&
sa
->
bInheritHandle
)
?
OBJ_INHERIT
:
0
);
attr
.
SecurityDescriptor
=
sa
?
sa
->
lpSecurityDescriptor
:
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
if
(
name
)
...
...
@@ -847,7 +846,7 @@ HANDLE WINAPI OpenSemaphoreW( DWORD access, BOOL inherit, LPCWSTR name )
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
ObjectName
=
NULL
;
attr
.
Attributes
=
OBJ_CASE_INSENSITIVE
|
(
inherit
?
OBJ_INHERIT
:
0
)
;
attr
.
Attributes
=
inherit
?
OBJ_INHERIT
:
0
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
if
(
name
)
...
...
This diff is collapsed.
Click to expand it.
dlls/kernel32/tests/sync.c
+
37
−
0
View file @
116297d0
...
...
@@ -336,6 +336,42 @@ static void test_event(void)
CloseHandle
(
handle
);
}
static
void
test_semaphore
(
void
)
{
HANDLE
handle
,
handle2
;
/* test case sensitivity */
SetLastError
(
0xdeadbeef
);
handle
=
CreateSemaphoreA
(
NULL
,
0
,
1
,
__FILE__
": Test Semaphore"
);
ok
(
handle
!=
NULL
,
"CreateSemaphore failed with error %u
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
0
,
"wrong error %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
handle2
=
CreateSemaphoreA
(
NULL
,
0
,
1
,
__FILE__
": Test Semaphore"
);
ok
(
handle2
!=
NULL
,
"CreateSemaphore failed with error %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_ALREADY_EXISTS
,
"wrong error %u
\n
"
,
GetLastError
());
CloseHandle
(
handle2
);
SetLastError
(
0xdeadbeef
);
handle2
=
CreateSemaphoreA
(
NULL
,
0
,
1
,
__FILE__
": TEST SEMAPHORE"
);
ok
(
handle2
!=
NULL
,
"CreateSemaphore failed with error %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
0
,
"wrong error %u
\n
"
,
GetLastError
());
CloseHandle
(
handle2
);
SetLastError
(
0xdeadbeef
);
handle2
=
OpenSemaphoreA
(
SEMAPHORE_ALL_ACCESS
,
FALSE
,
__FILE__
": Test Semaphore"
);
ok
(
handle2
!=
NULL
,
"OpenSemaphore failed with error %d
\n
"
,
GetLastError
());
CloseHandle
(
handle2
);
SetLastError
(
0xdeadbeef
);
handle2
=
OpenSemaphoreA
(
SEMAPHORE_ALL_ACCESS
,
FALSE
,
__FILE__
": TEST SEMAPHORE"
);
ok
(
!
handle2
,
"OpenSemaphore succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
());
CloseHandle
(
handle
);
}
static
HANDLE
sem
=
0
;
static
void
CALLBACK
iocp_callback
(
DWORD
dwErrorCode
,
DWORD
dwNumberOfBytesTransferred
,
LPOVERLAPPED
lpOverlapped
)
...
...
@@ -451,5 +487,6 @@ START_TEST(sync)
test_mutex
();
test_slist
();
test_event
();
test_semaphore
();
test_iocp_callback
();
}
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