Moved a bunch of functions out of libwine/kernel/gdi into USER.
[wine] / dlls / user / misc.c
1 /*
2  * Misc USER functions
3  *
4  * Copyright 1995 Thomas Sandford
5  * Copyright 1997 Marcus Meissner
6  */
7
8 #include "windef.h"
9 #include "winbase.h"
10 #include "wingdi.h"
11 #include "winuser.h"
12 #include "winerror.h"
13
14 #include "debugtools.h"
15
16 DEFAULT_DEBUG_CHANNEL(win);
17
18 /**********************************************************************
19  * SetLastErrorEx [USER32.485]  Sets the last-error code.
20  *
21  * RETURNS
22  *    None.
23  */
24 void WINAPI SetLastErrorEx(
25     DWORD error, /* [in] Per-thread error code */
26     DWORD type)  /* [in] Error type */
27 {
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;
39     }
40     SetLastError( error );
41 }
42
43
44 /******************************************************************************
45  * GetProcessWindowStation [USER32.280]  Returns handle of window station
46  *
47  * NOTES
48  *    Docs say the return value is HWINSTA
49  *
50  * RETURNS
51  *    Success: Handle to window station associated with calling process
52  *    Failure: NULL
53  */
54 DWORD WINAPI GetProcessWindowStation(void)
55 {
56     FIXME("(void): stub\n");
57     return 1;
58 }
59
60
61 /******************************************************************************
62  * GetThreadDesktop [USER32.295]  Returns handle to desktop
63  *
64  * NOTES
65  *    Docs say the return value is HDESK
66  *
67  * PARAMS
68  *    dwThreadId [I] Thread identifier
69  *
70  * RETURNS
71  *    Success: Handle to desktop associated with specified thread
72  *    Failure: NULL
73  */
74 DWORD WINAPI GetThreadDesktop( DWORD dwThreadId )
75 {
76     FIXME("(%lx): stub\n",dwThreadId);
77     return 1;
78 }
79
80
81 /******************************************************************************
82  * SetDebugErrorLevel [USER32.475]
83  * Sets the minimum error level for generating debugging events
84  *
85  * PARAMS
86  *    dwLevel [I] Debugging error level
87  */
88 VOID WINAPI SetDebugErrorLevel( DWORD dwLevel )
89 {
90     FIXME("(%ld): stub\n", dwLevel);
91 }
92
93
94 /******************************************************************************
95  *                    GetProcessDefaultLayout [USER32.802]
96  *
97  * Gets the default layout for parentless windows.
98  * Right now, just returns 0 (left-to-right).
99  *
100  * RETURNS
101  *    Success: Nonzero
102  *    Failure: Zero
103  *
104  * BUGS
105  *    No RTL
106  */
107 BOOL WINAPI GetProcessDefaultLayout( DWORD *pdwDefaultLayout )
108 {
109     if ( !pdwDefaultLayout ) {
110         SetLastError( ERROR_INVALID_PARAMETER );
111         return FALSE;
112      }
113     FIXME( "( %p ): No BiDi\n", pdwDefaultLayout );
114     *pdwDefaultLayout = 0;
115     return TRUE;
116 }
117
118
119 /******************************************************************************
120  *                    SetProcessDefaultLayout [USER32.803]
121  *
122  * Sets the default layout for parentless windows.
123  * Right now, only accepts 0 (left-to-right).
124  *
125  * RETURNS
126  *    Success: Nonzero
127  *    Failure: Zero
128  *
129  * BUGS
130  *    No RTL
131  */
132 BOOL WINAPI SetProcessDefaultLayout( DWORD dwDefaultLayout )
133 {
134     if ( dwDefaultLayout == 0 )
135         return TRUE;
136     FIXME( "( %08lx ): No BiDi\n", dwDefaultLayout );
137     SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
138     return FALSE;
139 }
140
141
142 /******************************************************************************
143  * OpenDesktopA [USER32.408]
144  *
145  * NOTES
146  *    Return type should be HDESK
147  *
148  *    Not supported on Win9x - returns NULL and calls SetLastError.
149  */
150 HANDLE WINAPI OpenDesktopA( LPCSTR lpszDesktop, DWORD dwFlags, 
151                                 BOOL fInherit, DWORD dwDesiredAccess )
152 {
153     FIXME("(%s,%lx,%i,%lx): stub\n",debugstr_a(lpszDesktop),dwFlags,
154           fInherit,dwDesiredAccess);
155
156     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
157     return 0;
158 }
159
160
161 /******************************************************************************
162  *              SetUserObjectInformationA   (USER32.512)
163  */
164 BOOL WINAPI SetUserObjectInformationA( HANDLE hObj, INT nIndex, 
165                                        LPVOID pvInfo, DWORD nLength )
166 {
167     FIXME("(%x,%d,%p,%lx): stub\n",hObj,nIndex,pvInfo,nLength);
168     return TRUE;
169 }
170
171 /******************************************************************************
172  *              SetThreadDesktop   (USER32.510)
173  */
174 BOOL WINAPI SetThreadDesktop( HANDLE hDesktop )
175 {
176     FIXME("(%x): stub\n",hDesktop);
177     return TRUE;
178 }
179
180
181 /***********************************************************************
182  *           RegisterShellHookWindow                    [USER32.459]
183  */
184 HRESULT WINAPI RegisterShellHookWindow ( DWORD u )
185 {
186     FIXME("0x%08lx stub\n",u);
187     return 0;
188 }
189
190
191 /***********************************************************************
192  *           DeregisterShellHookWindow                  [USER32.132]
193  */
194 HRESULT WINAPI DeregisterShellHookWindow ( DWORD u )
195 {
196     FIXME("0x%08lx stub\n",u);
197     return 0;
198         
199 }
200
201
202 /***********************************************************************
203  *           RegisterTaskList                           [USER23.436]
204  */
205 DWORD WINAPI RegisterTaskList (DWORD x)
206 {
207     FIXME("0x%08lx\n",x);
208     return TRUE;
209 }