[PATCH 2/6] user32: Implement OpenInputDesktop.

Qian Hong qhong at codeweavers.com
Wed Oct 23 10:57:30 CDT 2013


Hello,

On Wed, Oct 23, 2013 at 11:11 PM, Alexandre Julliard
<julliard at winehq.org> wrote:
>
> I don't think that makes sense, under Wine every desktop is potentially
> an input desktop, there's no way to decide which one is the "real" one.

Thanks a lot for reviewing!
I'm not sure I understand what you expect, I attach a draft version
similar to patch 99498 with some improvements, could you have a look?
If that's not what you expect, could you advice a bit more details
what's the preferred way to improve OpenInputDesktop rather than a
stub?

Thanks again.


-- 
Regards,
Qian Hong

-
http://www.codeweavers.com
-------------- next part --------------
commit 412b34700dacce91029c34378a813909b20adb46
Author: Qian Hong <qhong at codeweavers.com>
Date:   Wed Oct 23 23:50:20 2013 +0800

    Draft - user32: Implement partial stub OpenInputDesktop.

diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c
index e74ac19..15ce747 100644
--- a/dlls/user32/user_main.c
+++ b/dlls/user32/user_main.c
@@ -161,7 +161,7 @@ static void palette_init(void)
  *
  * Get the name of the desktop to use for this app if not specified explicitly.
  */
-static const WCHAR *get_default_desktop(void)
+const WCHAR *get_default_desktop(void)
 {
     static const WCHAR defaultW[] = {'D','e','f','a','u','l','t',0};
     static const WCHAR desktopW[] = {'D','e','s','k','t','o','p',0};
diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h
index 9daa9f4..d88827c 100644
--- a/dlls/user32/user_private.h
+++ b/dlls/user32/user_private.h
@@ -309,6 +309,7 @@ typedef struct
 #include "poppack.h"
 
 extern BOOL get_icon_size( HICON handle, SIZE *size ) DECLSPEC_HIDDEN;
+extern const WCHAR *get_default_desktop(void) DECLSPEC_HIDDEN;
 
 /* Mingw's assert() imports MessageBoxA and gets confused by user32 exporting it */
 #ifdef __MINGW32__
diff --git a/dlls/user32/winstation.c b/dlls/user32/winstation.c
index 96b51179..eebb8f9 100644
--- a/dlls/user32/winstation.c
+++ b/dlls/user32/winstation.c
@@ -462,9 +462,22 @@ BOOL WINAPI EnumDesktopsW( HWINSTA winsta, DESKTOPENUMPROCW func, LPARAM lparam
  */
 HDESK WINAPI OpenInputDesktop( DWORD flags, BOOL inherit, ACCESS_MASK access )
 {
-    FIXME( "(%x,%i,%x): stub\n", flags, inherit, access );
-    SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
-    return 0;
+    HWINSTA winsta;
+    USEROBJECTFLAGS info;
+
+    FIXME( "(%x,%i,%x): partial stub\n", flags, inherit, access );
+
+    winsta = GetProcessWindowStation();
+    memset(&info, 0, sizeof(info));
+    GetUserObjectInformationA( winsta, UOI_FLAGS, &info, sizeof(info), NULL);
+    if (info.dwFlags != WSF_VISIBLE)
+    {
+        SetLastError( ERROR_INVALID_FUNCTION );
+        return 0;
+    }
+    /* As long as SwitchDesktop is a stub, it is safe to assume OpenInputDesktop always
+       returns the default desktop. */
+    return OpenDesktopW( get_default_desktop(), flags, inherit, access );
 }
 
 


More information about the wine-devel mailing list