source: trunk/src/shell32/misc.cpp

Last change on this file was 21916, checked in by dmik, 14 years ago

Merge branch gcc-kmk to trunk.

File size: 10.4 KB
Line 
1/* $Id: misc.cpp,v 1.13 2002-06-09 12:41:21 sandervl Exp $ */
2
3/*
4 * Win32 SHELL32 for OS/2
5 * 1998/06/15 Patrick Haller (haller@zebra.fh-weingarten.de)
6 * Copyright 1997 Marcus Meissner
7 * Copyright 1988 Patrick Haller (adapted for win32os2)
8 * Project Odin Software License can be found in LICENSE.TXT
9 *
10 */
11
12
13/*****************************************************************************
14 * Includes *
15 *****************************************************************************/
16
17#include <odin.h>
18#include <odinwrap.h>
19#include <os2sel.h>
20
21#include <wchar.h>
22#ifndef __GNUC__
23#include <wcstr.h>
24#endif
25
26#define CINTERFACE
27
28//#include <os2win.h>
29#include <shellapi.h>
30#include <winnls.h>
31#include "shell32_main.h"
32#include "undocshell.h"
33#include <misc.h>
34#include <unicode.h>
35//#include <string.h>
36//#include "winbase.h"
37#include <heapstring.h>
38
39/*****************************************************************************
40 * Types & Defines *
41 *****************************************************************************/
42
43ODINDEBUGCHANNEL(SHELL32-MISC)
44
45
46/* exported via shell32_main.h */
47HRESULT (WINAPI* pOleInitialize)(LPVOID reserved);
48void (WINAPI* pOleUninitialize)(void);
49HRESULT (WINAPI* pRegisterDragDrop)(HWND hwnd, IDropTarget* pDropTarget);
50HRESULT (WINAPI* pRevokeDragDrop)(HWND hwnd);
51HRESULT (WINAPI* pDoDragDrop)(LPDATAOBJECT,LPDROPSOURCE,DWORD,DWORD*);
52void (WINAPI* pReleaseStgMedium)(STGMEDIUM* pmedium);
53HRESULT (WINAPI* pOleSetClipboard)(IDataObject* pDataObj);
54HRESULT (WINAPI* pOleGetClipboard)(IDataObject** ppDataObj);
55
56BOOL SHELL_OsIsUnicode(void)
57{
58 static int version = 0;
59
60 if(version == 0) {
61 version = GetVersion();
62 }
63 /* if high-bit of version is 0, we are emulating NT */
64 return !(version & 0x80000000);
65}
66
67/*****************************************************************************
68 * Name : ExtractAssociatedIconExA
69 * Purpose : Return icon for given file (either from file itself or from associated
70 * executable) and patch parameters if needed.
71 * Parameters: ???
72 * Variables :
73 * Result :
74 * Remark : SHELL.150
75 * Status : UNTESTED UNKNOWN STUB
76 *
77 * Author : Christoph Bratschi [Fri, 1999/08/6 20:00]
78 *****************************************************************************/
79
80HICON WIN32API ExtractAssociatedIconExA(HINSTANCE hInst, LPSTR lpIconPath,
81 LPWORD lpiIcon)
82{
83 dprintf(("SHELL32: undoc ExtractAssociatedIconExA\n"));
84
85 return ExtractAssociatedIconA(hInst,lpIconPath,lpiIcon);
86}
87
88/*****************************************************************************
89 * Name : ExtractAssociatedIconW
90 * Purpose : Return icon for given file (either from file itself or from associated
91 * executable) and patch parameters if needed.
92 * Parameters:
93 * Variables :
94 * Result :
95 * Remark : SHELL.36
96 * Status : UNTESTED STUB
97 *
98 * Author : Patrick Haller [Sat, 1998/07/11 11:55]
99 *****************************************************************************/
100
101HICON WIN32API ExtractAssociatedIconW(HINSTANCE hInst, LPWSTR lpIconPath,
102 LPWORD lpiIcon)
103{
104 LPSTR lpIconPathAscii = UnicodeToAsciiString(lpIconPath);
105 HICON hIcon;
106
107 hIcon = ExtractAssociatedIconA(hInst,
108 lpIconPathAscii,
109 lpiIcon);
110
111 FreeAsciiString(lpIconPathAscii);
112
113 return (hIcon);
114}
115
116/*****************************************************************************
117 * Name : ExtractAssociatedIconExW
118 * Purpose : Return icon for given file (either from file itself or from associated
119 * executable) and patch parameters if needed.
120 * Parameters: ???
121 * Variables :
122 * Result :
123 * Remark : SHELL.186
124 * Status : UNTESTED UNKNOWN STUB
125 *
126 * Author : Christoph Bratschi [Fri, 1999/08/6 20:00]
127 *****************************************************************************/
128
129HICON WIN32API ExtractAssociatedIconExW(HINSTANCE hInst, LPWSTR lpIconPath,
130 LPWORD lpiIcon)
131{
132 dprintf(("SHELL32: undoc ExtractAssociatedIconExW\n"));
133
134 return ExtractAssociatedIconW(hInst,lpIconPath,lpiIcon);
135}
136
137
138/*****************************************************************************
139 * Name : OleStrToStrN
140 * Purpose :
141 * Parameters:
142 * Variables :
143 * Result :
144 * Remark : SHELL32.78
145 * Status : UNTESTED UNKNOWN STUB
146 *
147 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
148 *****************************************************************************/
149
150BOOL WIN32API OleStrToStrN(LPSTR lpMulti, INT nMulti, LPCWSTR lpWide,
151 INT nWide)
152{
153 return WideCharToMultiByte (0,
154 0,
155 lpWide,
156 nWide,
157 lpMulti,
158 nMulti,
159 NULL,
160 NULL);
161}
162
163
164/*****************************************************************************
165 * Name : StrToOleStrN
166 * Purpose :
167 * Parameters:
168 * Variables :
169 * Result :
170 * Remark : SHELL32.79
171 * Status : UNTESTED UNKNOWN STUB
172 *
173 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
174 *****************************************************************************/
175
176BOOL WIN32API StrToOleStrN(LPWSTR lpWide, INT nWide, LPCSTR lpMulti,
177 INT nMulti)
178{
179 return MultiByteToWideChar (0,
180 0,
181 lpMulti,
182 nMulti,
183 lpWide,
184 nWide);
185}
186
187
188/*****************************************************************************
189 * Name : SHELL32_654
190 * Purpose :
191 * Parameters:
192 * Variables :
193 * Result :
194 * Remark : SHELL32.654
195 * Status : UNTESTED UNKNOWN STUB
196 *
197 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
198 *****************************************************************************/
199
200HRESULT WIN32API SHELL32_654(DWORD x, DWORD y)
201{
202 dprintf(("SHELL32: SHELL32_654(%08xh,%08xh) not implemented.\n",
203 x,
204 y));
205 return 0;
206}
207
208
209/*****************************************************************************
210 * Name : StrToOleStr
211 * Purpose :
212 * Parameters:
213 * Variables :
214 * Result :
215 * Remark : SHELL32.163
216 * Status : UNTESTED UNKNOWN STUB
217 *
218 * Author : Patrick Haller [Tue, 1998/06/15 03:00]
219 *****************************************************************************/
220
221int WIN32API StrToOleStr(LPWSTR lpWideCharStr, LPCSTR lpMultiByteString)
222{
223 return MultiByteToWideChar(0,
224 0,
225 lpMultiByteString,
226 -1,
227 lpWideCharStr,
228 MAX_PATH);
229}
230
231/*****************************************************************************
232 * Name : InternalExtractIconListA
233 * Purpose :
234 * Parameters: ???
235 * Variables :
236 * Result :
237 * Remark : SHELL32.221 - used by progman.exe
238 * Status : UNTESTED UNKNOWN STUB
239 *
240 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]
241 *****************************************************************************/
242
243DWORD WIN32API InternalExtractIconListA(DWORD dwArg1)
244{
245 dprintf(("SHELL32: undoc InternalExtractIconListA \n"));
246 return 0;
247}
248
249/*****************************************************************************
250 * Name : InternalExtractIconListW
251 * Purpose :
252 * Parameters: ???
253 * Variables :
254 * Result :
255 * Remark : SHELL32.222 - used by progman.exe
256 * Status : UNTESTED UNKNOWN STUB
257 *
258 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]
259 *****************************************************************************/
260
261DWORD WIN32API InternalExtractIconListW(DWORD dwArg1)
262{
263 dprintf(("SHELL32: undoc InternalExtractIconListW\n"));
264 return 0;
265}
266
267/*****************************************************************************
268 * Name : ExtractIconResInfoA
269 * Purpose :
270 * Parameters: ???
271 * Variables :
272 * Result :
273 * Remark : SHELL32.192 - used by progman.exe
274 * Status : UNTESTED UNKNOWN STUB
275 *
276 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]
277 *****************************************************************************/
278
279DWORD WIN32API ExtractIconResInfoA(DWORD dwArg1)
280{
281 dprintf(("SHELL32: undoc ExtractIconResInfoA\n"));
282 return 0;
283}
284
285/*****************************************************************************
286 * Name : ExtractIconResInfoW
287 * Purpose :
288 * Parameters: ???
289 * Variables :
290 * Result :
291 * Remark : SHELL32.193 - used by progman.exe
292 * Status : UNTESTED UNKNOWN STUB
293 *
294 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]
295 *****************************************************************************/
296
297DWORD WIN32API ExtractIconResInfoW( DWORD dwArg1)
298{
299 dprintf(("SHELL32: undoc ExtractIconResInfoW\n"));
300 return 0;
301}
302
303/*****************************************************************************
304 * Name : CheckEscapesA
305 * Purpose :
306 * Parameters: ???
307 * Variables :
308 * Result :
309 * Remark : SHELL32.3 - used by progman.exe
310 * Status : UNTESTED UNKNOWN STUB
311 *
312 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]
313 *****************************************************************************/
314
315void WIN32API CheckEscapesA(DWORD x1, DWORD x2)
316{
317 dprintf(("SHELL32: undoc CheckEscapesA\n"));
318}
319
320/*****************************************************************************
321 * Name : CheckEscapesW
322 * Purpose :
323 * Parameters: ???
324 * Variables :
325 * Result :
326 * Remark : SHELL32.6 - used by progman.exe
327 * Status : UNTESTED UNKNOWN STUB
328 *
329 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]
330 *****************************************************************************/
331
332void WIN32API CheckEscapesW(DWORD x1, DWORD x2)
333{
334 dprintf(("SHELL32: undoc CheckEscapesW\n"));
335}
336
337/*****************************************************************************
338 * Name : DuplicateIcon
339 * Purpose :
340 * Parameters: ???
341 * Variables :
342 * Result :
343 * Remark : SHELL32.138 - used by progman.exe
344 * Status : UNTESTED UNKNOWN STUB
345 *
346 * Author : Christoph Bratschi [Fri, 1999/08/6 19:00]
347 *****************************************************************************/
348
349DWORD WIN32API DuplicateIcon(DWORD x1)
350{
351 dprintf(("SHELL32: undoc DuplicateIcon\n"));
352
353 return 0;
354}
355
356
Note: See TracBrowser for help on using the repository browser.