2 * Shell Registry Access
4 * Copyright 2000 Juergen Schmied
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.
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.
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
33 #include "shell32_main.h"
35 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(shell
);
39 /*************************************************************************
40 * SHRegOpenKeyA [SHELL32.506]
43 HRESULT WINAPI
SHRegOpenKeyA(
48 TRACE("(%p, %s, %p)\n", hKey
, debugstr_a(lpSubKey
), phkResult
);
49 return RegOpenKeyA(hKey
, lpSubKey
, phkResult
);
52 /*************************************************************************
53 * SHRegOpenKeyW [SHELL32.507] NT 4.0
56 HRESULT WINAPI
SHRegOpenKeyW (
61 WARN("%p %s %p\n",hkey
,debugstr_w(lpszSubKey
),retkey
);
62 return RegOpenKeyW( hkey
, lpszSubKey
, retkey
);
65 /*************************************************************************
66 * SHRegQueryValueA [SHELL32.508]
69 HRESULT WINAPI
SHRegQueryValueA(HKEY hkey
, LPSTR lpSubKey
, LPSTR lpValue
, LPDWORD lpcbValue
)
71 TRACE("(%p %s %p %p)\n", hkey
, debugstr_a(lpSubKey
), lpValue
, lpcbValue
);
72 return RegQueryValueA(hkey
, lpSubKey
, lpValue
, (LONG
*)lpcbValue
);
75 /*************************************************************************
76 * SHRegQueryValueExA [SHELL32.509]
79 HRESULT WINAPI
SHRegQueryValueExA(
87 TRACE("%p %s %p %p %p %p\n", hkey
, lpValueName
, lpReserved
, lpType
, lpData
, lpcbData
);
88 return RegQueryValueExA (hkey
, lpValueName
, lpReserved
, lpType
, lpData
, lpcbData
);
91 /*************************************************************************
92 * SHRegQueryValueW [SHELL32.510] NT4.0
95 HRESULT WINAPI
SHRegQueryValueW(
101 WARN("%p %s %p %p semi-stub\n",
102 hkey
, debugstr_w(lpszSubKey
), lpszData
, lpcbData
);
103 return RegQueryValueW( hkey
, lpszSubKey
, lpszData
, (LONG
*)lpcbData
);
106 /*************************************************************************
107 * SHRegQueryValueExW [SHELL32.511] NT4.0
110 * if the datatype REG_EXPAND_SZ then expand the string and change
111 * *pdwType to REG_SZ.
113 HRESULT WINAPI
SHRegQueryValueExW (
122 WARN("%p %s %p %p %p %p semi-stub\n",
123 hkey
, debugstr_w(pszValue
), pdwReserved
, pdwType
, pvData
, pcbData
);
124 ret
= RegQueryValueExW ( hkey
, pszValue
, pdwReserved
, pdwType
, pvData
, pcbData
);
128 /*************************************************************************
129 * SHRegDeleteKeyW [SHELL32.512]
131 HRESULT WINAPI
SHRegDeleteKeyW(
135 FIXME("hkey=%p, %s\n", hkey
, debugstr_w(pszSubKey
));
139 /*************************************************************************
140 * SHRegCloseKey [SHELL32.505] NT 4.0
143 HRESULT WINAPI
SHRegCloseKey (HKEY hkey
)
146 return RegCloseKey( hkey
);
149 /*************************************************************************
150 * SHCreateSessionKey [SHELL32.723]
153 HRESULT WINAPI
SHCreateSessionKey(REGSAM access
, HKEY
*hkey
)
156 WCHAR str
[ARRAY_SIZE(L
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\SessionInfo\\") + 16];
162 return E_ACCESSDENIED
;
164 if (!ProcessIdToSessionId(GetCurrentProcessId(), &session
))
167 swprintf(str
, ARRAY_SIZE(str
),
168 L
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\SessionInfo\\%u", session
);
169 TRACE("using session key %s\n", debugstr_w(str
));
171 ret
= RegCreateKeyExW(HKEY_CURRENT_USER
, str
, 0, NULL
, REG_OPTION_VOLATILE
, access
, NULL
, hkey
, NULL
);
172 return HRESULT_FROM_WIN32( ret
);