ReactOS 0.4.15-dev-7098-ge0c17c3
shellreg.c File Reference
#include <wine/config.h>
#include <stdio.h>
#include <windef.h>
#include <winbase.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <wine/debug.h>
Include dependency graph for shellreg.c:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
HRESULT WINAPI SHRegOpenKeyA (HKEY hKey, LPSTR lpSubKey, PHKEY phkResult)
 
HRESULT WINAPI SHRegOpenKeyW (HKEY hkey, LPCWSTR lpszSubKey, PHKEY retkey)
 
HRESULT WINAPI SHRegQueryValueA (HKEY hkey, LPSTR lpSubKey, LPSTR lpValue, LPDWORD lpcbValue)
 
LONG WINAPI SHRegQueryValueExA (HKEY hkey, LPCSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData)
 
HRESULT WINAPI SHRegQueryValueW (HKEY hkey, LPWSTR lpszSubKey, LPWSTR lpszData, LPDWORD lpcbData)
 
LONG WINAPI SHRegQueryValueExW (HKEY hkey, LPCWSTR pszValue, LPDWORD pdwReserved, LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData)
 
HRESULT WINAPI SHRegDeleteKeyW (HKEY hkey, LPCWSTR pszSubKey)
 
HRESULT WINAPI SHRegCloseKey (HKEY hkey)
 
HRESULT WINAPI SHCreateSessionKey (REGSAM samDesired, PHKEY phKey)
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 26 of file shellreg.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 25 of file shellreg.c.

Function Documentation

◆ SHCreateSessionKey()

HRESULT WINAPI SHCreateSessionKey ( REGSAM  samDesired,
PHKEY  phKey 
)

Definition at line 146 of file shellreg.c.

