@@ -46,7 +46,7 @@ namespace mapi::profile
46
46
{
47
47
if (bAddMark)
48
48
{
49
- SPropValue PropVal;
49
+ SPropValue PropVal{} ;
50
50
PropVal.ulPropTag = PR_MARKER;
51
51
PropVal.Value .lpszA = MARKER_STRING;
52
52
EC_MAPI_S (lpSect->SetProps (1 , &PropVal, nullptr ));
@@ -200,7 +200,10 @@ namespace mapi::profile
200
200
hRes = EC_H_MSG (
201
201
IDS_CREATEMSGSERVICEFAILED,
202
202
lpServiceAdmin->CreateMsgService (
203
- LPTSTR (lpszServiceNameA.c_str ()), LPTSTR (lpszServiceNameA.c_str ()), ulUIParam, ulFlags));
203
+ strings::LPCSTRToLPTSTR (lpszServiceNameA.c_str ()),
204
+ strings::LPCSTRToLPTSTR (lpszServiceNameA.c_str ()),
205
+ ulUIParam,
206
+ ulFlags));
204
207
}
205
208
206
209
if (lpPropVals)
@@ -259,7 +262,7 @@ namespace mapi::profile
259
262
return MAPI_E_INVALID_PARAMETER;
260
263
261
264
#define NUMEXCHANGEPROPS 2
262
- SPropValue PropVal[NUMEXCHANGEPROPS];
265
+ SPropValue PropVal[NUMEXCHANGEPROPS]{} ;
263
266
PropVal[0 ].ulPropTag = PR_PROFILE_UNRESOLVED_SERVER;
264
267
auto lpszServerNameA = strings::wstringTostring (lpszServerName);
265
268
PropVal[0 ].Value .lpszA = const_cast <LPSTR>(lpszServerNameA.c_str ());
@@ -296,7 +299,7 @@ namespace mapi::profile
296
299
auto lpszPasswordA = strings::wstringTostring (lpszPassword);
297
300
if (bUnicodePST)
298
301
{
299
- SPropValue PropVal[3 ];
302
+ SPropValue PropVal[3 ]{} ;
300
303
PropVal[0 ].ulPropTag = CHANGE_PROP_TYPE (PR_PST_PATH, PT_UNICODE);
301
304
PropVal[0 ].Value .lpszW = const_cast <LPWSTR>(lpszPSTPath.c_str ());
302
305
PropVal[1 ].ulPropTag = PR_PST_CONFIG_FLAGS;
@@ -309,7 +312,7 @@ namespace mapi::profile
309
312
}
310
313
else
311
314
{
312
- SPropValue PropVal[2 ];
315
+ SPropValue PropVal[2 ]{} ;
313
316
PropVal[0 ].ulPropTag = CHANGE_PROP_TYPE (PR_PST_PATH, PT_UNICODE);
314
317
PropVal[0 ].Value .lpszW = const_cast <LPWSTR>(lpszPSTPath.c_str ());
315
318
PropVal[1 ].ulPropTag = PR_PST_PW_SZ_OLD;
@@ -337,7 +340,7 @@ namespace mapi::profile
337
340
338
341
// Create the profile
339
342
hRes = WC_MAPI (lpProfAdmin->CreateProfile (
340
- LPTSTR (strings::wstringTostring (lpszProfileName).c_str ()),
343
+ strings::LPCSTRToLPTSTR (strings::wstringTostring (lpszProfileName).c_str ()),
341
344
nullptr ,
342
345
0 ,
343
346
NULL )); // fMapiUnicode is not supported!
@@ -364,7 +367,8 @@ namespace mapi::profile
364
367
auto hRes = EC_MAPI (MAPIAdminProfiles (0 , &lpProfAdmin));
365
368
if (!lpProfAdmin) return hRes;
366
369
367
- hRes = EC_MAPI (lpProfAdmin->DeleteProfile (LPTSTR (strings::wstringTostring (lpszProfileName).c_str ()), 0 ));
370
+ hRes = EC_MAPI (
371
+ lpProfAdmin->DeleteProfile (strings::LPCSTRToLPTSTR (strings::wstringTostring (lpszProfileName).c_str ()), 0 ));
368
372
369
373
lpProfAdmin->Release ();
370
374
@@ -385,7 +389,8 @@ namespace mapi::profile
385
389
auto hRes = EC_MAPI (MAPIAdminProfiles (0 , &lpProfAdmin));
386
390
if (!lpProfAdmin) return hRes;
387
391
388
- hRes = EC_MAPI (lpProfAdmin->SetDefaultProfile (LPTSTR (strings::wstringTostring (lpszProfileName).c_str ()), 0 ));
392
+ hRes = EC_MAPI (lpProfAdmin->SetDefaultProfile (
393
+ strings::LPCSTRToLPTSTR (strings::wstringTostring (lpszProfileName).c_str ()), 0 ));
389
394
390
395
lpProfAdmin->Release ();
391
396
@@ -511,7 +516,7 @@ namespace mapi::profile
511
516
PR_PROFILE_SERVER_FULL_VERSION == lpServerFullVersion->ulPropTag &&
512
517
sizeof (EXCHANGE_STORE_VERSION_NUM) == mapi::getBin (lpServerFullVersion).cb )
513
518
{
514
- const auto bin = mapi::getBin (lpServerFullVersion);
519
+ const SBinary& bin = mapi::getBin (lpServerFullVersion);
515
520
output::DebugPrint (output::dbgLevel::Generic, L" PR_PROFILE_SERVER_FULL_VERSION = " );
516
521
output::outputBinary (output::dbgLevel::Generic, nullptr , bin);
517
522
output::DebugPrint (output::dbgLevel::Generic, L" \n " );
@@ -553,9 +558,9 @@ namespace mapi::profile
553
558
if (!lpProfAdmin) return hRes;
554
559
555
560
hRes = EC_MAPI (lpProfAdmin->CopyProfile (
556
- LPTSTR (strings::wstringTostring (lpszOldProfileName).c_str ()),
561
+ strings::LPCSTRToLPTSTR (strings::wstringTostring (lpszOldProfileName).c_str ()),
557
562
nullptr ,
558
- LPTSTR (strings::wstringTostring (lpszNewProfileName).c_str ()),
563
+ strings::LPCSTRToLPTSTR (strings::wstringTostring (lpszNewProfileName).c_str ()),
559
564
NULL ,
560
565
NULL ));
561
566
0 commit comments