ReactOS  0.4.14-dev-317-g96040ec
shellreg.c File Reference
#include <wine/config.h>
#include <stdio.h>
#include <windef.h>
#include <winbase.h>
#include <shlobj.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)
 
HRESULT WINAPI SHRegQueryValueExA (HKEY hkey, LPSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData)
 
HRESULT WINAPI SHRegQueryValueW (HKEY hkey, LPWSTR lpszSubKey, LPWSTR lpszData, LPDWORD lpcbData)
 
HRESULT WINAPI SHRegQueryValueExW (HKEY hkey, LPWSTR 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 151 of file shellreg.c.

152 {
153  HRESULT hr = S_OK;
154  static WCHAR wszSessionKey[256];
155  LONG Error;
156 
157  if (!wszSessionKey[0]) // FIXME: Critical Section
158  {
159  HANDLE hToken;
160 
162  {
163  TOKEN_STATISTICS Stats;
165 
166  if (GetTokenInformation(hToken, TokenStatistics, &Stats, sizeof(Stats), &ReturnLength))
167  {
168  swprintf(wszSessionKey,
169  L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\SessionInfo\\%08x%08x",
171  }
172  else
174 
175  CloseHandle(hToken);
176  }
177  else
179  }
180 
181  if(SUCCEEDED(hr))
182  {
183  Error = RegCreateKeyExW(HKEY_LOCAL_MACHINE, wszSessionKey, 0, NULL,
184  REG_OPTION_VOLATILE, samDesired, NULL, phKey, NULL);
185  if (Error != ERROR_SUCCESS)
187  }
188 
189  return hr;
190 }
LUID AuthenticationId
Definition: setypes.h:1033
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:39
#define CloseHandle
Definition: compat.h:398
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
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
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
DWORD LowPart
LONG HRESULT
Definition: typedefs.h:77
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
#define swprintf(buf, format,...)
Definition: sprintf.c:56
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL Error
Definition: chkdsk.c:66
static const WCHAR L[]
Definition: oid.c:1250
#define TOKEN_READ
Definition: setypes.h:897
LONG HighPart
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:296
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:413
#define REG_OPTION_VOLATILE
Definition: nt_native.h:1060
#define SUCCEEDED(hr)
Definition: intsafe.h:57
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by DoStartStartupItems(), and startup().

◆ SHRegCloseKey()

HRESULT WINAPI SHRegCloseKey ( HKEY  hkey)

Definition at line 140 of file shellreg.c.

141 {
142  TRACE("%p\n",hkey);
143  return RegCloseKey( hkey );
144 }
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define TRACE(s)
Definition: solgame.cpp:4

◆ SHRegDeleteKeyW()

HRESULT WINAPI SHRegDeleteKeyW ( HKEY  hkey,
LPCWSTR  pszSubKey 
)

Definition at line 128 of file shellreg.c.

131 {
132  FIXME("hkey=%p, %s\n", hkey, debugstr_w(pszSubKey));
133  return 0;
134 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110

◆ SHRegOpenKeyA()

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

Definition at line 40 of file shellreg.c.

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

◆ SHRegOpenKeyW()

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

Definition at line 53 of file shellreg.c.

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

◆ SHRegQueryValueA()

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

Definition at line 66 of file shellreg.c.

67 {
68  TRACE("(%p %s %p %p)\n", hkey, debugstr_a(lpSubKey), lpValue, lpcbValue);
69  return RegQueryValueA(hkey, lpSubKey, lpValue, (LONG*)lpcbValue);
70 }
LSTATUS WINAPI RegQueryValueA(HKEY hkey, LPCSTR name, LPSTR data, LPLONG count)
Definition: reg.c:4225
long LONG
Definition: pedump.c:60
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31

◆ SHRegQueryValueExA()

HRESULT WINAPI SHRegQueryValueExA ( HKEY  hkey,
LPSTR  lpValueName,
LPDWORD  lpReserved,
LPDWORD  lpType,
LPBYTE  lpData,
LPDWORD  lpcbData 
)

Definition at line 76 of file shellreg.c.

83 {
84  TRACE("%p %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
85  return RegQueryValueExA (hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
86 }
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4023
#define TRACE(s)
Definition: solgame.cpp:4

◆ SHRegQueryValueExW()

HRESULT WINAPI SHRegQueryValueExW ( HKEY  hkey,
LPWSTR  pszValue,
LPDWORD  pdwReserved,
LPDWORD  pdwType,
LPVOID  pvData,
LPDWORD  pcbData 
)

Definition at line 110 of file shellreg.c.

117 {
118  DWORD ret;
119  WARN("%p %s %p %p %p %p semi-stub\n",
120  hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
121  ret = RegQueryValueExW ( hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
122  return ret;
123 }
#define WARN(fmt,...)
Definition: debug.h:111
#define debugstr_w
Definition: kernel32.h:32
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3748
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
_Reserved_ DWORD * pdwReserved
Definition: wincrypt.h:4254
_In_ DWORD _Out_writes_bytes_to_opt_ pcbData void _Inout_ DWORD * pcbData
Definition: wincrypt.h:4953

◆ SHRegQueryValueW()

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

Definition at line 92 of file shellreg.c.

97 {
98  WARN("%p %s %p %p semi-stub\n",
99  hkey, debugstr_w(lpszSubKey), lpszData, lpcbData);
100  return RegQueryValueW( hkey, lpszSubKey, lpszData, (LONG*)lpcbData );
101 }
#define WARN(fmt,...)
Definition: debug.h:111
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
LSTATUS WINAPI RegQueryValueW(HKEY hkey, LPCWSTR name, LPWSTR data, LPLONG count)
Definition: reg.c:4254

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )