source: trunk/src/shell32/shellreg.c@ 6650

Last change on this file since 6650 was 6650, checked in by bird, 24 years ago

Added $Id:$ keyword.

File size: 5.8 KB
Line 
1/* $Id: shellreg.c,v 1.3 2001-09-05 13:46:58 bird Exp $ */
2/*
3 Shell Registry Access
4*/
5#include <string.h>
6#include <stdio.h>
7#include "winerror.h"
8#include "winreg.h"
9#include "debugtools.h"
10#include "winnls.h"
11
12#include "shellapi.h"
13#include "shlobj.h"
14#include "shell32_main.h"
15#include "wine/undocshell.h"
16
17DEFAULT_DEBUG_CHANNEL(shell);
18
19/*************************************************************************
20 * SHRegOpenKeyA [SHELL32.506]
21 *
22 */
23HRESULT WINAPI SHRegOpenKeyA(
24 HKEY hKey,
25 LPSTR lpSubKey,
26 LPHKEY phkResult)
27{
28 TRACE("(0x%08x, %s, %p)\n", hKey, debugstr_a(lpSubKey), phkResult);
29 return RegOpenKeyA(hKey, lpSubKey, phkResult);
30}
31
32/*************************************************************************
33 * SHRegOpenKeyW [NT4.0:SHELL32.507]
34 *
35 */
36HRESULT WINAPI SHRegOpenKeyW (
37 HKEY hkey,
38 LPCWSTR lpszSubKey,
39 LPHKEY retkey)
40{
41 WARN("0x%04x %s %p\n",hkey,debugstr_w(lpszSubKey),retkey);
42 return RegOpenKeyW( hkey, lpszSubKey, retkey );
43}
44
45/*************************************************************************
46 * SHRegQueryValueExA [SHELL32.509]
47 *
48 */
49HRESULT WINAPI SHRegQueryValueExA(
50 HKEY hkey,
51 LPSTR lpValueName,
52 LPDWORD lpReserved,
53 LPDWORD lpType,
54 LPBYTE lpData,
55 LPDWORD lpcbData)
56{
57 TRACE("0x%04x %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
58 return RegQueryValueExA (hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
59}
60
61/*************************************************************************
62 * SHRegQueryValueW [NT4.0:SHELL32.510]
63 *
64 */
65HRESULT WINAPI SHRegQueryValueW(
66 HKEY hkey,
67 LPWSTR lpszSubKey,
68 LPWSTR lpszData,
69 LPDWORD lpcbData )
70{
71 WARN("0x%04x %s %p %p semi-stub\n",
72 hkey, debugstr_w(lpszSubKey), lpszData, lpcbData);
73 return RegQueryValueW( hkey, lpszSubKey, lpszData, lpcbData );
74}
75
76/*************************************************************************
77 * SHRegQueryValueExW [NT4.0:SHELL32.511]
78 *
79 * FIXME
80 * if the datatype REG_EXPAND_SZ then expand the string and change
81 * *pdwType to REG_SZ.
82 */
83HRESULT WINAPI SHRegQueryValueExW (
84 HKEY hkey,
85 LPWSTR pszValue,
86 LPDWORD pdwReserved,
87 LPDWORD pdwType,
88 LPVOID pvData,
89 LPDWORD pcbData)
90{
91 DWORD ret;
92 WARN("0x%04x %s %p %p %p %p semi-stub\n",
93 hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
94 ret = RegQueryValueExW ( hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
95 return ret;
96}
97
98/*************************************************************************
99 * SHRegDeleteKeyA [SHELL32]
100 */
101HRESULT WINAPI SHRegDeleteKeyA(
102 HKEY hkey,
103 LPCSTR pszSubKey)
104{
105 FIXME("hkey=0x%08x, %s\n", hkey, debugstr_a(pszSubKey));
106#ifdef __WIN32OS2__
107 return RegDeleteKeyA(hkey,pszSubKey);
108#else
109 return 0;
110#endif
111}
112
113/*************************************************************************
114 * SHRegDeleteKeyW [SHELL32]
115 */
116HRESULT WINAPI SHRegDeleteKeyW(
117 HKEY hkey,
118 LPCWSTR pszSubKey)
119{
120 FIXME("hkey=0x%08x, %s\n", hkey, debugstr_w(pszSubKey));
121#ifdef __WIN32OS2__
122 return RegDeleteKeyW(hkey,pszSubKey);
123#else
124 return 0;
125#endif
126}
127
128/*************************************************************************
129 * SHRegCloseKey [NT4.0:SHELL32.505]
130 *
131 */
132HRESULT WINAPI SHRegCloseKey (HKEY hkey)
133{
134 TRACE("0x%04x\n",hkey);
135 return RegCloseKey( hkey );
136}
137
138#ifndef __WIN32OS2__
139
140/* 16-bit functions */
141
142/* 0 and 1 are valid rootkeys in win16 shell.dll and are used by
143 * some programs. Do not remove those cases. -MM
144 */
145static inline void fix_win16_hkey( HKEY *hkey )
146{
147 if (*hkey == 0 || *hkey == 1) *hkey = HKEY_CLASSES_ROOT;
148}
149
150/******************************************************************************
151 * RegOpenKey16 [SHELL.1]
152 */
153DWORD WINAPI RegOpenKey16( HKEY hkey, LPCSTR name, LPHKEY retkey )
154{
155 fix_win16_hkey( &hkey );
156 return RegOpenKeyA( hkey, name, retkey );
157}
158
159/******************************************************************************
160 * RegCreateKey16 [SHELL.2]
161 */
162DWORD WINAPI RegCreateKey16( HKEY hkey, LPCSTR name, LPHKEY retkey )
163{
164 fix_win16_hkey( &hkey );
165 return RegCreateKeyA( hkey, name, retkey );
166}
167
168/******************************************************************************
169 * RegCloseKey16 [SHELL.3]
170 */
171DWORD WINAPI RegCloseKey16( HKEY hkey )
172{
173 fix_win16_hkey( &hkey );
174 return RegCloseKey( hkey );
175}
176
177/******************************************************************************
178 * RegDeleteKey16 [SHELL.4]
179 */
180DWORD WINAPI RegDeleteKey16( HKEY hkey, LPCSTR name )
181{
182 fix_win16_hkey( &hkey );
183 return RegDeleteKeyA( hkey, name );
184}
185
186/******************************************************************************
187 * RegSetValue16 [SHELL.5]
188 */
189DWORD WINAPI RegSetValue16( HKEY hkey, LPCSTR name, DWORD type, LPCSTR data, DWORD count )
190{
191 fix_win16_hkey( &hkey );
192 return RegSetValueA( hkey, name, type, data, count );
193}
194
195/******************************************************************************
196 * RegQueryValue16 [SHELL.6]
197 *
198 * NOTES
199 * Is this HACK still applicable?
200 *
201 * HACK
202 * The 16bit RegQueryValue doesn't handle selectorblocks anyway, so we just
203 * mask out the high 16 bit. This (not so much incidently) hopefully fixes
204 * Aldus FH4)
205 */
206DWORD WINAPI RegQueryValue16( HKEY hkey, LPCSTR name, LPSTR data, LPDWORD count )
207{
208 fix_win16_hkey( &hkey );
209 if (count) *count &= 0xffff;
210 return RegQueryValueA( hkey, name, data, count );
211}
212
213/******************************************************************************
214 * RegEnumKey16 [SHELL.7]
215 */
216DWORD WINAPI RegEnumKey16( HKEY hkey, DWORD index, LPSTR name, DWORD name_len )
217{
218 fix_win16_hkey( &hkey );
219 return RegEnumKeyA( hkey, index, name, name_len );
220}
221#endif //__WIN32OS2__
Note: See TracBrowser for help on using the repository browser.