147{
148 HRESULT hr = S_OK;
149 static WCHAR wszSessionKey[256];
150 LONG Error;
151
152 if (!wszSessionKey[0]) // FIXME: Critical Section
153 {
154 HANDLE hToken;
155
157 {
158 TOKEN_STATISTICS Stats;
160
161 if (GetTokenInformation(hToken, TokenStatistics, &Stats, sizeof(Stats), &ReturnLength))
162 {
163 swprintf(wszSessionKey,
164 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\SessionInfo\\%08x%08x",
166 }
167 else
169
170 CloseHandle(hToken);
171 }
172 else
174 }
175
176 if(SUCCEEDED(hr))
177 {
178 Error = RegCreateKeyExW(HKEY_LOCAL_MACHINE, wszSessionKey, 0, NULL,
179 REG_OPTION_VOLATILE, samDesired, NULL, phKey, NULL);
180 if (Error != ERROR_SUCCESS)
182 }
183
184 return hr;
185}
BOOL Error
Definition: chkdsk.c:66
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1091
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:411
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:294
#define CloseHandle
Definition: compat.h:739
#define GetCurrentProcess()
Definition: compat.h:759
#define swprintf
Definition: precomp.h:40
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:43
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define REG_OPTION_VOLATILE
Definition: nt_native.h:1060
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
HRESULT hr
Definition: shlfolder.c:183
LONG HighPart
DWORD LowPart
LUID AuthenticationId
Definition: setypes.h:1087
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
@ TokenStatistics
Definition: setypes.h:975
#define TOKEN_READ
Definition: setypes.h:951
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by DoStartStartupItems(), and startup().

◆ SHRegCloseKey()

HRESULT WINAPI SHRegCloseKey ( HKEY  hkey)

Definition at line 135 of file shellreg.c.

136{
137 TRACE("%p\n",hkey);
138 return RegCloseKey( hkey );
139}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define TRACE(s)
Definition: solgame.cpp:4

◆ SHRegDeleteKeyW()

HRESULT WINAPI SHRegDeleteKeyW ( HKEY  hkey,
LPCWSTR  pszSubKey 
)

Definition at line 123 of file shellreg.c.

126{
127 FIXME("hkey=%p, %s\n", hkey, debugstr_w(pszSubKey));
128 return 0;
129}
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_w
Definition: kernel32.h:32

◆ SHRegOpenKeyA()

HRESULT WINAPI SHRegOpenKeyA ( HKEY  hKey,
LPSTR  lpSubKey,
PHKEY  phkResult 
)

Definition at line 41 of file shellreg.c.

45{
46 TRACE("(%p, %s, %p)\n", hKey, debugstr_a(lpSubKey), phkResult);
47 return RegOpenKeyA(hKey, lpSubKey, phkResult);
48}
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3254
FxAutoRegKey hKey
#define debugstr_a
Definition: kernel32.h:31

◆ SHRegOpenKeyW()

HRESULT WINAPI SHRegOpenKeyW ( HKEY  hkey,
LPCWSTR  lpszSubKey,
PHKEY  retkey 
)

Definition at line 54 of file shellreg.c.

58{
59 WARN("%p %s %p\n",hkey,debugstr_w(lpszSubKey),retkey);
60 return RegOpenKeyW( hkey, lpszSubKey, retkey );
61}
#define WARN(fmt,...)
Definition: debug.h:112
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3288

◆ SHRegQueryValueA()

HRESULT WINAPI SHRegQueryValueA ( HKEY  hkey,
LPSTR  lpSubKey,
LPSTR  lpValue,
LPDWORD  lpcbValue 
)

Definition at line 67 of file shellreg.c.

68{
69 TRACE("(%p %s %p %p)\n", hkey, debugstr_a(lpSubKey), lpValue, lpcbValue);
70 return RegQueryValueA(hkey, lpSubKey, lpValue, (LONG*)lpcbValue);
71}
LSTATUS WINAPI RegQueryValueA(HKEY hkey, LPCSTR name, LPSTR data, LPLONG count)
Definition: reg.c:4232

◆ SHRegQueryValueExA()

LONG WINAPI SHRegQueryValueExA ( HKEY  hkey,
LPCSTR  lpValueName,
LPDWORD  lpReserved,
LPDWORD  lpType,
LPBYTE  lpData,
LPDWORD  lpcbData 
)

Definition at line 77 of file shellreg.c.

84{
85 TRACE("%p %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
86 return SHQueryValueExA(hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
87}
DWORD WINAPI SHQueryValueExA(HKEY hKey, LPCSTR lpszValue, LPDWORD lpReserved, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1402

◆ SHRegQueryValueExW()

LONG WINAPI SHRegQueryValueExW ( HKEY  hkey,
LPCWSTR  pszValue,
LPDWORD  pdwReserved,
LPDWORD  pdwType,
LPVOID  pvData,
LPDWORD  pcbData 
)

Definition at line 107 of file shellreg.c.

114{
115 TRACE("%p %s %p %p %p %p\n",
116 hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
117 return SHQueryValueExW(hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
118}
DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue, LPDWORD lpReserved, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1461
_Reserved_ DWORD * pdwReserved
Definition: wincrypt.h:4254
_In_ DWORD _Out_writes_bytes_to_opt_ pcbData void _Inout_ DWORD * pcbData
Definition: wincrypt.h:4950
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3749

Referenced by SHELL_TryAppPathW().

◆ SHRegQueryValueW()

HRESULT WINAPI SHRegQueryValueW ( HKEY  hkey,
LPWSTR  lpszSubKey,
LPWSTR  lpszData,
LPDWORD  lpcbData 
)

Definition at line 93 of file shellreg.c.

98{
99 WARN("%p %s %p %p semi-stub\n",
100 hkey, debugstr_w(lpszSubKey), lpszData, lpcbData);
101 return RegQueryValueW( hkey, lpszSubKey, lpszData, (LONG*)lpcbData );
102}
LSTATUS WINAPI RegQueryValueW(HKEY hkey, LPCWSTR name, LPWSTR data, LPLONG count)
Definition: reg.c:4261

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )