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?