configure: Changes from running autconf after previous patch.
[wine/hacks.git] / dlls / mapi32 / tests / mapi32_test.h
blob5002dbc99b3a346150e6c5f2c89001edf789bd78
1 /*
2 * This library is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU Lesser General Public
4 * License as published by the Free Software Foundation; either
5 * version 2.1 of the License, or (at your option) any later version.
7 * This library is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with this library; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 * Return FALSE if no default mail client is installed.
20 static BOOL HaveDefaultMailClient(void)
22 HKEY Key;
23 DWORD Type, Size;
24 BYTE Buffer[64];
25 BOOL HasHKCUKey;
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)
35 Size = sizeof(Buffer);
36 /* Any return value besides ERROR_FILE_NOT_FOUND (including success,
37 ERROR_MORE_DATA) indicates the value is present */
38 if (RegQueryValueExA(Key, NULL, NULL, &Type, Buffer, &Size) != ERROR_FILE_NOT_FOUND)
40 RegCloseKey(Key);
41 return TRUE;
43 RegCloseKey(Key);
44 HasHKCUKey = TRUE;
46 else
47 HasHKCUKey = FALSE;
49 if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Clients\\Mail", 0, KEY_QUERY_VALUE, &Key) == ERROR_SUCCESS)
51 Size = sizeof(Buffer);
52 if (RegQueryValueExA(Key, NULL, NULL, &Type, Buffer, &Size) != ERROR_FILE_NOT_FOUND)
54 RegCloseKey(Key);
55 return TRUE;
57 RegCloseKey(Key);
58 return FALSE;
61 return ! HasHKCUKey;