Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winex11.drv/clipboard.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-)
On Tue, Apr 26, 2022 at 04:17:47PM +0200, Jacek Caban wrote:
Signed-off-by: Jacek Caban jacek@codeweavers.com
dlls/winex11.drv/clipboard.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-)
diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index 51da5d6a5e6..87b1ed2b8fb 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -569,6 +569,29 @@ static HGLOBAL create_dib_from_bitmap(HBITMAP hBmp) }
+/* based on wine_get_dos_file_name */ +static WCHAR *get_dos_file_name( const char *path ) +{
- ULONG len = strlen( path ) + 9; /* ??\unix prefix */
- WCHAR *ret;
- if (!(ret = malloc( len * sizeof(WCHAR) ))) return NULL;
- if (wine_unix_to_nt_file_name( path, ret, &len ))
- {
free( ret );
return NULL;
- }
- if (ret[5] == ':')
- {
/* get rid of the \??\ prefix */
memmove( ret, ret + 4, (len - 4) * sizeof(WCHAR) );
- }
- else ret[1] = '\';
- return ret;
+}
I noticed that this change didn't result in any change to a freer. It turned out there was an issue with the commit yesterday which swapped two of them. The result being, that even after this patch, import_text_uri_list() would try to free "uri" from the process heap. So, I've sent in v2 of this series which adds a patch up front to unswap the freers.
Huw.