Commit 7ae2a7cb authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

mapi32: Use wide-char string literals.

parent 24ac30d2
...@@ -102,7 +102,7 @@ static ULONG ptTypes[] = { ...@@ -102,7 +102,7 @@ static ULONG ptTypes[] = {
static void test_PropCopyMore(void) static void test_PropCopyMore(void)
{ {
static char szHiA[] = "Hi!"; static char szHiA[] = "Hi!";
static WCHAR szHiW[] = { 'H', 'i', '!', '\0' }; static WCHAR szHiW[] = L"Hi!";
SPropValue *lpDest = NULL, *lpSrc = NULL; SPropValue *lpDest = NULL, *lpSrc = NULL;
ULONG i; ULONG i;
SCODE scode; SCODE scode;
...@@ -182,7 +182,7 @@ static void test_PropCopyMore(void) ...@@ -182,7 +182,7 @@ static void test_PropCopyMore(void)
static void test_UlPropSize(void) static void test_UlPropSize(void)
{ {
static char szHiA[] = "Hi!"; static char szHiA[] = "Hi!";
static WCHAR szHiW[] = { 'H', 'i', '!', '\0' }; static WCHAR szHiW[] = L"Hi!";
LPSTR buffa[2]; LPSTR buffa[2];
LPWSTR buffw[2]; LPWSTR buffw[2];
SBinary buffbin[2]; SBinary buffbin[2];
...@@ -702,7 +702,7 @@ static void test_PpropFindProp(void) ...@@ -702,7 +702,7 @@ static void test_PpropFindProp(void)
static void test_ScCountProps(void) static void test_ScCountProps(void)
{ {
static char szHiA[] = "Hi!"; 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 */ static const ULONG ULHILEN = 4; /* chars in szHiA/W incl. NUL */
LPSTR buffa[3]; LPSTR buffa[3];
LPWSTR buffw[3]; LPWSTR buffw[3];
...@@ -971,7 +971,7 @@ static void test_FBadRglpszA(void) ...@@ -971,7 +971,7 @@ static void test_FBadRglpszA(void)
static void test_FBadRglpszW(void) static void test_FBadRglpszW(void)
{ {
LPWSTR lpStrs[4]; LPWSTR lpStrs[4];
static WCHAR szString[] = { 'A',' ','S','t','r','i','n','g','\0' }; static WCHAR szString[] = L"A String";
BOOL bRet; BOOL bRet;
if (!pFBadRglpszW) if (!pFBadRglpszW)
...@@ -1063,7 +1063,7 @@ static void test_FBadRow(void) ...@@ -1063,7 +1063,7 @@ static void test_FBadRow(void)
static void test_FBadProp(void) static void test_FBadProp(void)
{ {
static WCHAR szEmpty[] = { '\0' }; static WCHAR szEmpty[] = L"";
GUID iid; GUID iid;
ULONG pt, res; ULONG pt, res;
SPropValue pv; SPropValue pv;
......
...@@ -966,8 +966,6 @@ static HMODULE mapi_ex_provider; ...@@ -966,8 +966,6 @@ static HMODULE mapi_ex_provider;
*/ */
static void load_mapi_provider(HKEY hkeyMail, LPCWSTR valueName, HMODULE *mapi_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; DWORD dwType, dwLen = 0;
LPWSTR dllPath; LPWSTR dllPath;
...@@ -982,7 +980,7 @@ static void load_mapi_provider(HKEY hkeyMail, LPCWSTR valueName, HMODULE *mapi_p ...@@ -982,7 +980,7 @@ static void load_mapi_provider(HKEY hkeyMail, LPCWSTR valueName, HMODULE *mapi_p
RegQueryValueExW(hkeyMail, valueName, NULL, NULL, (LPBYTE)dllPath, &dwLen); RegQueryValueExW(hkeyMail, valueName, NULL, NULL, (LPBYTE)dllPath, &dwLen);
/* Check that this value doesn't refer to mapi32.dll (eg, as Outlook does) */ /* 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) if (dwType == REG_EXPAND_SZ)
{ {
...@@ -1022,13 +1020,7 @@ static void load_mapi_provider(HKEY hkeyMail, LPCWSTR valueName, HMODULE *mapi_p ...@@ -1022,13 +1020,7 @@ static void load_mapi_provider(HKEY hkeyMail, LPCWSTR valueName, HMODULE *mapi_p
*/ */
void load_mapi_providers(void) void load_mapi_providers(void)
{ {
static const WCHAR regkey_mail[] = { static const WCHAR regkey_mail[] = L"Software\\Clients\\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 };
HKEY hkeyMail; HKEY hkeyMail;
DWORD dwType, dwLen = 0; DWORD dwType, dwLen = 0;
...@@ -1056,13 +1048,13 @@ void load_mapi_providers(void) ...@@ -1056,13 +1048,13 @@ void load_mapi_providers(void)
TRACE("appName: %s\n", debugstr_w(appName)); TRACE("appName: %s\n", debugstr_w(appName));
appKey = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * (lstrlenW(regkey_mail) + appKey = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * (lstrlenW(regkey_mail) +
lstrlenW(regkey_backslash) + lstrlenW(appName) + 1)); lstrlenW(L"\\") + lstrlenW(appName) + 1));
if (!appKey) if (!appKey)
goto cleanUp; goto cleanUp;
lstrcpyW(appKey, regkey_mail); lstrcpyW(appKey, regkey_mail);
lstrcatW(appKey, regkey_backslash); lstrcatW(appKey, L"\\");
lstrcatW(appKey, appName); lstrcatW(appKey, appName);
RegCloseKey(hkeyMail); RegCloseKey(hkeyMail);
...@@ -1074,8 +1066,8 @@ void load_mapi_providers(void) ...@@ -1074,8 +1066,8 @@ void load_mapi_providers(void)
goto cleanUp; goto cleanUp;
/* Try to load the providers */ /* Try to load the providers */
load_mapi_provider(hkeyMail, regkey_dllpath, &mapi_provider); load_mapi_provider(hkeyMail, L"DLLPath", &mapi_provider);
load_mapi_provider(hkeyMail, regkey_dllpath_ex, &mapi_ex_provider); load_mapi_provider(hkeyMail, L"DLLPathEx", &mapi_ex_provider);
/* Now try to load our function pointers */ /* Now try to load our function pointers */
ZeroMemory(&mapiFunctions, sizeof(mapiFunctions)); ZeroMemory(&mapiFunctions, sizeof(mapiFunctions));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment