Append .DRV to name only if no extension present.
[wine/hacks.git] / dlls / user / misc.c
blob0fdb4fae49748f70b39e8b33f4f227c490bd7783
1 /*
2 * Misc USER functions
4 * Copyright 1995 Thomas Sandford
5 * Copyright 1997 Marcus Meissner
6 */
8 #include "windef.h"
9 #include "winbase.h"
10 #include "wingdi.h"
11 #include "winuser.h"
12 #include "winerror.h"
14 #include "debugtools.h"
16 DEFAULT_DEBUG_CHANNEL(win);
18 /**********************************************************************
19 * SetLastErrorEx [USER32.485] Sets the last-error code.
21 * RETURNS
22 * None.
24 void WINAPI SetLastErrorEx(
25 DWORD error, /* [in] Per-thread error code */
26 DWORD type) /* [in] Error type */
28 TRACE("(0x%08lx, 0x%08lx)\n", error,type);
29 switch(type) {
30 case 0:
31 break;
32 case SLE_ERROR:
33 case SLE_MINORERROR:
34 case SLE_WARNING:
35 /* Fall through for now */
36 default:
37 FIXME("(error=%08lx, type=%08lx): Unhandled type\n", error,type);
38 break;
40 SetLastError( error );
44 /******************************************************************************
45 * GetProcessWindowStation [USER32.280] Returns handle of window station
47 * NOTES
48 * Docs say the return value is HWINSTA
50 * RETURNS
51 * Success: Handle to window station associated with calling process
52 * Failure: NULL
54 DWORD WINAPI GetProcessWindowStation(void)
56 FIXME("(void): stub\n");
57 return 1;
61 /******************************************************************************
62 * GetThreadDesktop [USER32.295] Returns handle to desktop
64 * NOTES
65 * Docs say the return value is HDESK
67 * PARAMS
68 * dwThreadId [I] Thread identifier
70 * RETURNS
71 * Success: Handle to desktop associated with specified thread
72 * Failure: NULL
74 DWORD WINAPI GetThreadDesktop( DWORD dwThreadId )
76 FIXME("(%lx): stub\n",dwThreadId);
77 return 1;
81 /******************************************************************************
82 * SetDebugErrorLevel [USER32.475]
83 * Sets the minimum error level for generating debugging events
85 * PARAMS
86 * dwLevel [I] Debugging error level
88 VOID WINAPI SetDebugErrorLevel( DWORD dwLevel )
90 FIXME("(%ld): stub\n", dwLevel);
94 /******************************************************************************
95 * GetProcessDefaultLayout [USER32.802]
97 * Gets the default layout for parentless windows.
98 * Right now, just returns 0 (left-to-right).
100 * RETURNS
101 * Success: Nonzero
102 * Failure: Zero
104 * BUGS
105 * No RTL
107 BOOL WINAPI GetProcessDefaultLayout( DWORD *pdwDefaultLayout )
109 if ( !pdwDefaultLayout ) {
110 SetLastError( ERROR_INVALID_PARAMETER );
111 return FALSE;
113 FIXME( "( %p ): No BiDi\n", pdwDefaultLayout );
114 *pdwDefaultLayout = 0;
115 return TRUE;
119 /******************************************************************************
120 * SetProcessDefaultLayout [USER32.803]
122 * Sets the default layout for parentless windows.
123 * Right now, only accepts 0 (left-to-right).
125 * RETURNS
126 * Success: Nonzero
127 * Failure: Zero
129 * BUGS
130 * No RTL
132 BOOL WINAPI SetProcessDefaultLayout( DWORD dwDefaultLayout )
134 if ( dwDefaultLayout == 0 )
135 return TRUE;
136 FIXME( "( %08lx ): No BiDi\n", dwDefaultLayout );
137 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
138 return FALSE;
142 /******************************************************************************
143 * OpenDesktopA [USER32.408]
145 * NOTES
146 * Return type should be HDESK
148 * Not supported on Win9x - returns NULL and calls SetLastError.
150 HANDLE WINAPI OpenDesktopA( LPCSTR lpszDesktop, DWORD dwFlags,
151 BOOL fInherit, DWORD dwDesiredAccess )
153 FIXME("(%s,%lx,%i,%lx): stub\n",debugstr_a(lpszDesktop),dwFlags,
154 fInherit,dwDesiredAccess);
156 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
157 return 0;
161 /******************************************************************************
162 * SetUserObjectInformationA (USER32.512)
164 BOOL WINAPI SetUserObjectInformationA( HANDLE hObj, INT nIndex,
165 LPVOID pvInfo, DWORD nLength )
167 FIXME("(%x,%d,%p,%lx): stub\n",hObj,nIndex,pvInfo,nLength);
168 return TRUE;
171 /******************************************************************************
172 * SetThreadDesktop (USER32.510)
174 BOOL WINAPI SetThreadDesktop( HANDLE hDesktop )
176 FIXME("(%x): stub\n",hDesktop);
177 return TRUE;
181 /***********************************************************************
182 * RegisterShellHookWindow [USER32.459]
184 HRESULT WINAPI RegisterShellHookWindow ( DWORD u )
186 FIXME("0x%08lx stub\n",u);
187 return 0;
191 /***********************************************************************
192 * DeregisterShellHookWindow [USER32.132]
194 HRESULT WINAPI DeregisterShellHookWindow ( DWORD u )
196 FIXME("0x%08lx stub\n",u);
197 return 0;
202 /***********************************************************************
203 * RegisterTaskList [USER23.436]
205 DWORD WINAPI RegisterTaskList (DWORD x)
207 FIXME("0x%08lx\n",x);
208 return TRUE;
211 /***********************************************************************
212 * stub_USER_489
214 LONG WINAPI stub_USER_489(void) { FIXME("stub\n"); return 0; }
216 /***********************************************************************
217 * stub_USER_490
219 LONG WINAPI stub_USER_490(void) { FIXME("stub\n"); return 0; }
221 /***********************************************************************
222 * stub_USER_492
224 LONG WINAPI stub_USER_492(void) { FIXME("stub\n"); return 0; }
226 /***********************************************************************
227 * stub_USER_496
229 LONG WINAPI stub_USER_496(void) { FIXME("stub\n"); return 0; }