ReactOS 0.4.15-dev-7942-gd23573b
mapi32_test.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static BOOL HaveDefaultMailClient (void)
 

Function Documentation

◆ HaveDefaultMailClient()

static BOOL HaveDefaultMailClient ( void  )
static

Definition at line 20 of file mapi32_test.h.

21{
22 HKEY Key;
24 BYTE Buffer[64];
25 BOOL HasHKCUKey;
26
27 /* We check the default value of both HKCU\Software\Clients\Mail and
28 * HKLM\Software\Clients\Mail, if one of them is present there is a default
29 * mail client. If neither of these keys is present, we might be running
30 * on an old Windows version (W95, NT4) and we assume a default mail client
31 * might be available. Only if one of the keys is present, but there is
32 * no default value do we assume there is no default client. */
33 if (RegOpenKeyExA(HKEY_CURRENT_USER, "SOFTWARE\\Clients\\Mail", 0, KEY_QUERY_VALUE, &Key) == ERROR_SUCCESS)
34 {
35 Size = sizeof(Buffer);
36 /* Any return value besides ERROR_FILE_NOT_FOUND (including success,
37 ERROR_MORE_DATA) indicates the value is present */
39 {
41 return TRUE;
42 }
44 HasHKCUKey = TRUE;
45 }
46 else
47 HasHKCUKey = FALSE;
48
49 if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Clients\\Mail", 0, KEY_QUERY_VALUE, &Key) == ERROR_SUCCESS)
50 {
51 Size = sizeof(Buffer);
53 {
55 return TRUE;
56 }
58 return FALSE;
59 }
60
61 return ! HasHKCUKey;
62}
Type
Definition: Type.h:7
#define RegCloseKey(hKey)
Definition: registry.h:49
Definition: bufpool.h:45
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
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:4009
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
unsigned char BYTE
Definition: xxhash.c:193

Referenced by START_TEST().