user [2/2]: Call SetLastError in CreateWindowEx for WS_CHILD w/o parent

Dan Hipschman dsh at linux.ucla.edu
Thu Aug 3 17:05:25 CDT 2006


ChangeLog:
* Call SetLastError in CreateWindowEx when WS_CHILD is set with no parent
---
 dlls/user/tests/win.c |    2 +-
 dlls/user/win.c       |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/user/tests/win.c b/dlls/user/tests/win.c
index 97e7e59..a99c89b 100644
--- a/dlls/user/tests/win.c
+++ b/dlls/user/tests/win.c
@@ -140,7 +140,7 @@ static void test_parent_owner(void)
     SetLastError(ERROR_SUCCESS);
     test = CreateWindowExA(0, "ToolWindowClass", "Tool window 1",
                            WS_CHILD, 0, 0, 100, 100, 0, 0, 0, NULL );
-    todo_wine ok( GetLastError() != ERROR_SUCCESS, "CreateWindowExA should call SetLastError\n" );
+    ok( GetLastError() != ERROR_SUCCESS, "CreateWindowExA should call SetLastError\n" );
     ok( !test, "WS_CHILD without parent created\n" );
 
     /* desktop window */
diff --git a/dlls/user/win.c b/dlls/user/win.c
index 68d6bb0..2d1e492 100644
--- a/dlls/user/win.c
+++ b/dlls/user/win.c
@@ -996,6 +996,7 @@ static HWND WIN_CreateWindowEx( CREATEST
         if ((cs->style & (WS_CHILD|WS_POPUP)) == WS_CHILD)
         {
             WARN("No parent for child window\n" );
+            SetLastError(ERROR_TLW_WITH_WSCHILD);
             return 0;  /* WS_CHILD needs a parent, but WS_POPUP doesn't */
         }
         if (classAtom != LOWORD(DESKTOP_CLASS_ATOM))  /* are we creating the desktop itself? */



More information about the wine-patches mailing list