- moved all retated functions into one file - have a pseudo handle for desktops and window stations - implemented the GetUserObjectInformation with pseudo handles
Index: wine/dlls/user/Makefile.in =================================================================== RCS file: /home/wine/wine/dlls/user/Makefile.in,v retrieving revision 1.45 diff -d -u -r1.45 Makefile.in --- wine/dlls/user/Makefile.in 1 Aug 2002 18:36:58 -0000 1.45 +++ wine/dlls/user/Makefile.in 1 Aug 2002 19:46:54 -0000 @@ -59,6 +59,7 @@ dde/ddeml16.c \ dde/misc.c \ dde/server.c \ + desktop.c \ display.c \ exticon.c \ lstr.c \ @@ -116,3 +117,4 @@ user.exe.spec.c: resources/version16.res ### Dependencies: + Index: wine/dlls/user/misc.c =================================================================== RCS file: /home/wine/wine/dlls/user/misc.c,v retrieving revision 1.9 diff -d -u -r1.9 misc.c --- wine/dlls/user/misc.c 28 Jul 2002 23:48:27 -0000 1.9 +++ wine/dlls/user/misc.c 1 Aug 2002 19:46:54 -0000 @@ -54,44 +54,6 @@ SetLastError( error ); } - -/****************************************************************************** - * GetProcessWindowStation [USER32.@] Returns handle of window station - * - * NOTES - * Docs say the return value is HWINSTA - * - * RETURNS - * Success: Handle to window station associated with calling process - * Failure: NULL - */ -HWINSTA WINAPI GetProcessWindowStation(void) -{ - FIXME("(void): stub\n"); - return (HWINSTA)1; -} - - -/****************************************************************************** - * GetThreadDesktop [USER32.@] Returns handle to desktop - * - * NOTES - * Docs say the return value is HDESK - * - * PARAMS - * dwThreadId [I] Thread identifier - * - * RETURNS - * Success: Handle to desktop associated with specified thread - * Failure: NULL - */ -DWORD WINAPI GetThreadDesktop( DWORD dwThreadId ) -{ - FIXME("(%lx): stub\n",dwThreadId); - return 1; -} - - /****************************************************************************** * SetDebugErrorLevel [USER32.@] * Sets the minimum error level for generating debugging events @@ -104,7 +66,6 @@ FIXME("(%ld): stub\n", dwLevel); } - /****************************************************************************** * GetProcessDefaultLayout [USER32.@] * @@ -129,7 +90,6 @@ return TRUE; } - /****************************************************************************** * SetProcessDefaultLayout [USER32.@] * @@ -152,46 +112,6 @@ return FALSE; } - -/****************************************************************************** - * OpenDesktopA [USER32.@] - * - * NOTES - * Return type should be HDESK - * - * Not supported on Win9x - returns NULL and calls SetLastError. - */ -HANDLE WINAPI OpenDesktopA( LPCSTR lpszDesktop, DWORD dwFlags, - BOOL fInherit, DWORD dwDesiredAccess ) -{ - FIXME("(%s,%lx,%i,%lx): stub\n",debugstr_a(lpszDesktop),dwFlags, - fInherit,dwDesiredAccess); - - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - -/****************************************************************************** - * SetUserObjectInformationA (USER32.@) - */ -BOOL WINAPI SetUserObjectInformationA( HANDLE hObj, INT nIndex, - LPVOID pvInfo, DWORD nLength ) -{ - FIXME("(%x,%d,%p,%lx): stub\n",hObj,nIndex,pvInfo,nLength); - return TRUE; -} - -/****************************************************************************** - * SetThreadDesktop (USER32.@) - */ -BOOL WINAPI SetThreadDesktop( HANDLE hDesktop ) -{ - FIXME("(%x): stub\n",hDesktop); - return TRUE; -} - - /*********************************************************************** * RegisterShellHookWindow [USER32.@] */ @@ -201,7 +121,6 @@ return 0; } - /*********************************************************************** * DeregisterShellHookWindow [USER32.@] */ @@ -212,7 +131,6 @@ } - /*********************************************************************** * RegisterTasklist [USER32.@] */ Index: wine/windows/user.c =================================================================== RCS file: /home/wine/wine/windows/user.c,v retrieving revision 1.86 diff -d -u -r1.86 user.c --- wine/windows/user.c 31 May 2002 23:06:54 -0000 1.86 +++ wine/windows/user.c 1 Aug 2002 19:47:50 -0000 @@ -525,27 +525,6 @@ } /*********************************************************************** - * CreateWindowStationW (USER32.@) - */ -HWINSTA WINAPI CreateWindowStationW( - LPWSTR winstation,DWORD res1,DWORD desiredaccess, - LPSECURITY_ATTRIBUTES lpsa -) { - FIXME_(win32)("(%s,0x%08lx,0x%08lx,%p),stub!\n",debugstr_w(winstation), - res1,desiredaccess,lpsa - ); - return (HWINSTA)0xdeadcafe; -} - -/*********************************************************************** - * SetProcessWindowStation (USER32.@) - */ -BOOL WINAPI SetProcessWindowStation(HWINSTA hWinSta) { - FIXME_(win32)("(%d),stub!\n",hWinSta); - return TRUE; -} - -/*********************************************************************** * SetUserObjectSecurity (USER32.@) */ BOOL WINAPI SetUserObjectSecurity( @@ -558,69 +537,6 @@ } /*********************************************************************** - * CreateDesktopA (USER32.@) - */ -HDESK WINAPI CreateDesktopA( - LPSTR lpszDesktop,LPSTR lpszDevice,LPDEVMODEA pDevmode, - DWORD dwFlags,DWORD dwDesiredAccess,LPSECURITY_ATTRIBUTES lpsa -) { - FIXME_(win32)("(%s,%s,%p,0x%08lx,0x%08lx,%p),stub!\n", - lpszDesktop,lpszDevice,pDevmode, - dwFlags,dwDesiredAccess,lpsa - ); - return (HDESK)0xcafedead; -} - -/*********************************************************************** - * CreateDesktopW (USER32.@) - */ -HDESK WINAPI CreateDesktopW( - LPWSTR lpszDesktop,LPWSTR lpszDevice,LPDEVMODEW pDevmode, - DWORD dwFlags,DWORD dwDesiredAccess,LPSECURITY_ATTRIBUTES lpsa -) { - FIXME_(win32)("(%s,%s,%p,0x%08lx,0x%08lx,%p),stub!\n", - debugstr_w(lpszDesktop),debugstr_w(lpszDevice),pDevmode, - dwFlags,dwDesiredAccess,lpsa - ); - return (HDESK)0xcafedead; -} - -/*********************************************************************** - * EnumDesktopWindows (USER32.@) - */ -BOOL WINAPI EnumDesktopWindows( HDESK hDesktop, WNDENUMPROC lpfn, LPARAM lParam ) { - FIXME_(win32)("(0x%08x, %p, 0x%08lx), stub!\n", hDesktop, lpfn, lParam ); - return TRUE; -} - - -/*********************************************************************** - * CloseWindowStation (USER32.@) - */ -BOOL WINAPI CloseWindowStation(HWINSTA hWinSta) -{ - FIXME_(win32)("(0x%08x)\n", hWinSta); - return TRUE; -} - -/*********************************************************************** - * CloseDesktop (USER32.@) - */ -BOOL WINAPI CloseDesktop(HDESK hDesk) -{ - FIXME_(win32)("(0x%08x)\n", hDesk); - return TRUE; -} - -/*********************************************************************** - * SetWindowStationUser (USER32.@) - */ -DWORD WINAPI SetWindowStationUser(DWORD x1,DWORD x2) { - FIXME_(win32)("(0x%08lx,0x%08lx),stub!\n",x1,x2); - return 1; -} - -/*********************************************************************** * SetLogonNotifyWindow (USER32.@) */ DWORD WINAPI SetLogonNotifyWindow(HWINSTA hwinsta,HWND hwnd) { @@ -635,20 +551,7 @@ /* are loaded. */ return; } -/*********************************************************************** - * GetUserObjectInformationA (USER32.@) - */ -BOOL WINAPI GetUserObjectInformationA( 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; -} -/*********************************************************************** - * GetUserObjectInformationW (USER32.@) - */ -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; -} + /*********************************************************************** * GetUserObjectSecurity (USER32.@) */ --- /dev/null Sun Jul 14 16:54:37 2002 +++ wine/dlls/user/desktop.c Thu Jun 20 08:29:04 2002 @@ -0,0 +1,277 @@ +/* + * desktop and window station functions + * + * Copyright 1995 Thomas Sandford + * Copyright 1997 Marcus Meissner + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "winerror.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(win); + +/* + * since we don't have desktops and window stations we use magic handles + */ + +#define MAGIC_WINDOW_STATION 0xcafe0002 +#define MAGIC_DESKTOP 0xcafe0004 + +/****************************************************************************** + * GetProcessWindowStation [USER32.@] + * + * NOTES + * Docs say the return value is HWINSTA + * + * RETURNS + * Success: Handle to window station associated with calling process + * Failure: NULL + */ +HWINSTA WINAPI GetProcessWindowStation(void) +{ + return (HWINSTA) MAGIC_WINDOW_STATION; +} + +/*********************************************************************** + * SetProcessWindowStation (USER32.@) + */ +BOOL WINAPI SetProcessWindowStation(HWINSTA hWinSta) +{ + return TRUE; +} + +/*********************************************************************** + * CreateWindowStationW [USER32.@] + */ +HWINSTA WINAPI CreateWindowStationW( + LPWSTR winstation, + DWORD res1, + DWORD desiredaccess, + LPSECURITY_ATTRIBUTES lpsa) +{ + return (HWINSTA) MAGIC_WINDOW_STATION; +} + +/*********************************************************************** + * CloseWindowStation (USER32.@) + */ +BOOL WINAPI CloseWindowStation(HWINSTA hWinSta) +{ + return TRUE; +} + +/*********************************************************************** + * SetWindowStationUser (USER32.@) + */ +DWORD WINAPI SetWindowStationUser(DWORD x1,DWORD x2) +{ + FIXME("(0x%08lx,0x%08lx),stub!\n",x1,x2); + return 1; +} + + +/*********************************************************************** + * CreateDesktopA (USER32.@) + */ +HDESK WINAPI CreateDesktopA( + LPSTR lpszDesktop,LPSTR lpszDevice,LPDEVMODEA pDevmode, + DWORD dwFlags,DWORD dwDesiredAccess,LPSECURITY_ATTRIBUTES lpsa) +{ + FIXME("(%s,%s,%p,0x%08lx,0x%08lx,%p),stub!\n", + lpszDesktop,lpszDevice,pDevmode,dwFlags,dwDesiredAccess,lpsa); + return (HDESK) MAGIC_DESKTOP; +} + +/*********************************************************************** + * CreateDesktopW (USER32.@) + */ +HDESK WINAPI CreateDesktopW( + LPWSTR lpszDesktop,LPWSTR lpszDevice,LPDEVMODEW pDevmode, + DWORD dwFlags,DWORD dwDesiredAccess,LPSECURITY_ATTRIBUTES lpsa +) { + FIXME("(%s,%s,%p,0x%08lx,0x%08lx,%p),stub!\n", + debugstr_w(lpszDesktop),debugstr_w(lpszDevice),pDevmode,dwFlags,dwDesiredAccess,lpsa); + return (HDESK) MAGIC_DESKTOP; +} + +/****************************************************************************** + * OpenDesktopA [USER32.@] + * + * NOTES + * Return type should be HDESK + * + * Not supported on Win9x - returns NULL and calls SetLastError. + */ +HDESK WINAPI OpenDesktopA( LPCSTR lpszDesktop, DWORD dwFlags, BOOL fInherit, DWORD dwDesiredAccess ) +{ + return (HDESK) MAGIC_DESKTOP; +} + +/*********************************************************************** + * CloseDesktop (USER32.@) + */ +BOOL WINAPI CloseDesktop(HDESK hDesk) +{ + FIXME("(0x%08x)\n", hDesk); + return TRUE; +} + +/****************************************************************************** + * GetThreadDesktop [USER32.@] + * + * NOTES + * Docs say the return value is HDESK + * + * PARAMS + * dwThreadId [I] Thread identifier + * + * RETURNS + * Success: Handle to desktop associated with specified thread + * Failure: NULL + */ +HDESK WINAPI GetThreadDesktop( DWORD dwThreadId ) +{ + return (HDESK) MAGIC_DESKTOP; +} + +/****************************************************************************** + * SetThreadDesktop (USER32.@) + */ +BOOL WINAPI SetThreadDesktop( HDESK hDesktop ) +{ + FIXME("(%x): stub\n", hDesktop); + return TRUE; +} + +/*********************************************************************** + * GetUserObjectInformationA (USER32.@) + */ +BOOL WINAPI GetUserObjectInformationA( HANDLE hObj, INT nIndex, LPVOID pvInfo, DWORD nLength, LPDWORD lpnLen ) +{ + FIXME("(0x%x %i %p %ld %p),stub!\n", hObj, nIndex, pvInfo, nLength, lpnLen ); + + if (hObj == MAGIC_WINDOW_STATION) { + if( nIndex == 1) { + ((LPDWORD)pvInfo)[0] = 0; + ((LPDWORD)pvInfo)[1] = 0; + ((LPDWORD)pvInfo)[2] = 1; + *lpnLen = 12; + } + else if( nIndex == 2) { + strncpy(pvInfo, "WinSta0", nLength); + *lpnLen = strlen (pvInfo); + } + else if( nIndex == 3) { + strncpy(pvInfo, "WindowStation", nLength); + *lpnLen = strlen (pvInfo); + } + } + else if (hObj == MAGIC_DESKTOP) { + if( nIndex == 1) { + ((LPDWORD)pvInfo)[0] = 0; + ((LPDWORD)pvInfo)[1] = 0; + ((LPDWORD)pvInfo)[2] = 0; + *lpnLen = 12; + } + else if( nIndex == 2) { + strncpy(pvInfo, "Default", nLength); + *lpnLen = strlen (pvInfo); + } + else if( nIndex == 3) { + strncpy(pvInfo, "Desktop", nLength); + *lpnLen = strlen (pvInfo); + } + } + + return TRUE; +} + +/*********************************************************************** + * GetUserObjectInformationW (USER32.@) + */ +BOOL WINAPI GetUserObjectInformationW( HANDLE hObj, INT nIndex, LPVOID pvInfo, DWORD nLength, LPDWORD lpnLen ) +{ + WCHAR sWinSta0[8] = {'W','i','n','S','t','a','0','\0'}; + WCHAR sWindowStation[14] = {'W','i','n','d','o','w','S','t','a','t','i','o','n','\0'}; + WCHAR sDefault[8] = {'D','e','f','a','u','l','t','\0'}; + WCHAR sDesktop[8] = {'D','e','s','k','t','o','p','\0'}; + + FIXME("(0x%x %i %p %ld %p),stub!\n", hObj, nIndex, pvInfo, nLength, lpnLen ); + + if (hObj == MAGIC_WINDOW_STATION) { + if( nIndex == 1) { + ((LPDWORD)pvInfo)[0] = 0; + ((LPDWORD)pvInfo)[1] = 0; + ((LPDWORD)pvInfo)[2] = 1; + *lpnLen = 12; + } + else if( nIndex == 2) { + lstrcpynW(pvInfo, sWinSta0, nLength); + *lpnLen = lstrlenW (pvInfo) * sizeof(WCHAR); + } + else if( nIndex == 3) { + lstrcpynW(pvInfo, sWindowStation, nLength); + *lpnLen = lstrlenW (pvInfo) * sizeof(WCHAR); + } + } + else if (hObj == MAGIC_DESKTOP) { + if( nIndex == 1) { + ((LPDWORD)pvInfo)[0] = 0; + ((LPDWORD)pvInfo)[1] = 0; + ((LPDWORD)pvInfo)[2] = 0; + *lpnLen = 12; + } + else if( nIndex == 2) { + lstrcpynW(pvInfo, sDefault, nLength); + *lpnLen = lstrlenW (pvInfo) * sizeof(WCHAR); + } + else if( nIndex == 3) { + lstrcpynW(pvInfo, sDesktop, nLength); + *lpnLen = lstrlenW (pvInfo) * sizeof(WCHAR); + } + } + + return TRUE; +} + +/****************************************************************************** + * SetUserObjectInformationA (USER32.@) + */ +BOOL WINAPI SetUserObjectInformationA( HANDLE hObj, INT nIndex, + LPVOID pvInfo, DWORD nLength ) +{ + FIXME("(%x,%d,%p,%lx): stub\n",hObj,nIndex,pvInfo,nLength); + return TRUE; +} + +/*********************************************************************** + * EnumDesktopWindows (USER32.@) + */ +BOOL WINAPI EnumDesktopWindows( HDESK hDesktop, WNDENUMPROC lpfn, LPARAM lParam ) +{ + FIXME("(0x%08x, %p, 0x%08lx), stub!\n", hDesktop, lpfn, lParam ); + return TRUE; +} + + + +