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
2f514bec
Commit
2f514bec
authored
Jul 18, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Store synchronization objects under the session directory.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
87bbc84a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
18 deletions
+17
-18
sync.c
dlls/kernel32/sync.c
+5
-3
om.c
dlls/ntdll/tests/om.c
+12
-15
No files found.
dlls/kernel32/sync.c
View file @
2f514bec
...
...
@@ -57,8 +57,9 @@ static inline BOOL is_version_nt(void)
HANDLE
get_BaseNamedObjects_handle
(
void
)
{
static
HANDLE
handle
=
NULL
;
static
const
WCHAR
basenameW
[]
=
{
'\\'
,
'B'
,
'a'
,
's'
,
'e'
,
'N'
,
'a'
,
'm'
,
'e'
,
'd'
,
'O'
,
'b'
,
'j'
,
'e'
,
'c'
,
't'
,
's'
,
0
};
static
const
WCHAR
basenameW
[]
=
{
'\\'
,
'S'
,
'e'
,
's'
,
's'
,
'i'
,
'o'
,
'n'
,
's'
,
'\\'
,
'%'
,
'u'
,
'\\'
,
'B'
,
'a'
,
's'
,
'e'
,
'N'
,
'a'
,
'm'
,
'e'
,
'd'
,
'O'
,
'b'
,
'j'
,
'e'
,
'c'
,
't'
,
's'
,
0
};
WCHAR
buffer
[
64
];
UNICODE_STRING
str
;
OBJECT_ATTRIBUTES
attr
;
...
...
@@ -66,7 +67,8 @@ HANDLE get_BaseNamedObjects_handle(void)
{
HANDLE
dir
;
RtlInitUnicodeString
(
&
str
,
basenameW
);
sprintfW
(
buffer
,
basenameW
,
NtCurrentTeb
()
->
Peb
->
SessionId
);
RtlInitUnicodeString
(
&
str
,
buffer
);
InitializeObjectAttributes
(
&
attr
,
&
str
,
0
,
0
,
NULL
);
NtOpenDirectoryObject
(
&
dir
,
DIRECTORY_CREATE_OBJECT
|
DIRECTORY_TRAVERSE
,
&
attr
);
...
...
dlls/ntdll/tests/om.c
View file @
2f514bec
...
...
@@ -231,13 +231,14 @@ static HANDLE get_base_dir(void)
UNICODE_STRING
str
;
OBJECT_ATTRIBUTES
attr
;
HANDLE
dir
,
h
;
unsigned
int
i
;
char
name
[
40
]
;
h
=
CreateMutexA
(
NULL
,
FALSE
,
objname
);
ok
(
h
!=
0
,
"CreateMutexA failed got ret=%p (%d)
\n
"
,
h
,
GetLastError
());
InitializeObjectAttributes
(
&
attr
,
&
str
,
OBJ_OPENIF
,
0
,
NULL
);
pRtlCreateUnicodeStringFromAsciiz
(
&
str
,
"
\\
BaseNamedObjects
\\
Local"
);
sprintf
(
name
,
"
\\
BaseNamedObjects
\\
Session
\\
%u"
,
NtCurrentTeb
()
->
Peb
->
SessionId
);
pRtlCreateUnicodeStringFromAsciiz
(
&
str
,
name
);
status
=
pNtOpenDirectoryObject
(
&
dir
,
DIRECTORY_QUERY
,
&
attr
);
pRtlFreeUnicodeString
(
&
str
);
if
(
!
status
&&
is_correct_dir
(
dir
,
objname
))
goto
done
;
...
...
@@ -249,16 +250,6 @@ static HANDLE get_base_dir(void)
if
(
!
status
&&
is_correct_dir
(
dir
,
objname
))
goto
done
;
if
(
!
status
)
pNtClose
(
dir
);
for
(
i
=
0
;
i
<
20
;
i
++
)
{
char
name
[
40
];
sprintf
(
name
,
"
\\
BaseNamedObjects
\\
Session
\\
%u"
,
i
);
pRtlCreateUnicodeStringFromAsciiz
(
&
str
,
name
);
status
=
pNtOpenDirectoryObject
(
&
dir
,
DIRECTORY_QUERY
,
&
attr
);
pRtlFreeUnicodeString
(
&
str
);
if
(
!
status
&&
is_correct_dir
(
dir
,
objname
))
goto
done
;
if
(
!
status
)
pNtClose
(
dir
);
}
dir
=
0
;
done:
...
...
@@ -1293,10 +1284,12 @@ static void test_query_object(void)
NTSTATUS
status
;
ULONG
len
,
expected_len
;
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
path
,
*
str
;
UNICODE_STRING
path
,
session
,
*
str
;
char
dir
[
MAX_PATH
],
tmp_path
[
MAX_PATH
],
file1
[
MAX_PATH
+
16
];
LARGE_INTEGER
size
;
sprintf
(
tmp_path
,
"
\\
Sessions
\\
%u"
,
NtCurrentTeb
()
->
Peb
->
SessionId
);
pRtlCreateUnicodeStringFromAsciiz
(
&
session
,
tmp_path
);
InitializeObjectAttributes
(
&
attr
,
&
path
,
0
,
0
,
0
);
handle
=
CreateEventA
(
NULL
,
FALSE
,
FALSE
,
"test_event"
);
...
...
@@ -1330,8 +1323,11 @@ static void test_query_object(void)
ok
(
str
->
Length
>=
sizeof
(
name
),
"unexpected len %u
\n
"
,
str
->
Length
);
ok
(
len
>
sizeof
(
UNICODE_STRING
)
+
sizeof
(
"
\\
test_event"
)
*
sizeof
(
WCHAR
),
"name too short %s
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
)
);
/* there can be a \\Sessions prefix in the name */
ok
(
!
memcmp
(
str
->
Buffer
+
(
str
->
Length
-
sizeof
(
name
))
/
sizeof
(
WCHAR
),
name
,
sizeof
(
name
)
),
/* check for \\Sessions prefix in the name */
ok
(
(
str
->
Length
>
session
.
Length
&&
!
memcmp
(
str
->
Buffer
,
session
.
Buffer
,
session
.
Length
)
&&
!
memcmp
(
str
->
Buffer
+
session
.
Length
/
sizeof
(
WCHAR
),
name
,
sizeof
(
name
)
))
||
broken
(
!
memcmp
(
str
->
Buffer
,
name
,
sizeof
(
name
)
)),
/* winxp */
"wrong name %s
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
)
);
trace
(
"got %s len %u
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
),
len
);
...
...
@@ -1528,6 +1524,7 @@ static void test_query_object(void)
trace
(
"got %s len %u
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
),
len
);
pNtClose
(
handle
);
}
pRtlFreeUnicodeString
(
&
session
);
}
static
void
test_type_mismatch
(
void
)
...
...
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