Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Misc USER functions |
| 3 | * |
| 4 | * Copyright 1995 Thomas Sandford |
| 5 | * Copyright 1997 Marcus Meissner |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 6 | * |
| 7 | * This library is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU Lesser General Public |
| 9 | * License as published by the Free Software Foundation; either |
| 10 | * version 2.1 of the License, or (at your option) any later version. |
| 11 | * |
| 12 | * This library is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * Lesser General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU Lesser General Public |
| 18 | * License along with this library; if not, write to the Free Software |
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 20 | */ |
| 21 | |
| 22 | #include "windef.h" |
| 23 | #include "winbase.h" |
| 24 | #include "wingdi.h" |
| 25 | #include "winuser.h" |
| 26 | #include "winerror.h" |
| 27 | |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 28 | #include "wine/debug.h" |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 29 | |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 30 | WINE_DEFAULT_DEBUG_CHANNEL(win); |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 31 | |
| 32 | /********************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 33 | * SetLastErrorEx [USER32.@] Sets the last-error code. |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 34 | * |
| 35 | * RETURNS |
| 36 | * None. |
| 37 | */ |
| 38 | void WINAPI SetLastErrorEx( |
| 39 | DWORD error, /* [in] Per-thread error code */ |
| 40 | DWORD type) /* [in] Error type */ |
| 41 | { |
| 42 | TRACE("(0x%08lx, 0x%08lx)\n", error,type); |
| 43 | switch(type) { |
| 44 | case 0: |
| 45 | break; |
| 46 | case SLE_ERROR: |
| 47 | case SLE_MINORERROR: |
| 48 | case SLE_WARNING: |
| 49 | /* Fall through for now */ |
| 50 | default: |
| 51 | FIXME("(error=%08lx, type=%08lx): Unhandled type\n", error,type); |
| 52 | break; |
| 53 | } |
| 54 | SetLastError( error ); |
| 55 | } |
| 56 | |
| 57 | |
| 58 | /****************************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 59 | * GetProcessWindowStation [USER32.@] Returns handle of window station |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 60 | * |
| 61 | * NOTES |
| 62 | * Docs say the return value is HWINSTA |
| 63 | * |
| 64 | * RETURNS |
| 65 | * Success: Handle to window station associated with calling process |
| 66 | * Failure: NULL |
| 67 | */ |
François Gouget | 54300e5 | 2001-01-09 20:56:06 +0000 | [diff] [blame] | 68 | HWINSTA WINAPI GetProcessWindowStation(void) |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 69 | { |
| 70 | FIXME("(void): stub\n"); |
François Gouget | 54300e5 | 2001-01-09 20:56:06 +0000 | [diff] [blame] | 71 | return (HWINSTA)1; |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | |
| 75 | /****************************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 76 | * GetThreadDesktop [USER32.@] Returns handle to desktop |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 77 | * |
| 78 | * NOTES |
| 79 | * Docs say the return value is HDESK |
| 80 | * |
| 81 | * PARAMS |
| 82 | * dwThreadId [I] Thread identifier |
| 83 | * |
| 84 | * RETURNS |
| 85 | * Success: Handle to desktop associated with specified thread |
| 86 | * Failure: NULL |
| 87 | */ |
| 88 | DWORD WINAPI GetThreadDesktop( DWORD dwThreadId ) |
| 89 | { |
| 90 | FIXME("(%lx): stub\n",dwThreadId); |
| 91 | return 1; |
| 92 | } |
| 93 | |
| 94 | |
| 95 | /****************************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 96 | * SetDebugErrorLevel [USER32.@] |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 97 | * Sets the minimum error level for generating debugging events |
| 98 | * |
| 99 | * PARAMS |
| 100 | * dwLevel [I] Debugging error level |
| 101 | */ |
| 102 | VOID WINAPI SetDebugErrorLevel( DWORD dwLevel ) |
| 103 | { |
| 104 | FIXME("(%ld): stub\n", dwLevel); |
| 105 | } |
| 106 | |
| 107 | |
| 108 | /****************************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 109 | * GetProcessDefaultLayout [USER32.@] |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 110 | * |
| 111 | * Gets the default layout for parentless windows. |
| 112 | * Right now, just returns 0 (left-to-right). |
| 113 | * |
| 114 | * RETURNS |
| 115 | * Success: Nonzero |
| 116 | * Failure: Zero |
| 117 | * |
| 118 | * BUGS |
| 119 | * No RTL |
| 120 | */ |
| 121 | BOOL WINAPI GetProcessDefaultLayout( DWORD *pdwDefaultLayout ) |
| 122 | { |
| 123 | if ( !pdwDefaultLayout ) { |
| 124 | SetLastError( ERROR_INVALID_PARAMETER ); |
| 125 | return FALSE; |
| 126 | } |
| 127 | FIXME( "( %p ): No BiDi\n", pdwDefaultLayout ); |
| 128 | *pdwDefaultLayout = 0; |
| 129 | return TRUE; |
| 130 | } |
| 131 | |
| 132 | |
| 133 | /****************************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 134 | * SetProcessDefaultLayout [USER32.@] |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 135 | * |
| 136 | * Sets the default layout for parentless windows. |
| 137 | * Right now, only accepts 0 (left-to-right). |
| 138 | * |
| 139 | * RETURNS |
| 140 | * Success: Nonzero |
| 141 | * Failure: Zero |
| 142 | * |
| 143 | * BUGS |
| 144 | * No RTL |
| 145 | */ |
| 146 | BOOL WINAPI SetProcessDefaultLayout( DWORD dwDefaultLayout ) |
| 147 | { |
| 148 | if ( dwDefaultLayout == 0 ) |
| 149 | return TRUE; |
| 150 | FIXME( "( %08lx ): No BiDi\n", dwDefaultLayout ); |
| 151 | SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); |
| 152 | return FALSE; |
| 153 | } |
| 154 | |
| 155 | |
| 156 | /****************************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 157 | * OpenDesktopA [USER32.@] |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 158 | * |
| 159 | * NOTES |
| 160 | * Return type should be HDESK |
| 161 | * |
| 162 | * Not supported on Win9x - returns NULL and calls SetLastError. |
| 163 | */ |
| 164 | HANDLE WINAPI OpenDesktopA( LPCSTR lpszDesktop, DWORD dwFlags, |
| 165 | BOOL fInherit, DWORD dwDesiredAccess ) |
| 166 | { |
| 167 | FIXME("(%s,%lx,%i,%lx): stub\n",debugstr_a(lpszDesktop),dwFlags, |
| 168 | fInherit,dwDesiredAccess); |
| 169 | |
| 170 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED); |
| 171 | return 0; |
| 172 | } |
| 173 | |
| 174 | |
| 175 | /****************************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 176 | * SetUserObjectInformationA (USER32.@) |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 177 | */ |
| 178 | BOOL WINAPI SetUserObjectInformationA( HANDLE hObj, INT nIndex, |
| 179 | LPVOID pvInfo, DWORD nLength ) |
| 180 | { |
| 181 | FIXME("(%x,%d,%p,%lx): stub\n",hObj,nIndex,pvInfo,nLength); |
| 182 | return TRUE; |
| 183 | } |
| 184 | |
| 185 | /****************************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 186 | * SetThreadDesktop (USER32.@) |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 187 | */ |
| 188 | BOOL WINAPI SetThreadDesktop( HANDLE hDesktop ) |
| 189 | { |
| 190 | FIXME("(%x): stub\n",hDesktop); |
| 191 | return TRUE; |
| 192 | } |
| 193 | |
| 194 | |
| 195 | /*********************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 196 | * RegisterShellHookWindow [USER32.@] |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 197 | */ |
| 198 | HRESULT WINAPI RegisterShellHookWindow ( DWORD u ) |
| 199 | { |
| 200 | FIXME("0x%08lx stub\n",u); |
| 201 | return 0; |
| 202 | } |
| 203 | |
| 204 | |
| 205 | /*********************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 206 | * DeregisterShellHookWindow [USER32.@] |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 207 | */ |
| 208 | HRESULT WINAPI DeregisterShellHookWindow ( DWORD u ) |
| 209 | { |
| 210 | FIXME("0x%08lx stub\n",u); |
| 211 | return 0; |
| 212 | |
| 213 | } |
| 214 | |
| 215 | |
| 216 | /*********************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 217 | * RegisterTasklist [USER32.@] |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 218 | */ |
Alexandre Julliard | 07b1ac8 | 2000-11-25 21:43:04 +0000 | [diff] [blame] | 219 | DWORD WINAPI RegisterTasklist (DWORD x) |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 220 | { |
| 221 | FIXME("0x%08lx\n",x); |
| 222 | return TRUE; |
| 223 | } |
Alexandre Julliard | 3850c1a | 2000-08-06 02:42:46 +0000 | [diff] [blame] | 224 | |
| 225 | /*********************************************************************** |
Patrik Stridvall | 01d5e5b | 2001-07-02 19:59:40 +0000 | [diff] [blame] | 226 | * USER_489 (USER.489) |
Alexandre Julliard | 3850c1a | 2000-08-06 02:42:46 +0000 | [diff] [blame] | 227 | */ |
| 228 | LONG WINAPI stub_USER_489(void) { FIXME("stub\n"); return 0; } |
| 229 | |
| 230 | /*********************************************************************** |
Patrik Stridvall | 01d5e5b | 2001-07-02 19:59:40 +0000 | [diff] [blame] | 231 | * USER_490 (USER.490) |
Alexandre Julliard | 3850c1a | 2000-08-06 02:42:46 +0000 | [diff] [blame] | 232 | */ |
| 233 | LONG WINAPI stub_USER_490(void) { FIXME("stub\n"); return 0; } |
| 234 | |
| 235 | /*********************************************************************** |
Patrik Stridvall | 01d5e5b | 2001-07-02 19:59:40 +0000 | [diff] [blame] | 236 | * USER_492 (USER.492) |
Alexandre Julliard | 3850c1a | 2000-08-06 02:42:46 +0000 | [diff] [blame] | 237 | */ |
| 238 | LONG WINAPI stub_USER_492(void) { FIXME("stub\n"); return 0; } |
| 239 | |
| 240 | /*********************************************************************** |
Patrik Stridvall | 01d5e5b | 2001-07-02 19:59:40 +0000 | [diff] [blame] | 241 | * USER_496 (USER.496) |
Alexandre Julliard | 3850c1a | 2000-08-06 02:42:46 +0000 | [diff] [blame] | 242 | */ |
| 243 | LONG WINAPI stub_USER_496(void) { FIXME("stub\n"); return 0; } |