2 * SHLWAPI ordinal functions
4 * Copyright 1997 Marcus Meissner
11 #include "wine/undocshell.h"
12 #include "wine/unicode.h"
13 #include "debugtools.h"
15 DEFAULT_DEBUG_CHANNEL(shell);
17 extern HINSTANCE shlwapi_hInstance;
20 NOTES: The most functions exported by ordinal seem to be superflous.
21 The reason for these functions to be there is to provide a wraper
22 for unicode functions to providing these functions on systems without
23 unicode functions eg. win95/win98. Since we have such functions we just
27 /*************************************************************************
28 * SHLWAPI_1 [SHLWAPI.1]
30 DWORD WINAPI SHLWAPI_1 (
34 FIXME("(%p %s %p %s)\n",lpStr, debugstr_a(lpStr),x, debugstr_a(x));
38 /*************************************************************************
39 * SHLWAPI_16 [SHLWAPI.16]
41 HRESULT WINAPI SHLWAPI_16 (
47 FIXME("(%p %p %p %p)stub\n",w,x,y,z);
51 /*************************************************************************
52 * SHLWAPI_23 [SHLWAPI.23]
55 * converts a guid to a string
58 DWORD WINAPI SHLWAPI_23 (
59 REFGUID guid, /* [in] clsid */
60 LPSTR str, /* [out] buffer */
61 INT cmax) /* [in] size of buffer */
65 sprintf( xguid, "{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
66 guid->Data1, guid->Data2, guid->Data3,
67 guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
68 guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] );
69 TRACE("(%s %p 0x%08x)stub\n", xguid, str, cmax);
70 if (strlen(xguid)>=cmax) return 0;
72 return strlen(xguid) + 1;
75 /*************************************************************************
76 * SHLWAPI_24 [SHLWAPI.24]
79 * converts a guid to a string
82 DWORD WINAPI SHLWAPI_24 (
83 REFGUID guid, /* [in] clsid */
84 LPWSTR str, /* [out] buffer */
85 INT cmax) /* [in] size of buffer */
89 sprintf( xguid, "{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
90 guid->Data1, guid->Data2, guid->Data3,
91 guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
92 guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] );
93 return MultiByteToWideChar( CP_ACP, 0, xguid, -1, str, cmax );
96 /*************************************************************************
97 * SHLWAPI_156 [SHLWAPI.156]
99 * FIXME: function guessed
101 DWORD WINAPI SHLWAPI_156 (
102 LPWSTR str1, /* "shell32.dll" */
103 LPWSTR str2) /* "shell32.dll" */
105 FIXME("(%s %s)stub\n",debugstr_w(str1),debugstr_w(str2));
106 return lstrcmpW(str1,str2);
109 /*************************************************************************
110 * SHLWAPI_169 [SHLWAPI.169]
112 DWORD WINAPI SHLWAPI_169 (IUnknown * lpUnknown)
114 TRACE("(%p)\n",lpUnknown);
116 if(!lpUnknown || !*((LPDWORD)lpUnknown)) return 0;
117 return IUnknown_Release(lpUnknown);
122 /*************************************************************************
123 * SHLWAPI_193 [SHLWAPI.193]
125 DWORD WINAPI SHLWAPI_193 ()
133 ret = GetDeviceCaps(hdc, BITSPIXEL) * GetDeviceCaps(hdc, PLANES);
138 /*************************************************************************
139 * SHLWAPI_215 [SHLWAPI.215]
144 LPWSTR WINAPI SHLWAPI_215 (
149 WARN("(%p %p %u)\n",lpStrSrc,lpwStrDest,len);
150 return strncpyW(lpwStrDest, lpStrSrc, len);
153 /*************************************************************************
154 * SHLWAPI_219 [SHLWAPI.219]
157 * error codes: E_POINTER, E_NOINTERFACE
159 HRESULT WINAPI SHLWAPI_219 (
160 LPVOID w, /* returned by LocalAlloc, 0x450 bytes, iface */
163 LPWSTR z) /* OUT: path */
165 FIXME("(%p %p %p %p)stub\n",w,x,y,z);
169 /*************************************************************************
170 * SHLWAPI_222 [SHLWAPI.222]
173 * securityattributes missing
175 HANDLE WINAPI SHLWAPI_222 (LPCLSID guid)
179 sprintf( lpstrName, "shell.{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
180 guid->Data1, guid->Data2, guid->Data3,
181 guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
182 guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] );
183 FIXME("(%s) stub\n", lpstrName);
184 return CreateSemaphoreA(NULL,0, 0x7fffffff, lpstrName);
187 /*************************************************************************
188 * SHLWAPI_223 [SHLWAPI.223]
191 * get the count of the semaphore
193 DWORD WINAPI SHLWAPI_223 (HANDLE handle)
197 FIXME("(0x%08x) stub\n",handle);
199 ReleaseSemaphore( handle, 1, &oldCount); /* +1 */
200 WaitForSingleObject( handle, 0 ); /* -1 */
204 /*************************************************************************
205 * SHLWAPI_237 [SHLWAPI.237]
208 * checks if a class is registered, if not it registers it
210 DWORD WINAPI SHLWAPI_237 (WNDCLASSW * lpWndClass)
214 TRACE("(0x%08x %s)\n",lpWndClass->hInstance, debugstr_w(lpWndClass->lpszClassName));
216 if (!GetClassInfoW(lpWndClass->hInstance, lpWndClass->lpszClassName, &WndClass))
218 return RegisterClassW(lpWndClass);
223 /*************************************************************************
224 * SHLWAPI_241 [SHLWAPI.241]
227 DWORD WINAPI SHLWAPI_241 ()
233 /*************************************************************************
234 * SHLWAPI_266 [SHLWAPI.266]
236 DWORD WINAPI SHLWAPI_266 (
242 FIXME("(%p %p %p %p)stub\n",w,x,y,z);
246 /*************************************************************************
247 * SHLWAPI_267 [SHLWAPI.267]
249 HRESULT WINAPI SHLWAPI_267 (
250 LPVOID w, /* same as 1th parameter of SHLWAPI_219 */
251 LPVOID x, /* same as 2nd parameter of SHLWAPI_219 */
255 FIXME("(%p %p %p %p)stub\n",w,x,y,z);
256 *((LPDWORD)z) = 0xabba1200;
260 /*************************************************************************
261 * SHLWAPI_268 [SHLWAPI.268]
263 DWORD WINAPI SHLWAPI_268 (
267 FIXME("(%p %p)\n",w,x);
268 return 0xabba1251; /* 0 = failure */
271 /*************************************************************************
272 * SHLWAPI_276 [SHLWAPI.276]
275 DWORD WINAPI SHLWAPI_276 ()
281 /*************************************************************************
282 * SHLWAPI_278 [SHLWAPI.278]
285 DWORD WINAPI SHLWAPI_278 (
296 char * clsname = "WorkerA";
298 FIXME("(0x%08lx 0x%08x 0x%08lx 0x%08lx 0x%08x 0x%08lx)stub\n",
299 wndProc,hWndParent,dwExStyle,dwStyle,hMenu,z);
301 hCursor = LoadCursorA(0x00000000,IDC_ARROWA);
303 if(!GetClassInfoA(shlwapi_hInstance, clsname, &wndclass))
305 RtlZeroMemory(&wndclass, sizeof(WNDCLASSA));
306 wndclass.lpfnWndProc = DefWindowProcW;
307 wndclass.cbWndExtra = 4;
308 wndclass.hInstance = shlwapi_hInstance;
309 wndclass.hCursor = hCursor;
310 wndclass.hbrBackground = COLOR_BTNSHADOW;
311 wndclass.lpszMenuName = NULL;
312 wndclass.lpszClassName = clsname;
313 RegisterClassA (&wndclass);
315 hwnd = CreateWindowExA(dwExStyle, clsname, 0,dwStyle,0,0,0,0,hWndParent,
316 hMenu,shlwapi_hInstance,0);
317 SetWindowLongA(hwnd, 0, z);
318 SetWindowLongA(hwnd, GWL_WNDPROC, wndProc);
322 /*************************************************************************
323 * SHLWAPI_342 [SHLWAPI.342]
326 DWORD WINAPI SHLWAPI_342 (
332 FIXME("(%p %p %p %p)stub\n",w,x,y,z);
336 /*************************************************************************
337 * SHLWAPI_346 [SHLWAPI.346]
339 DWORD WINAPI SHLWAPI_346 (
344 FIXME("(%s %p 0x%08x)stub\n",debugstr_w(src),dest,len);
345 lstrcpynW(dest, src, len);
346 return lstrlenW(dest)+1;
350 /*************************************************************************
351 * SHLWAPI_377 [SHLWAPI.377]
353 DWORD WINAPI SHLWAPI_377 (LPVOID x, LPVOID y, LPVOID z)
355 FIXME("(%p %p %p)stub\n", x,y,z);
359 /*************************************************************************
360 * SHLWAPI_378 [SHLWAPI.378]
362 DWORD WINAPI SHLWAPI_378 (
364 LPVOID y, /* 0x50000000 */
367 FIXME("(%s %p %p)stub\n", x,y,z);
368 return LoadLibraryA(x);
371 /*************************************************************************
372 * SHLWAPI_431 [SHLWAPI.431]
374 DWORD WINAPI SHLWAPI_431 (DWORD x)
376 FIXME("(0x%08lx)stub\n", x);
380 /*************************************************************************
381 * SHLWAPI_437 [SHLWAPI.437]
384 * has to do something with switching the api between ascii and unicode
385 * observed values: 0 and 5
388 * HKLM\System\CurrentControlSet\Control\ProductOptions
391 DWORD WINAPI SHLWAPI_437 (DWORD x)
393 FIXME("(0x%08lx)stub\n", x);
397 /*************************************************************************
398 * UrlEscapeA [SHLWAPI]
400 HRESULT WINAPI UrlEscapeA(
406 FIXME("(%s %p %p 0x%08lx)stub\n",debugstr_a(pszUrl),
407 pszEscaped, pcchEscaped, dwFlags);
411 /*************************************************************************
412 * UrlEscapeW [SHLWAPI]
414 HRESULT WINAPI UrlEscapeW(
420 FIXME("(%s %p %p 0x%08lx)stub\n",debugstr_w(pszUrl),
421 pszEscaped, pcchEscaped, dwFlags);
426 /*************************************************************************
427 * SHCreateShellPalette [SHLWAPI.@]
429 HPALETTE WINAPI SHCreateShellPalette(HDC hdc)
432 return CreateHalftonePalette(hdc);
435 /*************************************************************************
436 * SHIsLowMemoryMachine [SHLWAPI.@]
438 DWORD WINAPI SHIsLowMemoryMachine (DWORD x)
440 FIXME("0x%08lx\n", x);