Jeff Latimer : user32: DdeQueryString returns a NULL str if there is no handle.

Alexandre Julliard julliard at winehq.org
Mon Aug 18 10:47:12 CDT 2008


Module: wine
Branch: master
Commit: 04a59014f8d098b1e06afe7f2a8ee444f1682d05
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=04a59014f8d098b1e06afe7f2a8ee444f1682d05

Author: Jeff Latimer <lats at yless4u.com.au>
Date:   Tue Aug  5 22:14:01 2008 +1000

user32: DdeQueryString returns a NULL str if there is no handle.

---

 dlls/user32/dde_misc.c  |   12 ++++++++++--
 dlls/user32/tests/dde.c |    2 --
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/dlls/user32/dde_misc.c b/dlls/user32/dde_misc.c
index d99cdcf..227f874 100644
--- a/dlls/user32/dde_misc.c
+++ b/dlls/user32/dde_misc.c
@@ -348,8 +348,8 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback,
     UINT			ret;
     WNDCLASSEXW			wndclass;
 
-    TRACE("(%p,%p,0x%x,%d)\n",
-	  pidInst, pfnCallback, afCmd, ulRes);
+    TRACE("(%p,%p,0x%x,%d,0x%x)\n",
+	  pidInst, pfnCallback, afCmd, ulRes, bUnicode);
 
     if (ulRes)
     {
@@ -999,6 +999,14 @@ static int	WDML_QueryString(WDML_INSTANCE* pInstance, HSZ hsz, LPVOID ptr, DWORD
 	cchMax = MAX_BUFFER_LEN;
     }
 
+    /* if there is no input windows returns a NULL string */
+    if (hsz == NULL)
+    {
+	CHAR *t_ptr = ptr;
+	*t_ptr = '\0';
+	return 1;
+    }
+
     switch (codepage)
     {
     case CP_WINANSI:
diff --git a/dlls/user32/tests/dde.c b/dlls/user32/tests/dde.c
index 73968d8..082a8bf 100644
--- a/dlls/user32/tests/dde.c
+++ b/dlls/user32/tests/dde.c
@@ -654,7 +654,6 @@ static HDDEDATA CALLBACK server_ddeml_callback(UINT uType, UINT uFmt, HCONV hcon
 
         if (msg_index == 5)
         {
-            todo_wine
             {
                 ok(!lstrcmpA(str, ""), "Expected empty string, got %s\n", str);
                 ok(size == 1, "Expected 1, got %d\n", size);
@@ -696,7 +695,6 @@ static HDDEDATA CALLBACK server_ddeml_callback(UINT uType, UINT uFmt, HCONV hcon
         size = DdeQueryStringA(server_pid, hsz2, str, MAX_PATH, CP_WINANSI);
         if (msg_index == 7)
         {
-            todo_wine
             {
                 ok(!lstrcmpA(str, ""), "Expected empty string, got %s\n", str);
                 ok(size == 1, "Expected 1, got %d\n", size);




More information about the wine-cvs mailing list