ReactOS 0.4.16-dev-320-g3bd9ddc
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 "shell32_main.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 147 of file shellreg.c.

148{
149 HRESULT hr = S_OK;
150 static WCHAR wszSessionKey[256];
151 LONG Error;
152
153 if (!wszSessionKey[0]) // FIXME: Critical Section
154 {
155 HANDLE hToken;
156
158 {
159 TOKEN_STATISTICS Stats;
161
162 if (GetTokenInformation(hToken, TokenStatistics, &Stats, sizeof(Stats), &ReturnLength))
163 {
164 swprintf(wszSessionKey,
165 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\SessionInfo\\%08x%08x",
167 }
168 else
170
171 CloseHandle(hToken);
172 }
173 else
175 }
176
177 if(SUCCEEDED(hr))
178 {
179 Error = RegCreateKeyExW(HKEY_LOCAL_MACHINE, wszSessionKey, 0, NULL,
180 REG_OPTION_VOLATILE, samDesired, NULL, phKey, NULL);
181 if (Error != ERROR_SUCCESS)
183 }
184
185 return hr;
186}
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:1096
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 136 of file shellreg.c.

137{
138 TRACE("%p\n",hkey);
139 return RegCloseKey( hkey );
140}
#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 124 of file shellreg.c.

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

◆ SHRegOpenKeyA()

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

Definition at line 42 of file shellreg.c.

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

◆ SHRegOpenKeyW()

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

Definition at line 55 of file shellreg.c.

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

◆ SHRegQueryValueA()

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

Definition at line 68 of file shellreg.c.

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

◆ SHRegQueryValueExA()

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

Definition at line 78 of file shellreg.c.

85{
86 TRACE("%p %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
87 return SHQueryValueExA(hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
88}
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 108 of file shellreg.c.

115{
116 TRACE("%p %s %p %p %p %p\n",
117 hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
118 return SHQueryValueExW(hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
119}
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 94 of file shellreg.c.

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

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )