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
afb16d3e
Commit
afb16d3e
authored
Oct 30, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Fix returned error when creating an existing symlink.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=55839
parent
0f88c7c3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
4 deletions
+25
-4
om.c
dlls/ntdll/tests/om.c
+17
-1
symlink.c
server/symlink.c
+8
-3
No files found.
dlls/ntdll/tests/om.c
View file @
afb16d3e
...
@@ -1408,8 +1408,14 @@ static void test_symboliclink(void)
...
@@ -1408,8 +1408,14 @@ static void test_symboliclink(void)
pNtClose
(
link
);
pNtClose
(
link
);
RtlInitUnicodeString
(
&
str
,
L"
\\
"
);
RtlInitUnicodeString
(
&
str
,
L"
\\
"
);
attr
.
Attributes
=
OBJ_OPENIF
;
status
=
pNtCreateSymbolicLinkObject
(
&
h
,
SYMBOLIC_LINK_QUERY
,
&
attr
,
&
target
);
status
=
pNtCreateSymbolicLinkObject
(
&
h
,
SYMBOLIC_LINK_QUERY
,
&
attr
,
&
target
);
todo_wine
ok
(
status
==
STATUS_OBJECT_TYPE_MISMATCH
,
ok
(
status
==
STATUS_OBJECT_TYPE_MISMATCH
,
"NtCreateSymbolicLinkObject should have failed with STATUS_OBJECT_TYPE_MISMATCH got(%08lx)
\n
"
,
status
);
attr
.
Attributes
=
0
;
status
=
pNtCreateSymbolicLinkObject
(
&
h
,
SYMBOLIC_LINK_QUERY
,
&
attr
,
&
target
);
todo_wine
ok
(
status
==
STATUS_OBJECT_TYPE_MISMATCH
,
"NtCreateSymbolicLinkObject should have failed with STATUS_OBJECT_TYPE_MISMATCH got(%08lx)
\n
"
,
status
);
"NtCreateSymbolicLinkObject should have failed with STATUS_OBJECT_TYPE_MISMATCH got(%08lx)
\n
"
,
status
);
RtlInitUnicodeString
(
&
target
,
L"->Somewhere"
);
RtlInitUnicodeString
(
&
target
,
L"->Somewhere"
);
...
@@ -1480,6 +1486,16 @@ static void test_symboliclink(void)
...
@@ -1480,6 +1486,16 @@ static void test_symboliclink(void)
ok
(
status
==
STATUS_SUCCESS
,
"Got unexpected status %#lx.
\n
"
,
status
);
ok
(
status
==
STATUS_SUCCESS
,
"Got unexpected status %#lx.
\n
"
,
status
);
pNtClose
(
h
);
pNtClose
(
h
);
attr
.
Attributes
=
OBJ_OPENIF
;
status
=
pNtCreateSymbolicLinkObject
(
&
h
,
SYMBOLIC_LINK_QUERY
,
&
attr
,
&
target
);
ok
(
status
==
STATUS_SUCCESS
||
broken
(
status
==
STATUS_OBJECT_NAME_EXISTS
),
/* <= win10 1507 */
"Got unexpected status %#lx.
\n
"
,
status
);
pNtClose
(
h
);
attr
.
Attributes
=
0
;
status
=
pNtCreateSymbolicLinkObject
(
&
h
,
SYMBOLIC_LINK_QUERY
,
&
attr
,
&
target
);
ok
(
status
==
STATUS_OBJECT_NAME_COLLISION
,
"Got unexpected status %#lx.
\n
"
,
status
);
pNtClose
(
h
);
InitializeObjectAttributes
(
&
attr
,
&
str
,
0
,
0
,
NULL
);
InitializeObjectAttributes
(
&
attr
,
&
str
,
0
,
0
,
NULL
);
RtlInitUnicodeString
(
&
str
,
L"
\\
BaseNamedObjects
\\
om.c-test
\\
"
);
RtlInitUnicodeString
(
&
str
,
L"
\\
BaseNamedObjects
\\
om.c-test
\\
"
);
status
=
NtCreateFile
(
&
h
,
GENERIC_READ
|
SYNCHRONIZE
,
&
attr
,
&
iosb
,
NULL
,
0
,
status
=
NtCreateFile
(
&
h
,
GENERIC_READ
|
SYNCHRONIZE
,
&
attr
,
&
iosb
,
NULL
,
0
,
...
...
server/symlink.c
View file @
afb16d3e
...
@@ -155,13 +155,18 @@ struct object *create_symlink( struct object *root, const struct unicode_str *na
...
@@ -155,13 +155,18 @@ struct object *create_symlink( struct object *root, const struct unicode_str *na
set_error
(
STATUS_INVALID_PARAMETER
);
set_error
(
STATUS_INVALID_PARAMETER
);
return
NULL
;
return
NULL
;
}
}
if
(
!
(
symlink
=
create_named_object
(
root
,
&
symlink_ops
,
name
,
attr
,
sd
)))
return
NULL
;
if
(
!
(
symlink
=
create_named_object
(
root
,
&
symlink_ops
,
name
,
attr
|
OBJ_OPENLINK
,
sd
)))
return
NULL
;
if
(
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
&&
!
(
symlink
->
target
=
memdup
(
target
->
str
,
target
->
len
)))
if
(
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
)
{
symlink
->
len
=
target
->
len
;
if
(
!
(
symlink
->
target
=
memdup
(
target
->
str
,
target
->
len
)))
{
{
release_object
(
symlink
);
release_object
(
symlink
);
return
NULL
;
return
NULL
;
}
}
symlink
->
len
=
target
->
len
;
}
else
clear_error
();
return
&
symlink
->
obj
;
return
&
symlink
->
obj
;
}
}
...
...
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