https://bugs.winehq.org/show_bug.cgi?id=50035
Bug ID: 50035 Summary: Bugs in ntdll-Junction_Points staging patchset Product: Wine-staging Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: martin@martin.st CC: leslie_alistair@hotmail.com, z.figura12@gmail.com Distribution: ---
Created attachment 68475 --> https://bugs.winehq.org/attachment.cgi?id=68475 First patch
Attaching two patches that can be squashed into the existing patches in ntdll-Junction_Points. The bugs are that FindNextFileW doesn't properly set the dwReserved0 field (containing the ReparseTag value) if iterating over files in a directory other than the current one, and that CreateSymbolicLinkA is unimplemented.
https://bugs.winehq.org/show_bug.cgi?id=50035
--- Comment #1 from Martin Storsjö martin@martin.st --- Created attachment 68476 --> https://bugs.winehq.org/attachment.cgi?id=68476 Second patch
https://bugs.winehq.org/show_bug.cgi?id=50035
Martin Storsjö martin@martin.st changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |erich.e.hoover@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=50035
--- Comment #2 from Martin Storsjö martin@martin.st --- Sorry, I just remembered that I forgot to add a check for alloc failure in the first patch...
https://bugs.winehq.org/show_bug.cgi?id=50035
--- Comment #3 from Erich E. Hoover erich.e.hoover@gmail.com --- (In reply to Martin Storsjö from comment #0)
Created attachment 68475 [details] First patch
This used to be part of: ntdll-Junction_Points/0019-kernel32-Implement-CreateSymbolicLink-A-W-with-ntdll.patch Must have gotten lost in a rebase. You are missing a free: HeapFree( GetProcessHeap(), 0, linkW ); that should occur both at the end and if linkW gets allocated and targetW fails.
Attaching two patches that can be squashed into the existing patches in ntdll-Junction_Points. The bugs are that FindNextFileW doesn't properly set the dwReserved0 field (containing the ReparseTag value) if iterating over files in a directory other than the current one, and that CreateSymbolicLinkA is unimplemented.
That is a good find, I only tested this in wcmd - so I never noticed. Please use sizeof(WCHAR)*2 instead of 4. Also, is there a reason you are avoiding lstrcpyW and lstrcatW?
https://bugs.winehq.org/show_bug.cgi?id=50035
--- Comment #4 from Martin Storsjö martin@martin.st --- (In reply to Erich E. Hoover from comment #3)
(In reply to Martin Storsjö from comment #0)
Created attachment 68475 [details] First patch
This used to be part of: ntdll-Junction_Points/0019-kernel32-Implement-CreateSymbolicLink-A-W-with- ntdll.patch
Yeah, it seems to have been lost here: https://github.com/wine-staging/wine-staging/commit/4ffe305c90f9e15141f2c1b1...
Must have gotten lost in a rebase. You are missing a free: HeapFree( GetProcessHeap(), 0, linkW ); that should occur both at the end and if linkW gets allocated and targetW fails.
No, I'm taking a shortcut, by passing FALSE to the alloc parameter to the FILE_name_AtoW function - just like CopyFileA does: https://source.winehq.org/git/wine.git/blob/f6a5a3d03c1eb914444af96352ca54ee...
The comment above FILE_name_AtoW says:
https://source.winehq.org/git/wine.git/blob/f6a5a3d03c1eb914444af96352ca54ee...
* If alloc is FALSE uses the TEB static buffer, so it can only be used when * there is no possibility for the function to do that twice, taking into * account any called function.
AFAIK that should be ok here?
Attaching two patches that can be squashed into the existing patches in ntdll-Junction_Points. The bugs are that FindNextFileW doesn't properly set the dwReserved0 field (containing the ReparseTag value) if iterating over files in a directory other than the current one, and that CreateSymbolicLinkA is unimplemented.
That is a good find, I only tested this in wcmd - so I never noticed. Please use sizeof(WCHAR)*2 instead of 4.
Sure
Also, is there a reason you are avoiding lstrcpyW and lstrcatW?
No, I just wasn't aware of them.
But I actually need lstrcpynW, because info->path points to the full string ending with "dirname*", while we just want the dirname. But the intermediate extra backslash isn't needed as it's included in info->path.Length.
https://bugs.winehq.org/show_bug.cgi?id=50035
Martin Storsjö martin@martin.st changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #68476|0 |1 is obsolete| |
--- Comment #5 from Martin Storsjö martin@martin.st --- Created attachment 68480 --> https://bugs.winehq.org/attachment.cgi?id=68480 Second patch, v2
https://bugs.winehq.org/show_bug.cgi?id=50035
--- Comment #6 from Erich E. Hoover erich.e.hoover@gmail.com --- (In reply to Martin Storsjö from comment #4)
... Yeah, it seems to have been lost here: https://github.com/wine-staging/wine-staging/commit/ 4ffe305c90f9e15141f2c1b10e86a15a5b9b7e3f
Huh, I must have made a mistake when I gave Zeb my updates.
... No, I'm taking a shortcut, by passing FALSE to the alloc parameter to the FILE_name_AtoW function - just like CopyFileA does: https://source.winehq.org/git/wine.git/blob/ f6a5a3d03c1eb914444af96352ca54eec79d7e2c:/dlls/kernel32/path.c#l100 ... AFAIK that should be ok here?
That's either new(ish) or I never noticed it before. That's very convenient!
... But I actually need lstrcpynW, because info->path points to the full string ending with "dirname*", while we just want the dirname. But the intermediate extra backslash isn't needed as it's included in info->path.Length.
Looks good, I'll merge these into my local copy and send Zeb an update.
https://bugs.winehq.org/show_bug.cgi?id=50035
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |3dc5147b28446418516e972d40b | |7515a6cba2e94 Version|unspecified |5.20 Status|UNCONFIRMED |RESOLVED
--- Comment #7 from Zebediah Figura z.figura12@gmail.com --- Pushed in 3dc5147b28446418516e972d40b7515a6cba2e94, thanks Erich.
https://bugs.winehq.org/show_bug.cgi?id=50035
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Closing bugs fixed in Staging 5.21.