ReactOS 0.4.16-dev-340-g0540c21
utils.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

BOOL RegValueExists (HKEY hKey, LPCWSTR Name)
 
BOOL RegKeyExists (HKEY hKey, LPCWSTR Path)
 
DWORD RegSetOrDelete (HKEY hKey, LPCWSTR Name, DWORD Type, LPCVOID Data, DWORD Size)
 
DWORD RegSetString (HKEY hKey, LPCWSTR Name, LPCWSTR Str, DWORD Type=REG_SZ)
 
HICON SHELL32_SHExtractIcon (LPCWSTR File, int Index, int cx, int cy)
 

Function Documentation

◆ RegKeyExists()

BOOL RegKeyExists ( HKEY  hKey,
LPCWSTR  Path 
)
inline

Definition at line 17 of file utils.h.

18{
20 if (ret)
22 return ret;
23}
PRTL_UNICODE_STRING_BUFFER Path
#define RegCloseKey(hKey)
Definition: registry.h:49
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
unsigned int BOOL
Definition: ntddk_ex.h:94
FxAutoRegKey hKey
#define MAXIMUM_ALLOWED
Definition: nt_native.h:83
int ret

Referenced by EditTypeDlg_ReadClass(), and EditTypeDlg_WriteClass().

◆ RegSetOrDelete()

DWORD RegSetOrDelete ( HKEY  hKey,
LPCWSTR  Name,
DWORD  Type,
LPCVOID  Data,
DWORD  Size 
)
inline

Definition at line 26 of file utils.h.

27{
28 if (Data)
29 return RegSetValueExW(hKey, Name, 0, Type, LPBYTE(Data), Size);
30 else
31 return RegDeleteValueW(hKey, Name);
32}
Type
Definition: Type.h:7
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2330
unsigned char * LPBYTE
Definition: typedefs.h:53
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533

Referenced by EditTypeDlg_WriteClass().

◆ RegSetString()

DWORD RegSetString ( HKEY  hKey,
LPCWSTR  Name,
LPCWSTR  Str,
DWORD  Type = REG_SZ 
)
inline

Definition at line 35 of file utils.h.

36{
37 return RegSetValueExW(hKey, Name, 0, Type, LPBYTE(Str), (lstrlenW(Str) + 1) * sizeof(WCHAR));
38}
#define lstrlenW
Definition: compat.h:750
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by EditTypeDlg_WriteClass(), FileTypesDlg_AddExt(), and COpenWithList::SetDefaultHandler().

◆ RegValueExists()

BOOL RegValueExists ( HKEY  hKey,
LPCWSTR  Name 
)
inline

Definition at line 11 of file utils.h.

12{
14}
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103

Referenced by CDefaultContextMenu::AddStaticContextMenusToMenu(), EditTypeDlg_ReadClass(), and FileTypesDlg_InsertToLV().

◆ SHELL32_SHExtractIcon()

HICON SHELL32_SHExtractIcon ( LPCWSTR  File,
int  Index,
int  cx,
int  cy 
)
inline

Definition at line 42 of file utils.h.

43{
44 HICON hIco;
45 int r = PrivateExtractIconsW(File, Index, cx, cy, &hIco, NULL, 1, 0);
46 return r > 0 ? hIco : NULL;
47}
Definition: File.h:16
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static HICON
Definition: imagelist.c:80
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
_In_ WDFCOLLECTION _In_ ULONG Index
UINT WINAPI PrivateExtractIconsW(_In_reads_(MAX_PATH) LPCWSTR szFileName, _In_ int nIconIndex, _In_ int cxIcon, _In_ int cyIcon, _Out_writes_opt_(nIcons) HICON *phicon, _Out_writes_opt_(nIcons) UINT *piconid, _In_ UINT nIcons, _In_ UINT flags)

Referenced by DoExtractIcon().