mapi32: Use wide-char string literals.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2020-12-03 00:32:51 +01:00 committed by Alexandre Julliard
parent 24ac30d2a0
commit 7ae2a7cbcd
2 changed files with 11 additions and 19 deletions

View File

@ -102,7 +102,7 @@ static ULONG ptTypes[] = {
static void test_PropCopyMore(void)
{
static char szHiA[] = "Hi!";
static WCHAR szHiW[] = { 'H', 'i', '!', '\0' };
static WCHAR szHiW[] = L"Hi!";
SPropValue *lpDest = NULL, *lpSrc = NULL;
ULONG i;
SCODE scode;
@ -182,7 +182,7 @@ static void test_PropCopyMore(void)
static void test_UlPropSize(void)
{
static char szHiA[] = "Hi!";
static WCHAR szHiW[] = { 'H', 'i', '!', '\0' };
static WCHAR szHiW[] = L"Hi!";
LPSTR buffa[2];
LPWSTR buffw[2];
SBinary buffbin[2];
@ -702,7 +702,7 @@ static void test_PpropFindProp(void)
static void test_ScCountProps(void)
{
static char szHiA[] = "Hi!";
static WCHAR szHiW[] = { 'H', 'i', '!', '\0' };
static WCHAR szHiW[] = L"Hi!";
static const ULONG ULHILEN = 4; /* chars in szHiA/W incl. NUL */
LPSTR buffa[3];
LPWSTR buffw[3];
@ -971,7 +971,7 @@ static void test_FBadRglpszA(void)
static void test_FBadRglpszW(void)
{
LPWSTR lpStrs[4];
static WCHAR szString[] = { 'A',' ','S','t','r','i','n','g','\0' };
static WCHAR szString[] = L"A String";
BOOL bRet;
if (!pFBadRglpszW)
@ -1063,7 +1063,7 @@ static void test_FBadRow(void)
static void test_FBadProp(void)
{
static WCHAR szEmpty[] = { '\0' };
static WCHAR szEmpty[] = L"";
GUID iid;
ULONG pt, res;
SPropValue pv;

View File

@ -966,8 +966,6 @@ static HMODULE mapi_ex_provider;
*/
static void load_mapi_provider(HKEY hkeyMail, LPCWSTR valueName, HMODULE *mapi_provider)
{
static const WCHAR mapi32_dll[] = {'m','a','p','i','3','2','.','d','l','l',0 };
DWORD dwType, dwLen = 0;
LPWSTR dllPath;
@ -982,7 +980,7 @@ static void load_mapi_provider(HKEY hkeyMail, LPCWSTR valueName, HMODULE *mapi_p
RegQueryValueExW(hkeyMail, valueName, NULL, NULL, (LPBYTE)dllPath, &dwLen);
/* Check that this value doesn't refer to mapi32.dll (eg, as Outlook does) */
if (lstrcmpiW(dllPath, mapi32_dll) != 0)
if (lstrcmpiW(dllPath, L"mapi32.dll") != 0)
{
if (dwType == REG_EXPAND_SZ)
{
@ -1022,13 +1020,7 @@ static void load_mapi_provider(HKEY hkeyMail, LPCWSTR valueName, HMODULE *mapi_p
*/
void load_mapi_providers(void)
{
static const WCHAR regkey_mail[] = {
'S','o','f','t','w','a','r','e','\\','C','l','i','e','n','t','s','\\',
'M','a','i','l',0 };
static const WCHAR regkey_dllpath[] = {'D','L','L','P','a','t','h',0 };
static const WCHAR regkey_dllpath_ex[] = {'D','L','L','P','a','t','h','E','x',0 };
static const WCHAR regkey_backslash[] = { '\\', 0 };
static const WCHAR regkey_mail[] = L"Software\\Clients\\Mail";
HKEY hkeyMail;
DWORD dwType, dwLen = 0;
@ -1056,13 +1048,13 @@ void load_mapi_providers(void)
TRACE("appName: %s\n", debugstr_w(appName));
appKey = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * (lstrlenW(regkey_mail) +
lstrlenW(regkey_backslash) + lstrlenW(appName) + 1));
lstrlenW(L"\\") + lstrlenW(appName) + 1));
if (!appKey)
goto cleanUp;
lstrcpyW(appKey, regkey_mail);
lstrcatW(appKey, regkey_backslash);
lstrcatW(appKey, L"\\");
lstrcatW(appKey, appName);
RegCloseKey(hkeyMail);
@ -1074,8 +1066,8 @@ void load_mapi_providers(void)
goto cleanUp;
/* Try to load the providers */
load_mapi_provider(hkeyMail, regkey_dllpath, &mapi_provider);
load_mapi_provider(hkeyMail, regkey_dllpath_ex, &mapi_ex_provider);
load_mapi_provider(hkeyMail, L"DLLPath", &mapi_provider);
load_mapi_provider(hkeyMail, L"DLLPathEx", &mapi_ex_provider);
/* Now try to load our function pointers */
ZeroMemory(&mapiFunctions, sizeof(mapiFunctions));