more detailed fake info in GetUserObjectInformationW...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Changelog:
    Attempt to fill in fake information in GetUserObjectInformationW
in order to get an XP app to run.  The output is the same as XP for
a test program, but the code is otherwise useless...
Index: dlls/user/misc.c
===================================================================
RCS file: /home/wine/wine/dlls/user/misc.c,v
retrieving revision 1.9
diff -u -r1.9 misc.c
--- dlls/user/misc.c	28 Jul 2002 23:48:27 -0000	1.9
+++ dlls/user/misc.c	20 Sep 2002 17:25:32 -0000
@@ -68,7 +68,7 @@
 HWINSTA WINAPI GetProcessWindowStation(void)
 {
     FIXME("(void): stub\n");
-    return (HWINSTA)1;
+    return (HWINSTA)2004;
 }
 
 
@@ -88,7 +88,7 @@
 DWORD WINAPI GetThreadDesktop( DWORD dwThreadId )
 {
     FIXME("(%lx): stub\n",dwThreadId);
-    return 1;
+    return 2000;
 }
 
 
Index: include/user.h
===================================================================
RCS file: /home/wine/wine/include/user.h,v
retrieving revision 1.41
diff -u -r1.41 user.h
--- include/user.h	28 Aug 2002 00:39:39 -0000	1.41
+++ include/user.h	20 Sep 2002 17:25:32 -0000
@@ -145,4 +145,20 @@
 #define HACCEL_32(h16)  ((HACCEL)(ULONG_PTR)(h16))
 #define HACCEL_16(h32)  (LOWORD(h32))
 
+/* GetUserObjectInformation and friends... */
+#define UOI_FLAGS       1
+#define UOI_NAME        2
+#define UOI_TYPE        3
+#define UOI_USER_SID    4
+
+#define WSF_VISIBLE     1
+#define DF_ALLOWOTHERACCOUNTHOOK  1
+
+typedef struct tagUSEROBJECTFLAGS {
+   BOOL fInherit;
+   BOOL fReserved;
+   DWORD dwFlags;
+} USEROBJECTFLAGS;
+
+
 #endif  /* __WINE_USER_H */
Index: windows/user.c
===================================================================
RCS file: /home/wine/wine/windows/user.c,v
retrieving revision 1.86
diff -u -r1.86 user.c
--- windows/user.c	31 May 2002 23:06:54 -0000	1.86
+++ windows/user.c	20 Sep 2002 17:25:33 -0000
@@ -642,12 +642,64 @@
 {	FIXME_(win32)("(0x%x %i %p %ld %p),stub!\n", hObj, nIndex, pvInfo, nLength, lpnLen );
 	return TRUE;
 }
+
+/* is this handle a window station? */
+static BOOL UserHandleIsWS(HANDLE hObj) {  return (hObj==(DWORD) 2004); }
+
 /***********************************************************************
  *		GetUserObjectInformationW (USER32.@)
+ *
+ * FIXME: This is a horrific hack! it acts like win xp, 
+ *          but it doesn't actually do anything!
  */
 BOOL WINAPI GetUserObjectInformationW( HANDLE hObj, INT nIndex, LPVOID pvInfo, DWORD nLength, LPDWORD lpnLen )
-{	FIXME_(win32)("(0x%x %i %p %ld %p),stub!\n", hObj, nIndex, pvInfo, nLength, lpnLen );
-	return TRUE;
+{
+   if (nIndex==UOI_FLAGS) {
+      USEROBJECTFLAGS uof, *nuof = (USEROBJECTFLAGS *) pvInfo;
+      
+      if (pvInfo!=NULL && nLength>=sizeof(uof)) {
+	 uof.fInherit = 0;
+	 uof.fReserved = 0;
+	 uof.dwFlags = UserHandleIsWS(hObj) ? WSF_VISIBLE : 0;
+	 *nuof = uof;
+      }
+
+      if (lpnLen!=NULL) *lpnLen = sizeof(uof);
+
+      return TRUE;
+   }
+   else if (nIndex==UOI_NAME) {
+      WCHAR output[64];
+      const char *name = UserHandleIsWS(hObj) ? "WinSta0" : "Default";
+      const int len = MultiByteToWideChar(CP_ACP, 0, name, -1, output, sizeof(output));
+
+      if (pvInfo!=NULL) {
+	 wcsncpy(pvInfo, output, nLength/sizeof(output[0]));
+      }
+
+      if (lpnLen!=NULL) {
+	 *lpnLen = len*sizeof(output[0]);
+      }
+      return TRUE;
+   }
+   else if (nIndex==UOI_TYPE) {
+      WCHAR output[64];
+      const char *name = UserHandleIsWS(hObj) ? "WindowStation" : "Desktop";
+      const int len = MultiByteToWideChar(CP_ACP, 0, name, -1, output, sizeof(output));
+
+      if (pvInfo!=NULL) {
+	 wcsncpy(pvInfo, output, nLength/sizeof(output[0]));
+      }
+
+      if (lpnLen!=NULL) {
+	 *lpnLen = len*sizeof(output[0]);
+      }
+      return TRUE;
+   }
+   else if (nIndex==UOI_USER_SID) {
+   }
+   FIXME_(win32)("(0x%x %i %p %ld %p),stub!\n", hObj, nIndex, pvInfo, nLength, lpnLen );
+   return TRUE;
 }
 /***********************************************************************
  *		GetUserObjectSecurity (USER32.@)

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux