source: trunk/src/shlwapi/reg_odin.cpp@ 6608

Last change on this file since 6608 was 6608, checked in by phaller, 24 years ago

SHLWAPI update

File size: 16.5 KB
Line 
1/* $Id: reg_odin.cpp,v 1.2 2001-08-30 19:19:57 phaller Exp $ */
2
3/*
4 * Win32 URL-handling APIs for OS/2
5 *
6 * Copyright 1999 Patrick Haller <phaller@gmx.net>
7 *
8 * Project Odin Software License can be found in LICENSE.TXT
9 *
10 * Copyright 1996,1998 Marcus Meissner
11 * Copyright 1996 Jukka Iivonen
12 * Copyright 1997 Uwe Bonnes
13 * Copyright 1999 Jens Wiessner
14 */
15
16
17#include <odin.h>
18#include <odinwrap.h>
19#include <os2sel.h>
20
21#include <string.h>
22#include <ctype.h>
23#include <wctype.h>
24#define HAVE_WCTYPE_H
25
26#include "debugtools.h"
27#include "winnls.h"
28#include "winversion.h"
29#include "winreg.h"
30
31#include <heapstring.h>
32#include <misc.h>
33#include <win\winerror.h>
34#include "shlwapi_odin.h"
35
36
37ODINDEBUGCHANNEL(SHLWAPI-REG)
38
39
40/*****************************************************************************
41 * Name : DWORD SHRegCreateUSKeyA
42 * Purpose :
43 * Parameters:
44 * Variables :
45 * Result :
46 * Remark : SHLWAPI.594 SHLWAPI.SHRegCreateUSKeyA
47 * Status : STUB UNTESTED
48 *
49 * Author : Patrick Haller [Wed, 1999/12/29 23:02]
50 *****************************************************************************/
51
52ODINFUNCTION5(DWORD, SHRegCreateUSKeyA,
53 LPSTR, lpszKeyName,
54 REGSAM, AccessType,
55 HUSKEY, hRelativeUSKey,
56 PHUSKEY, phNewUSKey,
57 DWORD, dwFlags)
58{
59 dprintf(("not implemented\n"));
60 return 0;
61}
62
63
64/*****************************************************************************
65 * Name : DWORD SHRegCreateUSKeyW
66 * Purpose :
67 * Parameters:
68 * Variables :
69 * Result :
70 * Remark : SHLWAPI.595 SHLWAPI.SHRegCreateUSKeyW
71 * Status : STUB UNTESTED
72 *
73 * Author : Patrick Haller [Wed, 1999/12/29 23:02]
74 *****************************************************************************/
75
76ODINFUNCTION5(DWORD, SHRegCreateUSKeyW,
77 LPWSTR, lpszKeyName,
78 REGSAM, AccessType,
79 HUSKEY, hRelativeUSKey,
80 PHUSKEY, phNewUSKey,
81 DWORD, dwFlags)
82{
83 char szBuffer[256];
84
85 // convert unicode to ascii
86 if (0 == WideCharToMultiByte(0,
87 0,
88 lpszKeyName,
89 -1,
90 szBuffer,
91 sizeof(szBuffer),
92 0,
93 0))
94 return GetLastError();
95
96 return SHRegCreateUSKeyA(szBuffer,
97 AccessType,
98 hRelativeUSKey,
99 phNewUSKey,
100 dwFlags);
101}
102
103
104
105/*
106 shlwapi functions that have found their way in because most of
107 shlwapi is unimplemented and doesn't have a home.
108
109 FIXME: move to a more appropriate file( when one exists )
110*/
111
112
113/* gets a user-specific registry value. */
114
115
116/*****************************************************************************
117 * Name : DWORD SHRegGetBoolUSValueA
118 * Purpose : unknown
119 * Parameters: unknown
120 * Variables :
121 * Result : unknown
122 * Remark : SHLWAPI.SHRegGetBoolUSValueA
123 * Status : COMPLETELY IMPLEMENTED ? UNTESTED
124 *
125 * Author : Patrick Haller [Wed, 1999/12/29 23:02]
126 *****************************************************************************/
127
128ODINFUNCTION4(BOOL, SHRegGetBoolUSValueA,
129 LPCSTR, pszSubKey,
130 LPCSTR, pszValue,
131 BOOL, fIgnoreHKCU,
132 BOOL, fDefault)
133{
134 char szBuffer[260];
135 DWORD dwLength = sizeof(szBuffer);
136 LONG rc;
137
138 dprintf(("subkey=%s, value=%s\n",
139 pszSubKey,
140 pszValue));
141
142 rc = SHRegGetUSValueA(pszSubKey,
143 pszValue,
144 &fDefault,
145 szBuffer,
146 &dwLength,
147 fIgnoreHKCU,
148 fDefault ? "YES" : "NO",
149 fDefault ? 4 : 3);
150 if (rc != ERROR_SUCCESS)
151 return rc;
152
153 if (lstrcmpiA("YES",
154 szBuffer) == 0)
155 return 1;
156 else
157 if (lstrcmpiA("TRUE",
158 szBuffer) == 0)
159 return 1;
160 else
161 if (lstrcmpiA("NO",
162 szBuffer) == 0)
163 return 0;
164 else
165 if (lstrcmpiA("FALSE",
166 szBuffer) == 0)
167 return 0;
168
169
170 return ERROR_SUCCESS; /* return success */
171}
172
173
174/*****************************************************************************
175 * Name : DWORD SHRegGetBoolUSValueW
176 * Purpose : unknown
177 * Parameters: unknown
178 * Variables :
179 * Result : unknown
180 * Remark : SHLWAPI.SHRegGetBoolUSValueW
181 * Status : STUB UNTESTED
182 *
183 * Author : Patrick Haller [Wed, 1999/12/29 23:02]
184 *****************************************************************************/
185
186ODINFUNCTION4(BOOL, SHRegGetBoolUSValueW,
187 LPCWSTR, pszSubKey,
188 LPCWSTR, pszValue,
189 BOOL, fIgnoreHKCU,
190 BOOL, fDefault)
191{
192 char szBuffer[264];
193 int iLength;
194
195 dprintf(("(%p),stub!\n", pszSubKey));
196
197 return ERROR_SUCCESS; /* return success */
198}
199
200
201/*****************************************************************************
202 * Name : DWORD SHRegSetUSValueA
203 * Purpose :
204 * Parameters:
205 * Variables :
206 * Result :
207 * Remark : SHLWAPI.SHRegSetUSValueA SHLWAPI.615
208 * Status : STUB UNTESTED
209 *
210 * Author : Patrick Haller [Wed, 1999/12/29 23:02]
211 *****************************************************************************/
212
213ODINFUNCTION6(LONG, SHRegSetUSValueA,
214 LPCSTR, lpszSubKeyName,
215 LPCSTR, lpszValueName,
216 DWORD, dwValueType,
217 LPVOID, lpValue,
218 DWORD, dwValueSize,
219 DWORD, dwFlags)
220{
221 dprintf(("not yet implemented"));
222
223 LONG rc = 0;
224 return rc;
225}
226
227
228
229
230/*****************************************************************************
231 * Name : DWORD SHRegSetUSValueW
232 * Purpose :
233 * Parameters:
234 * Variables :
235 * Result :
236 * Remark : SHLWAPI.SHRegSetUSValueW SHLWAPI.616
237 * Status : STUB UNTESTED
238 *
239 * Author : Patrick Haller [Wed, 1999/12/29 23:02]
240 *****************************************************************************/
241
242ODINFUNCTION6(LONG, SHRegSetUSValueW,
243 LPCWSTR, lpszSubKeyName,
244 LPCWSTR, lpszValueName,
245 DWORD, dwValueType,
246 LPVOID, lpValue,
247 DWORD, dwValueSize,
248 DWORD, dwFlags)
249{
250 dprintf(("not yet implemented"));
251
252 LONG rc = 0;
253 return rc;
254}
255
256
257/*****************************************************************************
258 * Name : LONG SHRegCloseUSKey
259 * Purpose :
260 * Parameters:
261 * Variables :
262 * Result :
263 * Remark :
264 * Status : STUB UNTESTED
265 *
266 * Author : Patrick Haller [2001-08-30]
267 *****************************************************************************/
268
269ODINFUNCTION1(LONG, SHRegCloseUSKey,
270 HUSKEY, hUSKey)
271{
272 dprintf(("not implemented\n"));
273
274 LONG rc = RegCloseKey(hUSKey);
275 return rc;
276}
277
278
279/*****************************************************************************
280 * Name : LONG SHRegDeleteUSValueA
281 * Purpose :
282 * Parameters:
283 * Variables :
284 * Result :
285 * Remark :
286 * Status : STUB UNTESTED
287 *
288 * Author : Patrick Haller [2001-08-30]
289 *****************************************************************************/
290
291ODINFUNCTION3(LONG, SHRegDeleteUSValueA,
292 HUSKEY, hUSKey,
293 LPSTR, lpValue,
294 DWORD, dwFlags)
295{
296 dprintf(("not implemented\n"));
297
298 LONG rc = RegDeleteValueA(hUSKey,
299 lpValue);
300 return rc;
301}
302
303
304/*****************************************************************************
305 * Name : LONG SHRegDeleteUSValueW
306 * Purpose :
307 * Parameters:
308 * Variables :
309 * Result :
310 * Remark :
311 * Status : STUB UNTESTED
312 *
313 * Author : Patrick Haller [2001-08-30]
314 *****************************************************************************/
315
316ODINFUNCTION3(LONG, SHRegDeleteUSValueW,
317 HKEY, hKey,
318 LPWSTR, lpValue,
319 DWORD, dwFlags)
320{
321 dprintf(("not implemented\n"));
322
323 LONG rc = RegDeleteValueW(hKey,
324 lpValue);
325 return rc;
326}
327
328
329/*****************************************************************************
330 * Name : LONG SHDeleteOrphanKeyA
331 * Purpose :
332 * Parameters:
333 * Variables :
334 * Result :
335 * Remark :
336 * Status : STUB UNTESTED
337 *
338 * Author : Patrick Haller [2001-08-30]
339 *****************************************************************************/
340
341ODINFUNCTION2(LONG, SHDeleteOrphanKeyA,
342 HKEY, hKey,
343 LPCSTR, lpszSubkey)
344{
345 dprintf(("not implemented\n"));
346
347 LONG rc = RegDeleteKeyA(hKey,
348 lpszSubkey);
349 return rc;
350}
351
352
353/*****************************************************************************
354 * Name : LONG SHDeleteOrphanKeyW
355 * Purpose :
356 * Parameters:
357 * Variables :
358 * Result :
359 * Remark :
360 * Status : STUB UNTESTED
361 *
362 * Author : Patrick Haller [2001-08-30]
363 *****************************************************************************/
364
365ODINFUNCTION2(LONG, SHDeleteOrphanKeyW,
366 HKEY, hKey,
367 LPWSTR, lpszSubkey)
368{
369 dprintf(("not implemented\n"));
370
371 LONG rc = RegDeleteKeyW(hKey,
372 lpszSubkey);
373 return rc;
374}
375
376
377/*****************************************************************************
378 * Name : LONG SHRegDeleteEmptyUSKeyA
379 * Purpose :
380 * Parameters:
381 * Variables :
382 * Result :
383 * Remark :
384 * Status : STUB UNTESTED
385 *
386 * Author : Patrick Haller [2001-08-30]
387 *****************************************************************************/
388
389ODINFUNCTION3(LONG, SHRegDeleteEmptyUSKeyA,
390 HUSKEY, hUSKey,
391 LPSTR, lpszSubkey,
392 DWORD, dwFlags)
393{
394 dprintf(("not yet implemented"));
395 return 0;
396}
397
398
399/*****************************************************************************
400 * Name : LONG SHRegDeleteEmptyUSKeyW
401 * Purpose :
402 * Parameters:
403 * Variables :
404 * Result :
405 * Remark :
406 * Status : STUB UNTESTED
407 *
408 * Author : Patrick Haller [2001-08-30]
409 *****************************************************************************/
410
411ODINFUNCTION3(LONG, SHRegDeleteEmptyUSKeyW,
412 HUSKEY, hUSKey,
413 LPWSTR, lpszSubkey,
414 DWORD, dwFlags)
415{
416 dprintf(("not yet implemented"));
417 return 0;
418}
419
420
421/*****************************************************************************
422 * Name : LONG SHRegDeleteUSKeyA
423 * Purpose :
424 * Parameters:
425 * Variables :
426 * Result :
427 * Remark :
428 * Status : STUB UNTESTED
429 *
430 * Author : Patrick Haller [2001-08-30]
431 *****************************************************************************/
432
433ODINFUNCTION3(LONG, SHRegDeleteUSKeyA,
434 HUSKEY, hUSKey,
435 LPSTR, lpszSubkey,
436 DWORD, dwFlags)
437{
438 dprintf(("not yet implemented"));
439 return 0;
440}
441
442
443/*****************************************************************************
444 * Name : LONG SHRegDeleteUSKeyW
445 * Purpose :
446 * Parameters:
447 * Variables :
448 * Result :
449 * Remark :
450 * Status : STUB UNTESTED
451 *
452 * Author : Patrick Haller [2001-08-30]
453 *****************************************************************************/
454
455ODINFUNCTION3(LONG, SHRegDeleteUSKeyW,
456 HUSKEY, hUSKey,
457 LPWSTR, lpszSubkey,
458 DWORD, dwFlags)
459{
460 dprintf(("not yet implemented"));
461 return 0;
462}
463
464
465/*****************************************************************************
466 * Name : LONG SHRegEnumUSKeyA
467 * Purpose :
468 * Parameters:
469 * Variables :
470 * Result :
471 * Remark :
472 * Status : STUB UNTESTED
473 *
474 * Author : Patrick Haller [2001-08-30]
475 *****************************************************************************/
476
477ODINFUNCTION5(LONG, SHRegEnumUSKeyA,
478 HUSKEY, hUSKey,
479 DWORD, dwIndex,
480 LPSTR, lpszKeyName,
481 LPDWORD, lpdwKeyNameSize,
482 SHREGENUM_FLAGS, dwFlags)
483{
484 dprintf(("not yet implemented"));
485 return 0;
486}
487
488
489/*****************************************************************************
490 * Name : LONG SHRegEnumUSKeyW
491 * Purpose :
492 * Parameters:
493 * Variables :
494 * Result :
495 * Remark :
496 * Status : STUB UNTESTED
497 *
498 * Author : Patrick Haller [2001-08-30]
499 *****************************************************************************/
500
501ODINFUNCTION5(LONG, SHRegEnumUSKeyW,
502 HUSKEY, hUSKey,
503 DWORD, dwIndex,
504 LPWSTR, lpszKeyName,
505 LPDWORD, lpdwKeyNameSize,
506 SHREGENUM_FLAGS, dwFlags)
507{
508 dprintf(("not yet implemented"));
509 return 0;
510}
511
512
513/*****************************************************************************
514 * Name : LONG SHRegEnumUSValueA
515 * Purpose :
516 * Parameters:
517 * Variables :
518 * Result :
519 * Remark :
520 * Status : STUB UNTESTED
521 *
522 * Author : Patrick Haller [2001-08-30]
523 *****************************************************************************/
524
525ODINFUNCTION8(LONG, SHRegEnumUSValueA,
526 HUSKEY, hUSKey,
527 DWORD, dwIndex,
528 LPSTR, lpszValueName,
529 LPDWORD, lpdwValueNameSize,
530 LPDWORD, lpdwValueType,
531 LPVOID, lpValue,
532 LPDWORD, lpdwValueSize,
533 SHREGENUM_FLAGS, dwFlags)
534{
535 dprintf(("not yet implemented"));
536 return 0;
537}
538
539
540/*****************************************************************************
541 * Name : LONG SHRegEnumUSValueW
542 * Purpose :
543 * Parameters:
544 * Variables :
545 * Result :
546 * Remark :
547 * Status : STUB UNTESTED
548 *
549 * Author : Patrick Haller [2001-08-30]
550 *****************************************************************************/
551
552ODINFUNCTION8(LONG, SHRegEnumUSValueW,
553 HUSKEY, hUSKey,
554 DWORD, dwIndex,
555 LPWSTR, lpszValueName,
556 LPDWORD, lpdwValueNameSize,
557 LPDWORD, lpdwValueType,
558 LPVOID, lpValue,
559 LPDWORD, lpdwValueSize,
560 SHREGENUM_FLAGS, dwFlags)
561{
562 dprintf(("not yet implemented"));
563 return 0;
564}
565
566
567/*****************************************************************************
568 * Name : LONG SHRegQueryInfoUSKeyA
569 * Purpose :
570 * Parameters:
571 * Variables :
572 * Result :
573 * Remark :
574 * Status : STUB UNTESTED
575 *
576 * Author : Patrick Haller [2001-08-30]
577 *****************************************************************************/
578
579ODINFUNCTION5(LONG, SHRegQueryInfoUSKeyA,
580 LPDWORD, lpdwSubKeyNum,
581 LPDWORD, lpdwMaxSubKeyNameSize,
582 LPDWORD, lpdwValueNum,
583 LPDWORD, lpdwMaxValueNameSize,
584 SHREGENUM_FLAGS, dwFlags)
585{
586 dprintf(("not yet implemented"));
587 return 0;
588}
589
590
591/*****************************************************************************
592 * Name : LONG SHRegQueryInfoUSKeyW
593 * Purpose :
594 * Parameters:
595 * Variables :
596 * Result :
597 * Remark :
598 * Status : STUB UNTESTED
599 *
600 * Author : Patrick Haller [2001-08-30]
601 *****************************************************************************/
602
603ODINFUNCTION5(LONG, SHRegQueryInfoUSKeyW,
604 LPDWORD, lpdwSubKeyNum,
605 LPDWORD, lpdwMaxSubKeyNameSize,
606 LPDWORD, lpdwValueNum,
607 LPDWORD, lpdwMaxValueNameSize,
608 SHREGENUM_FLAGS, dwFlags)
609{
610 dprintf(("not yet implemented"));
611 return 0;
612}
613
614
615/*****************************************************************************
616 * Name : LONG SHRegWriteUSValueA
617 * Purpose :
618 * Parameters:
619 * Variables :
620 * Result :
621 * Remark :
622 * Status : STUB UNTESTED
623 *
624 * Author : Patrick Haller [2001-08-30]
625 *****************************************************************************/
626
627ODINFUNCTION6(LONG, SHRegWriteUSValueA,
628 HUSKEY, hUSKey,
629 LPCSTR, lpszValueName,
630 DWORD, dwValueType,
631 LPVOID, lpValue,
632 DWORD, dwValueSize,
633 DWORD, dwFlags)
634{
635 dprintf(("not yet implemented"));
636 return 0;
637}
638
639
640/*****************************************************************************
641 * Name : LONG SHRegWriteUSValueW
642 * Purpose :
643 * Parameters:
644 * Variables :
645 * Result :
646 * Remark :
647 * Status : STUB UNTESTED
648 *
649 * Author : Patrick Haller [2001-08-30]
650 *****************************************************************************/
651
652ODINFUNCTION6(LONG, SHRegWriteUSValueW,
653 HUSKEY, hUSKey,
654 LPCWSTR, lpszValueName,
655 DWORD, dwValueType,
656 LPVOID, lpValue,
657 DWORD, dwValueSize,
658 DWORD, dwFlags)
659{
660 dprintf(("not yet implemented"));
661 return 0;
662}
Note: See TracBrowser for help on using the repository browser.