winex11.drv: send proper file path for drag and drop
Lei Zhang
thestig at google.com
Tue Jul 10 18:50:43 CDT 2007
Hi,
Drag and drop currently sends the file path as "\path\to\file" which
does not work properly for some applications. This patch converts the
file path to a proper Windows file path, i.e. z:\path\to\file.
-------------- next part --------------
From 0beb4210297a3b731980aeb3addb68f3f9720e7b Mon Sep 17 00:00:00 2001
From: Lei Zhang <thestig at stumpy.smo.corp.google.com>
Date: Tue, 10 Jul 2007 16:44:39 -0700
Subject: winex11.drv: send proper file path for drag and drop
---
dlls/winex11.drv/xdnd.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/xdnd.c b/dlls/winex11.drv/xdnd.c
index 59410c5..c1b77f7 100644
--- a/dlls/winex11.drv/xdnd.c
+++ b/dlls/winex11.drv/xdnd.c
@@ -583,8 +583,9 @@ static void X11DRV_XDND_FreeDragDropOp(v
static DROPFILES* X11DRV_XDND_BuildDropFiles(char* filename, unsigned int len, POINT pt)
{
char* pfn;
- int pathlen;
+ int pathlen = 0;
char path[MAX_PATH];
+ WCHAR * wpath;
DROPFILES *lpDrop = NULL;
/* Advance to last starting slash */
@@ -608,7 +609,11 @@ static DROPFILES* X11DRV_XDND_BuildDropF
TRACE("%s\n", filename);
- pathlen = GetLongPathNameA(filename, path, MAX_PATH);
+ wpath = wine_get_dos_file_name(filename);
+ if (wpath)
+ pathlen = WideCharToMultiByte(CP_ACP, 0, wpath, -1, (LPSTR) &path,
+ strlenW(wpath) + 1, 0, 0);
+
if (pathlen)
{
lpDrop = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DROPFILES) + pathlen + 1);
--
1.4.1
More information about the wine-patches
mailing list