netstat: Initial implementation.
[wine] / dlls / shell32 / shellreg.c
1 /*
2  * Shell Registry Access
3  *
4  * Copyright 2000 Juergen Schmied
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #include "config.h"
22
23 #include <string.h>
24 #include <stdarg.h>
25 #include <stdio.h>
26
27 #include "windef.h"
28 #include "winbase.h"
29 #include "shellapi.h"
30 #include "wingdi.h"
31 #include "winuser.h"
32 #include "shlobj.h"
33 #include "winreg.h"
34
35 #include "undocshell.h"
36
37 #include "wine/debug.h"
38
39 WINE_DEFAULT_DEBUG_CHANNEL(shell);
40
41 /*************************************************************************
42  * SHRegOpenKeyA                                [SHELL32.506]
43  *
44  */
45 HRESULT WINAPI SHRegOpenKeyA(
46         HKEY hKey,
47         LPSTR lpSubKey,
48         PHKEY phkResult)
49 {
50         TRACE("(%p, %s, %p)\n", hKey, debugstr_a(lpSubKey), phkResult);
51         return RegOpenKeyA(hKey, lpSubKey, phkResult);
52 }
53
54 /*************************************************************************
55  * SHRegOpenKeyW                                [SHELL32.507] NT 4.0
56  *
57  */
58 HRESULT WINAPI SHRegOpenKeyW (
59         HKEY hkey,
60         LPCWSTR lpszSubKey,
61         PHKEY retkey)
62 {
63         WARN("%p %s %p\n",hkey,debugstr_w(lpszSubKey),retkey);
64         return RegOpenKeyW( hkey, lpszSubKey, retkey );
65 }
66
67 /*************************************************************************
68  * SHRegQueryValueA   [SHELL32.508]
69  *
70  */
71 HRESULT WINAPI SHRegQueryValueA(HKEY hkey, LPSTR lpSubKey, LPSTR lpValue, LPDWORD lpcbValue)
72 {
73         TRACE("(%p %s %p %p)\n", hkey, debugstr_a(lpSubKey), lpValue, lpcbValue);
74         return RegQueryValueA(hkey, lpSubKey, lpValue, (LONG*)lpcbValue);
75 }
76
77 /*************************************************************************
78  * SHRegQueryValueExA   [SHELL32.509]
79  *
80  */
81 HRESULT WINAPI SHRegQueryValueExA(
82         HKEY hkey,
83         LPSTR lpValueName,
84         LPDWORD lpReserved,
85         LPDWORD lpType,
86         LPBYTE lpData,
87         LPDWORD lpcbData)
88 {
89         TRACE("%p %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
90         return RegQueryValueExA (hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
91 }
92
93 /*************************************************************************
94  * SHRegQueryValueW                             [SHELL32.510] NT4.0
95  *
96  */
97 HRESULT WINAPI SHRegQueryValueW(
98         HKEY hkey,
99         LPWSTR lpszSubKey,
100         LPWSTR lpszData,
101         LPDWORD lpcbData )
102 {
103         WARN("%p %s %p %p semi-stub\n",
104                 hkey, debugstr_w(lpszSubKey), lpszData, lpcbData);
105         return RegQueryValueW( hkey, lpszSubKey, lpszData, (LONG*)lpcbData );
106 }
107
108 /*************************************************************************
109  * SHRegQueryValueExW   [SHELL32.511] NT4.0
110  *
111  * FIXME
112  *  if the datatype REG_EXPAND_SZ then expand the string and change
113  *  *pdwType to REG_SZ.
114  */
115 HRESULT WINAPI SHRegQueryValueExW (
116         HKEY hkey,
117         LPWSTR pszValue,
118         LPDWORD pdwReserved,
119         LPDWORD pdwType,
120         LPVOID pvData,
121         LPDWORD pcbData)
122 {
123         DWORD ret;
124         WARN("%p %s %p %p %p %p semi-stub\n",
125                 hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
126         ret = RegQueryValueExW ( hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
127         return ret;
128 }
129
130 /*************************************************************************
131  * SHRegDeleteKeyW   [SHELL32.512]
132  */
133 HRESULT WINAPI SHRegDeleteKeyW(
134         HKEY hkey,
135         LPCWSTR pszSubKey)
136 {
137         FIXME("hkey=%p, %s\n", hkey, debugstr_w(pszSubKey));
138         return 0;
139 }
140
141 /*************************************************************************
142  * SHRegCloseKey                        [SHELL32.505] NT 4.0
143  *
144  */
145 HRESULT WINAPI SHRegCloseKey (HKEY hkey)
146 {
147         TRACE("%p\n",hkey);
148         return RegCloseKey( hkey );
149 }