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 | |
Alexandre Julliard | e37c6e1 | 2003-09-05 23:08:26 +0000 | [diff] [blame] | 22 | #include <stdarg.h> |
| 23 | |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 24 | #include "windef.h" |
| 25 | #include "winbase.h" |
| 26 | #include "wingdi.h" |
| 27 | #include "winuser.h" |
| 28 | #include "winerror.h" |
Bobby Bingham | f0ee76d | 2004-03-09 00:41:39 +0000 | [diff] [blame] | 29 | #include "winnls.h" |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 30 | |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 31 | #include "wine/debug.h" |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 32 | |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 33 | WINE_DEFAULT_DEBUG_CHANNEL(win); |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 34 | |
Bobby Bingham | f0ee76d | 2004-03-09 00:41:39 +0000 | [diff] [blame] | 35 | /* callback to allow EnumDesktopsA to use EnumDesktopsW */ |
| 36 | typedef struct { |
| 37 | DESKTOPENUMPROCA lpEnumFunc; |
| 38 | LPARAM lParam; |
| 39 | } ENUMDESKTOPS_LPARAM; |
| 40 | |
| 41 | /* EnumDesktopsA passes this callback function to EnumDesktopsW. |
| 42 | * It simply converts the string to ASCII and calls the callback |
| 43 | * function provided by the original caller |
| 44 | */ |
| 45 | static BOOL CALLBACK EnumDesktopProcWtoA(LPWSTR lpszDesktop, LPARAM lParam) |
| 46 | { |
| 47 | LPSTR buffer; |
| 48 | INT len; |
| 49 | BOOL ret; |
| 50 | ENUMDESKTOPS_LPARAM *data = (ENUMDESKTOPS_LPARAM *)lParam; |
| 51 | |
| 52 | len = WideCharToMultiByte(CP_ACP, 0, lpszDesktop, -1, NULL, 0, NULL, NULL); |
| 53 | if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len))) return FALSE; |
| 54 | WideCharToMultiByte(CP_ACP, 0, lpszDesktop, -1, buffer, len, NULL, NULL); |
| 55 | |
| 56 | ret = data->lpEnumFunc(buffer, data->lParam); |
| 57 | |
| 58 | HeapFree(GetProcessHeap(), 0, buffer); |
| 59 | return ret; |
| 60 | } |
| 61 | |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 62 | /********************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 63 | * SetLastErrorEx [USER32.@] Sets the last-error code. |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 64 | * |
| 65 | * RETURNS |
| 66 | * None. |
| 67 | */ |
| 68 | void WINAPI SetLastErrorEx( |
| 69 | DWORD error, /* [in] Per-thread error code */ |
| 70 | DWORD type) /* [in] Error type */ |
| 71 | { |
| 72 | TRACE("(0x%08lx, 0x%08lx)\n", error,type); |
| 73 | switch(type) { |
| 74 | case 0: |
| 75 | break; |
| 76 | case SLE_ERROR: |
| 77 | case SLE_MINORERROR: |
| 78 | case SLE_WARNING: |
| 79 | /* Fall through for now */ |
| 80 | default: |
| 81 | FIXME("(error=%08lx, type=%08lx): Unhandled type\n", error,type); |
| 82 | break; |
| 83 | } |
| 84 | SetLastError( error ); |
| 85 | } |
| 86 | |
| 87 | |
| 88 | /****************************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 89 | * GetProcessWindowStation [USER32.@] Returns handle of window station |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 90 | * |
| 91 | * NOTES |
| 92 | * Docs say the return value is HWINSTA |
| 93 | * |
| 94 | * RETURNS |
| 95 | * Success: Handle to window station associated with calling process |
| 96 | * Failure: NULL |
| 97 | */ |
François Gouget | 54300e5 | 2001-01-09 20:56:06 +0000 | [diff] [blame] | 98 | HWINSTA WINAPI GetProcessWindowStation(void) |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 99 | { |
| 100 | FIXME("(void): stub\n"); |
François Gouget | 54300e5 | 2001-01-09 20:56:06 +0000 | [diff] [blame] | 101 | return (HWINSTA)1; |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 102 | } |
| 103 | |
| 104 | |
| 105 | /****************************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 106 | * GetThreadDesktop [USER32.@] Returns handle to desktop |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 107 | * |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 108 | * PARAMS |
| 109 | * dwThreadId [I] Thread identifier |
| 110 | * |
| 111 | * RETURNS |
| 112 | * Success: Handle to desktop associated with specified thread |
| 113 | * Failure: NULL |
| 114 | */ |
Sami Aario | dd0a1f9 | 2004-04-06 03:21:13 +0000 | [diff] [blame] | 115 | HDESK WINAPI GetThreadDesktop( DWORD dwThreadId ) |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 116 | { |
| 117 | FIXME("(%lx): stub\n",dwThreadId); |
Sami Aario | dd0a1f9 | 2004-04-06 03:21:13 +0000 | [diff] [blame] | 118 | return (HDESK)1; |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | |
| 122 | /****************************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 123 | * SetDebugErrorLevel [USER32.@] |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 124 | * Sets the minimum error level for generating debugging events |
| 125 | * |
| 126 | * PARAMS |
| 127 | * dwLevel [I] Debugging error level |
| 128 | */ |
| 129 | VOID WINAPI SetDebugErrorLevel( DWORD dwLevel ) |
| 130 | { |
| 131 | FIXME("(%ld): stub\n", dwLevel); |
| 132 | } |
| 133 | |
| 134 | |
| 135 | /****************************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 136 | * GetProcessDefaultLayout [USER32.@] |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 137 | * |
| 138 | * Gets the default layout for parentless windows. |
| 139 | * Right now, just returns 0 (left-to-right). |
| 140 | * |
| 141 | * RETURNS |
| 142 | * Success: Nonzero |
| 143 | * Failure: Zero |
| 144 | * |
| 145 | * BUGS |
| 146 | * No RTL |
| 147 | */ |
| 148 | BOOL WINAPI GetProcessDefaultLayout( DWORD *pdwDefaultLayout ) |
| 149 | { |
| 150 | if ( !pdwDefaultLayout ) { |
| 151 | SetLastError( ERROR_INVALID_PARAMETER ); |
| 152 | return FALSE; |
| 153 | } |
| 154 | FIXME( "( %p ): No BiDi\n", pdwDefaultLayout ); |
| 155 | *pdwDefaultLayout = 0; |
| 156 | return TRUE; |
| 157 | } |
| 158 | |
| 159 | |
| 160 | /****************************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 161 | * SetProcessDefaultLayout [USER32.@] |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 162 | * |
| 163 | * Sets the default layout for parentless windows. |
| 164 | * Right now, only accepts 0 (left-to-right). |
| 165 | * |
| 166 | * RETURNS |
| 167 | * Success: Nonzero |
| 168 | * Failure: Zero |
| 169 | * |
| 170 | * BUGS |
| 171 | * No RTL |
| 172 | */ |
| 173 | BOOL WINAPI SetProcessDefaultLayout( DWORD dwDefaultLayout ) |
| 174 | { |
| 175 | if ( dwDefaultLayout == 0 ) |
| 176 | return TRUE; |
| 177 | FIXME( "( %08lx ): No BiDi\n", dwDefaultLayout ); |
| 178 | SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); |
| 179 | return FALSE; |
| 180 | } |
| 181 | |
| 182 | |
| 183 | /****************************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 184 | * OpenDesktopA [USER32.@] |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 185 | * |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 186 | * Not supported on Win9x - returns NULL and calls SetLastError. |
| 187 | */ |
Sami Aario | dd0a1f9 | 2004-04-06 03:21:13 +0000 | [diff] [blame] | 188 | HDESK WINAPI OpenDesktopA( LPCSTR lpszDesktop, DWORD dwFlags, |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 189 | BOOL fInherit, DWORD dwDesiredAccess ) |
| 190 | { |
| 191 | FIXME("(%s,%lx,%i,%lx): stub\n",debugstr_a(lpszDesktop),dwFlags, |
| 192 | fInherit,dwDesiredAccess); |
| 193 | |
| 194 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED); |
| 195 | return 0; |
| 196 | } |
| 197 | |
Bobby Bingham | f0ee76d | 2004-03-09 00:41:39 +0000 | [diff] [blame] | 198 | /****************************************************************************** |
| 199 | * EnumDesktopsA [USER32.@] |
| 200 | */ |
| 201 | BOOL WINAPI EnumDesktopsA( HWINSTA hwinsta, DESKTOPENUMPROCA lpEnumFunc, |
| 202 | LPARAM lParam ) |
| 203 | { |
| 204 | ENUMDESKTOPS_LPARAM caller_data; |
| 205 | |
| 206 | caller_data.lpEnumFunc = lpEnumFunc; |
| 207 | caller_data.lParam = lParam; |
| 208 | |
| 209 | return EnumDesktopsW(hwinsta, EnumDesktopProcWtoA, (LPARAM) &caller_data); |
| 210 | } |
| 211 | |
| 212 | /****************************************************************************** |
| 213 | * EnumDesktopsW [USER32.@] |
| 214 | */ |
| 215 | BOOL WINAPI EnumDesktopsW( HWINSTA hwinsta, DESKTOPENUMPROCW lpEnumFunc, |
| 216 | LPARAM lParam ) |
| 217 | { |
| 218 | FIXME("%p,%p,%lx): stub\n",hwinsta,lpEnumFunc,lParam); |
| 219 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED); |
| 220 | return FALSE; |
| 221 | } |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 222 | |
| 223 | /****************************************************************************** |
Sami Aario | 78f1224 | 2004-04-07 19:41:21 +0000 | [diff] [blame] | 224 | * EnumWindowStationsA [USER32.@] |
| 225 | */ |
| 226 | BOOL WINAPI EnumWindowStationsA( WINSTAENUMPROCA lpEnumFunc, LPARAM lParam) |
| 227 | { |
| 228 | FIXME("%p,%lx): stub\n",lpEnumFunc,lParam); |
| 229 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED); |
| 230 | return FALSE; |
| 231 | } |
| 232 | |
| 233 | /****************************************************************************** |
| 234 | * EnumWindowStationsW [USER32.@] |
| 235 | */ |
| 236 | BOOL WINAPI EnumWindowStationsW( WINSTAENUMPROCW lpEnumFunc, LPARAM lParam) |
| 237 | { |
| 238 | FIXME("%p,%lx): stub\n",lpEnumFunc,lParam); |
| 239 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED); |
| 240 | return FALSE; |
| 241 | } |
| 242 | |
| 243 | /****************************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 244 | * SetUserObjectInformationA (USER32.@) |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 245 | */ |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 246 | BOOL WINAPI SetUserObjectInformationA( HANDLE hObj, INT nIndex, |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 247 | LPVOID pvInfo, DWORD nLength ) |
| 248 | { |
Alexandre Julliard | aff7dda | 2002-11-22 21:22:14 +0000 | [diff] [blame] | 249 | FIXME("(%p,%d,%p,%lx): stub\n",hObj,nIndex,pvInfo,nLength); |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 250 | return TRUE; |
| 251 | } |
| 252 | |
| 253 | /****************************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 254 | * SetThreadDesktop (USER32.@) |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 255 | */ |
| 256 | BOOL WINAPI SetThreadDesktop( HANDLE hDesktop ) |
| 257 | { |
Alexandre Julliard | aff7dda | 2002-11-22 21:22:14 +0000 | [diff] [blame] | 258 | FIXME("(%p): stub\n",hDesktop); |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 259 | return TRUE; |
| 260 | } |
| 261 | |
| 262 | |
| 263 | /*********************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 264 | * RegisterShellHookWindow [USER32.@] |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 265 | */ |
Robert Shearman | d0019a6 | 2003-01-13 20:36:39 +0000 | [diff] [blame] | 266 | BOOL WINAPI RegisterShellHookWindow ( HWND hWnd ) |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 267 | { |
Robert Shearman | d0019a6 | 2003-01-13 20:36:39 +0000 | [diff] [blame] | 268 | FIXME("(%p): stub\n", hWnd); |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 269 | return 0; |
| 270 | } |
| 271 | |
| 272 | |
| 273 | /*********************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 274 | * DeregisterShellHookWindow [USER32.@] |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 275 | */ |
| 276 | HRESULT WINAPI DeregisterShellHookWindow ( DWORD u ) |
| 277 | { |
| 278 | FIXME("0x%08lx stub\n",u); |
| 279 | return 0; |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 280 | |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 281 | } |
| 282 | |
| 283 | |
| 284 | /*********************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 285 | * RegisterTasklist [USER32.@] |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 286 | */ |
Alexandre Julliard | 07b1ac8 | 2000-11-25 21:43:04 +0000 | [diff] [blame] | 287 | DWORD WINAPI RegisterTasklist (DWORD x) |
Alexandre Julliard | 93652e1 | 2000-08-04 04:21:02 +0000 | [diff] [blame] | 288 | { |
| 289 | FIXME("0x%08lx\n",x); |
| 290 | return TRUE; |
| 291 | } |
Alexandre Julliard | 3850c1a | 2000-08-06 02:42:46 +0000 | [diff] [blame] | 292 | |
Alexandre Julliard | 13f2a17 | 2002-07-28 23:48:27 +0000 | [diff] [blame] | 293 | |
| 294 | /*********************************************************************** |
| 295 | * GetAppCompatFlags (USER32.@) |
| 296 | */ |
| 297 | DWORD WINAPI GetAppCompatFlags( HTASK hTask ) |
| 298 | { |
| 299 | FIXME("stub\n"); |
| 300 | return 0; |
| 301 | } |
| 302 | |
| 303 | |
Alexandre Julliard | 3850c1a | 2000-08-06 02:42:46 +0000 | [diff] [blame] | 304 | /*********************************************************************** |
Robert Shearman | d0019a6 | 2003-01-13 20:36:39 +0000 | [diff] [blame] | 305 | * AlignRects (USER32.@) |
| 306 | */ |
| 307 | BOOL WINAPI AlignRects(LPRECT rect, DWORD b, DWORD c, DWORD d) |
| 308 | { |
| 309 | FIXME("(%p, %ld, %ld, %ld): stub\n", rect, b, c, d); |
| 310 | if (rect) |
| 311 | FIXME("rect: [[%ld, %ld], [%ld, %ld]]\n", rect->left, rect->top, rect->right, rect->bottom); |
| 312 | /* Calls OffsetRect */ |
| 313 | return FALSE; |
| 314 | } |
| 315 | |
| 316 | |
| 317 | /*********************************************************************** |
Patrik Stridvall | 01d5e5b | 2001-07-02 19:59:40 +0000 | [diff] [blame] | 318 | * USER_489 (USER.489) |
Alexandre Julliard | 3850c1a | 2000-08-06 02:42:46 +0000 | [diff] [blame] | 319 | */ |
| 320 | LONG WINAPI stub_USER_489(void) { FIXME("stub\n"); return 0; } |
| 321 | |
| 322 | /*********************************************************************** |
Patrik Stridvall | 01d5e5b | 2001-07-02 19:59:40 +0000 | [diff] [blame] | 323 | * USER_490 (USER.490) |
Alexandre Julliard | 3850c1a | 2000-08-06 02:42:46 +0000 | [diff] [blame] | 324 | */ |
| 325 | LONG WINAPI stub_USER_490(void) { FIXME("stub\n"); return 0; } |
| 326 | |
| 327 | /*********************************************************************** |
Patrik Stridvall | 01d5e5b | 2001-07-02 19:59:40 +0000 | [diff] [blame] | 328 | * USER_492 (USER.492) |
Alexandre Julliard | 3850c1a | 2000-08-06 02:42:46 +0000 | [diff] [blame] | 329 | */ |
| 330 | LONG WINAPI stub_USER_492(void) { FIXME("stub\n"); return 0; } |
| 331 | |
| 332 | /*********************************************************************** |
Patrik Stridvall | 01d5e5b | 2001-07-02 19:59:40 +0000 | [diff] [blame] | 333 | * USER_496 (USER.496) |
Alexandre Julliard | 3850c1a | 2000-08-06 02:42:46 +0000 | [diff] [blame] | 334 | */ |
| 335 | LONG WINAPI stub_USER_496(void) { FIXME("stub\n"); return 0; } |
Raphael Junqueira | b9f45e7 | 2004-04-01 02:12:41 +0000 | [diff] [blame] | 336 | |
| 337 | /*********************************************************************** |
| 338 | * User32InitializeImmEntryTable |
| 339 | */ |
| 340 | BOOL WINAPI User32InitializeImmEntryTable(LPVOID ptr) { |
| 341 | FIXME("(%p): stub\n", ptr); |
| 342 | return TRUE; |
| 343 | } |