Skip to content

Commit ccf51a4

Browse files
U/sgriffin/codeql (#641)
* build codeql install script * Local codeql working now * Fix some codeql issues * update ignores * update ignores * fix some reference issues * Encapsulate some casts * Add some function return checks * Add nuget config with package sources * update commit
1 parent 6ae5f04 commit ccf51a4

25 files changed

+182
-61
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@
2323
*.aps
2424
/mfcmapitest
2525
/packages
26+
scripts/codeql/*
27+
vc140.pdb
28+
/.sarif/codeql.sarif

NuGet.Config

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="nuget.org" value="https://www.nuget.org/api/v3/index.json" />
5+
<add key="Guardian" value="https://securitytools.pkgs.visualstudio.com/_packaging/Guardian/nuget/v3/index.json" />
6+
</packageSources>
7+
</configuration>

UI/Controls/SortList/ContentsTableListCtrl.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,12 @@ namespace controls::sortlistctrl
117117
{
118118
POINT point = {};
119119
const auto iItem = GetNextItem(-1, LVNI_SELECTED);
120-
GetItemPosition(iItem, &point);
121-
if (::ClientToScreen(pWnd->m_hWnd, &point))
120+
if (GetItemPosition(iItem, &point))
122121
{
123-
pos = point;
122+
if (::ClientToScreen(pWnd->m_hWnd, &point))
123+
{
124+
pos = point;
125+
}
124126
}
125127
}
126128

UI/Dialogs/ContentsTable/FolderDlg.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ namespace dialog
982982
hRes = EC_H_CANCEL(lpMAPIFormMgr->SelectForm(
983983
reinterpret_cast<ULONG_PTR>(m_hWnd),
984984
0,
985-
reinterpret_cast<LPCTSTR>(strings::wstringTostring(szTitle).c_str()),
985+
strings::LPCSTRToLPTSTR(strings::wstringTostring(szTitle).c_str()),
986986
lpFormSource,
987987
&lpMAPIFormInfo));
988988

@@ -1582,7 +1582,7 @@ namespace dialog
15821582
hRes = EC_MAPI(lpMAPISession->MessageOptions(
15831583
reinterpret_cast<ULONG_PTR>(m_hWnd),
15841584
NULL, // API doesn't like Unicode
1585-
LPTSTR(strings::wstringTostring(MyAddress.GetStringW(0)).c_str()),
1585+
strings::LPCSTRToLPTSTR(strings::wstringTostring(MyAddress.GetStringW(0)).c_str()),
15861586
lpMessage));
15871587

15881588
lpMessage->Release();

UI/Dialogs/ContentsTable/FormContainerDlg.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,9 @@ namespace dialog
229229
hwnd,
230230
ulFlags,
231231
lpszPath.c_str()); // STRING_OK
232+
const auto ansiPath = strings::wstringTostring(lpszPath);
232233
hRes = WC_MAPI(m_lpFormContainer->InstallForm(
233-
reinterpret_cast<ULONG_PTR>(hwnd), ulFlags, LPCTSTR(strings::wstringTostring(lpszPath).c_str())));
234+
reinterpret_cast<ULONG_PTR>(hwnd), ulFlags, strings::LPCSTRToLPTSTR(ansiPath.c_str())));
234235
error::CheckExtendedError(hRes, m_lpFormContainer);
235236

236237
if (bShouldCancel(this, hRes)) break;

UI/Dialogs/ContentsTable/MainDlg.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ namespace dialog
11261126
auto adrType = strings::wstringTostring(MyData.GetStringW(0));
11271127

11281128
EC_MAPI_S(lpMAPISession->QueryDefaultMessageOpt(
1129-
reinterpret_cast<LPTSTR>(const_cast<LPSTR>(adrType.c_str())),
1129+
strings::LPCSTRToLPTSTR(adrType.c_str()),
11301130
NULL, // API doesn't like Unicode
11311131
&cValues,
11321132
&lpOptions));
@@ -1179,7 +1179,7 @@ namespace dialog
11791179
auto adrType = strings::wstringTostring(MyData.GetStringW(0));
11801180

11811181
EC_MAPI_S(lpAddrBook->QueryDefaultRecipOpt(
1182-
reinterpret_cast<LPTSTR>(const_cast<LPSTR>(adrType.c_str())),
1182+
strings::LPCSTRToLPTSTR(adrType.c_str()),
11831183
NULL, // API doesn't like Unicode
11841184
&cValues,
11851185
&lpOptions));

UI/Dialogs/Dialog.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ namespace dialog
151151
// These are client coordinates - we need to translate them to screen coordinates
152152
POINT pt = {GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};
153153
output::DebugPrint(output::dbgLevel::UI, L"NCHitTestMouse: pt = %d %d", pt.x, pt.y);
154-
static_cast<void>(MapWindowPoints(hWnd, nullptr, &pt, 1)); // Map our client point to the screen
154+
if (::MapWindowPoints(hWnd, nullptr, &pt, 1) == 0) return HTNOWHERE; // Map our client point to the screen
155155
output::Outputf(output::dbgLevel::UI, nullptr, false, L" mapped = %d %d\r\n", pt.x, pt.y);
156156

157157
const auto ht = CheckButtons(hWnd, pt);

UI/Dialogs/Editors/Editor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ namespace dialog::editor
13531353
output::dbgLevel::Generic, L"Scroll: top = %d, bottom = %d\n", rcScroll.top, rcScroll.bottom);
13541354

13551355
auto rcPane = pane->GetWindowRect();
1356-
::MapWindowPoints(HWND_DESKTOP, m_ScrollWindow.GetSafeHwnd(), (LPPOINT) &rcPane, 2);
1356+
if (::MapWindowPoints(HWND_DESKTOP, m_ScrollWindow.GetSafeHwnd(), (LPPOINT) &rcPane, 2) == 0) return;
13571357
output::DebugPrint(output::dbgLevel::Generic, L"Pane: top = %d, bottom = %d\n", rcPane.top, rcPane.bottom);
13581358

13591359
auto iScroll = 0;

UI/Dialogs/Editors/HexEditor.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ namespace dialog ::editor
117117
SetStringA(HEXED_ANSI, std::string(reinterpret_cast<LPCSTR>(lpb), cb));
118118
if (!(cb % 2)) // Set Unicode String
119119
{
120-
SetStringW(HEXED_UNICODE, std::wstring(reinterpret_cast<LPWSTR>(lpb), cb / sizeof(WCHAR)));
120+
SetStringW(HEXED_UNICODE, std::wstring(strings::LPCBYTEToLPCWSTR(lpb), cb / sizeof(WCHAR)));
121121
}
122122
else
123123
{
@@ -137,7 +137,7 @@ namespace dialog ::editor
137137

138138
if (!(cb % 2)) // Set Unicode String
139139
{
140-
SetStringW(HEXED_UNICODE, std::wstring(reinterpret_cast<LPWSTR>(lpb), cb / sizeof(WCHAR)));
140+
SetStringW(HEXED_UNICODE, std::wstring(strings::LPCBYTEToLPCWSTR(lpb), cb / sizeof(WCHAR)));
141141
}
142142
else
143143
{

UI/Dialogs/Editors/StreamEditor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ namespace dialog::editor
460460
case EDITOR_RTF_UNICODE:
461461
case EDITOR_STREAM_UNICODE:
462462
SetStringW(
463-
m_iTextBox, std::wstring(reinterpret_cast<LPWSTR>(bin.data()), bin.size() / sizeof(WCHAR)));
463+
m_iTextBox, std::wstring(strings::LPCBYTEToLPCWSTR(bin.data()), bin.size() / sizeof(WCHAR)));
464464
if (lpBinPane) lpBinPane->SetCount(bin.size());
465465
break;
466466
}

UI/Dialogs/Editors/propeditor/PropertyEditor.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ namespace dialog::editor
245245

246246
if (m_lpsInputValue && PROP_TYPE(m_lpsInputValue->ulPropTag) == PT_BINARY)
247247
{
248-
const auto bin = mapi::getBin(m_lpsInputValue);
248+
const auto& bin = mapi::getBin(m_lpsInputValue);
249249
if (lpPane)
250250
{
251251
lpPane->SetCount(bin.cb);
@@ -419,7 +419,7 @@ namespace dialog::editor
419419
m_bin = strings::HexStringToBin(GetStringW(1));
420420
m_bin.push_back(0); // Add null terminator
421421
m_bin.push_back(0); // Add null terminator
422-
m_sOutputValue.Value.lpszW = reinterpret_cast<LPWSTR>(m_bin.data());
422+
m_sOutputValue.Value.lpszW = strings::LPCBYTEToLPWSTR(m_bin.data());
423423
break;
424424
case PT_SYSTIME:
425425
m_sOutputValue.Value.ft.dwLowDateTime = strings::wstringToUlong(GetStringW(0), 16);
@@ -627,7 +627,7 @@ namespace dialog::editor
627627
const auto bin = GetBinary(1);
628628
if (!(bin.size() % sizeof(WCHAR)))
629629
{
630-
SetStringW(0, std::wstring(reinterpret_cast<LPCWSTR>(bin.data()), bin.size() / sizeof(WCHAR)));
630+
SetStringW(0, std::wstring(strings::LPCBYTEToLPCWSTR(bin.data()), bin.size() / sizeof(WCHAR)));
631631
if (lpPane) lpPane->SetCount(bin.size() / sizeof(WCHAR));
632632
}
633633
else

UI/Dialogs/MFCUtilityFunctions.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ namespace dialog
702702
EC_H_CANCEL_S(lpMAPIFormMgr->SelectForm(
703703
reinterpret_cast<ULONG_PTR>(hWnd),
704704
0, // fMapiUnicode,
705-
LPCTSTR(szTitle.c_str()),
705+
strings::LPCSTRToLPTSTR(szTitle.c_str()),
706706
lpMAPIFolder,
707707
&lpMAPIFormInfo));
708708

UI/UIFunctions.cpp

+13-10
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ namespace ui
706706
const auto hfontOld = SelectObject(hdc, bBold ? GetSegoeFontBold() : GetSegoeFont());
707707
const auto crText = SetTextColor(hdc, color);
708708
SetBkMode(hdc, TRANSPARENT);
709-
auto drawRc = rc;
709+
RECT drawRc = rc;
710710
DrawTextW(hdc, lpchText.c_str(), -1, &drawRc, format);
711711

712712
#ifdef SKIPBUFFER
@@ -1318,7 +1318,7 @@ namespace ui
13181318
CDoubleBuffer db;
13191319
db.Begin(hdc, rc);
13201320

1321-
auto rcHeader = rc;
1321+
RECT rcHeader = rc;
13221322
FillRect(hdc, &rcHeader, GetSysBrush(uiColor::Background));
13231323

13241324
if (bSorted)
@@ -1416,14 +1416,16 @@ namespace ui
14161416
rcTracker.top += iHeaderHeight;
14171417
rcTracker.left = x - 1; // this lines us up under the splitter line we drew in the header
14181418
rcTracker.right = x;
1419-
MapWindowPoints(hWndHeader, hWndList, reinterpret_cast<LPPOINT>(&rcTracker), 2);
1420-
if (bRedraw)
1419+
if (::MapWindowPoints(hWndHeader, hWndList, reinterpret_cast<LPPOINT>(&rcTracker), 2) != 0)
14211420
{
1422-
InvalidateRect(hWndList, &rcTracker, true);
1423-
}
1424-
else
1425-
{
1426-
FillRect(hdc, &rcTracker, GetSysBrush(uiColor::FrameSelected));
1421+
if (bRedraw)
1422+
{
1423+
InvalidateRect(hWndList, &rcTracker, true);
1424+
}
1425+
else
1426+
{
1427+
FillRect(hdc, &rcTracker, GetSysBrush(uiColor::FrameSelected));
1428+
}
14271429
}
14281430

14291431
ReleaseDC(hWndList, hdc);
@@ -1933,7 +1935,8 @@ namespace ui
19331935
auto rcClient = RECT{};
19341936
GetWindowRect(hWnd, &rcWindow); // Get our non-client size
19351937
GetClientRect(hWnd, &rcClient); // Get our client size
1936-
MapWindowPoints(hWnd, nullptr, reinterpret_cast<LPPOINT>(&rcClient), 2); // locate our client rect on the screen
1938+
// locate our client rect on the screen
1939+
if (::MapWindowPoints(hWnd, nullptr, reinterpret_cast<LPPOINT>(&rcClient), 2) == 0) return;
19371940

19381941
// Before we fiddle with our client and window rects further, paint the menu
19391942
// This must be in window coordinates for WM_NCPAINT to work!!!

UI/ViewPane/TextPane.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ namespace viewpane
400400
reinterpret_cast<LPARAM>(buffer.data()));
401401
if (cchW != 0)
402402
{
403-
return std::wstring(reinterpret_cast<LPWSTR>(buffer.data()), cchText);
403+
return std::wstring(strings::LPCBYTEToLPCWSTR(buffer.data()), cchText);
404404
}
405405
else
406406
{
@@ -493,7 +493,7 @@ namespace viewpane
493493

494494
// Clear out CFE_AUTOCOLOR and CFE_AUTOBACKCOLOR so we can change color
495495
charformat.dwEffects = 0;
496-
for (const auto range : m_highlights)
496+
for (const auto& range : m_highlights)
497497
{
498498
if (static_cast<LONG>(range.start) == -1 || static_cast<LONG>(range.end) == -1) continue;
499499
auto charrange = CHARRANGE{static_cast<LONG>(range.start), static_cast<LONG>(range.end)};

core/mapi/mapiFunctions.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ namespace mapi
376376
lpPropArray->Value.lpszA = reinterpret_cast<LPSTR>(lpBuffer);
377377
break;
378378
case PT_UNICODE:
379-
lpPropArray->Value.lpszW = reinterpret_cast<LPWSTR>(lpBuffer);
379+
lpPropArray->Value.lpszW = strings::LPCBYTEToLPWSTR(lpBuffer);
380380
break;
381381
case PT_BINARY:
382382
mapi::setBin(lpPropArray) = {ulBufferSize, lpBuffer};
@@ -881,7 +881,7 @@ namespace mapi
881881
{
882882
if (lpRows->aRow[iArrayPos].lpProps[ulSrc].ulPropTag == PR_RULE_PROVIDER_DATA)
883883
{
884-
const auto bin = mapi::getBin(lpRows->aRow[iArrayPos].lpProps[ulSrc]);
884+
const auto& bin = mapi::getBin(lpRows->aRow[iArrayPos].lpProps[ulSrc]);
885885
if (!bin.cb || !bin.lpb)
886886
{
887887
// PR_RULE_PROVIDER_DATA was NULL - we don't want this
@@ -1230,7 +1230,7 @@ namespace mapi
12301230
EC_H_GETPROPS_S(lpChildFolder->GetProps(&tag, fMapiUnicode, &cProps, &lpProps));
12311231
if (lpProps && PT_ERROR != PROP_TYPE(lpProps[0].ulPropTag))
12321232
{
1233-
const auto bin = mapi::getBin(lpProps[0]);
1233+
const auto& bin = mapi::getBin(lpProps[0]);
12341234
lpParentFolder = CallOpenEntry<LPMAPIFOLDER>(
12351235
lpMDB,
12361236
nullptr,
@@ -1548,7 +1548,7 @@ namespace mapi
15481548
{
15491549
for (ULONG i = 0; i < pRows->cRows; i++)
15501550
{
1551-
const auto bin = mapi::getBin(pRows->aRow[i].lpProps[ePR_ENTRYID]);
1551+
const auto& bin = mapi::getBin(pRows->aRow[i].lpProps[ePR_ENTRYID]);
15521552
auto lpMessage = CallOpenEntry<LPMESSAGE>(
15531553
nullptr,
15541554
nullptr,
@@ -1860,7 +1860,7 @@ namespace mapi
18601860
for (ULONG iCurPropRow = 0; iCurPropRow < pRows->cRows; iCurPropRow++)
18611861
{
18621862
if (lpMessage) lpMessage->Release();
1863-
const auto bin = mapi::getBin(pRows->aRow[iCurPropRow].lpProps[eidPR_ENTRYID]);
1863+
const auto& bin = mapi::getBin(pRows->aRow[iCurPropRow].lpProps[eidPR_ENTRYID]);
18641864
lpMessage = CallOpenEntry<LPMESSAGE>(
18651865
lpMDB,
18661866
nullptr,
@@ -2074,7 +2074,7 @@ namespace mapi
20742074
if (!names.empty())
20752075
{
20762076
ULONG ulNumProps = 0; // count of props that match our guid
2077-
for (const auto name : names)
2077+
for (const auto& name : names)
20782078
{
20792079
if (cache::namedPropCacheEntry::valid(name) && name->getPropID() > 0x7FFF &&
20802080
::IsEqualGUID(*name->getMapiNameId()->lpguid, *lpPropSetGUID))
@@ -2088,7 +2088,7 @@ namespace mapi
20882088
{
20892089
lpFilteredProps->cValues = 0;
20902090

2091-
for (const auto name : names)
2091+
for (const auto& name : names)
20922092
{
20932093
if (cache::namedPropCacheEntry::valid(name) && name->getPropID() > 0x7FFF &&
20942094
::IsEqualGUID(*name->getMapiNameId()->lpguid, *lpPropSetGUID))
@@ -2231,7 +2231,7 @@ namespace mapi
22312231

22322232
if (pEmsmdbUID && pRow)
22332233
{
2234-
const auto bin = mapi::getBin(pRow->lpProps[eSectionUid]);
2234+
const auto& bin = mapi::getBin(pRow->lpProps[eSectionUid]);
22352235
if (PR_EMSMDB_SECTION_UID == pRow->lpProps[eSectionUid].ulPropTag &&
22362236
bin.cb == sizeof *pEmsmdbUID)
22372237
{

core/mapi/mapiProfileFunctions.cpp

+16-11
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace mapi::profile
4646
{
4747
if (bAddMark)
4848
{
49-
SPropValue PropVal;
49+
SPropValue PropVal{};
5050
PropVal.ulPropTag = PR_MARKER;
5151
PropVal.Value.lpszA = MARKER_STRING;
5252
EC_MAPI_S(lpSect->SetProps(1, &PropVal, nullptr));
@@ -200,7 +200,10 @@ namespace mapi::profile
200200
hRes = EC_H_MSG(
201201
IDS_CREATEMSGSERVICEFAILED,
202202
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));
204207
}
205208

206209
if (lpPropVals)
@@ -259,7 +262,7 @@ namespace mapi::profile
259262
return MAPI_E_INVALID_PARAMETER;
260263

261264
#define NUMEXCHANGEPROPS 2
262-
SPropValue PropVal[NUMEXCHANGEPROPS];
265+
SPropValue PropVal[NUMEXCHANGEPROPS]{};
263266
PropVal[0].ulPropTag = PR_PROFILE_UNRESOLVED_SERVER;
264267
auto lpszServerNameA = strings::wstringTostring(lpszServerName);
265268
PropVal[0].Value.lpszA = const_cast<LPSTR>(lpszServerNameA.c_str());
@@ -296,7 +299,7 @@ namespace mapi::profile
296299
auto lpszPasswordA = strings::wstringTostring(lpszPassword);
297300
if (bUnicodePST)
298301
{
299-
SPropValue PropVal[3];
302+
SPropValue PropVal[3]{};
300303
PropVal[0].ulPropTag = CHANGE_PROP_TYPE(PR_PST_PATH, PT_UNICODE);
301304
PropVal[0].Value.lpszW = const_cast<LPWSTR>(lpszPSTPath.c_str());
302305
PropVal[1].ulPropTag = PR_PST_CONFIG_FLAGS;
@@ -309,7 +312,7 @@ namespace mapi::profile
309312
}
310313
else
311314
{
312-
SPropValue PropVal[2];
315+
SPropValue PropVal[2]{};
313316
PropVal[0].ulPropTag = CHANGE_PROP_TYPE(PR_PST_PATH, PT_UNICODE);
314317
PropVal[0].Value.lpszW = const_cast<LPWSTR>(lpszPSTPath.c_str());
315318
PropVal[1].ulPropTag = PR_PST_PW_SZ_OLD;
@@ -337,7 +340,7 @@ namespace mapi::profile
337340

338341
// Create the profile
339342
hRes = WC_MAPI(lpProfAdmin->CreateProfile(
340-
LPTSTR(strings::wstringTostring(lpszProfileName).c_str()),
343+
strings::LPCSTRToLPTSTR(strings::wstringTostring(lpszProfileName).c_str()),
341344
nullptr,
342345
0,
343346
NULL)); // fMapiUnicode is not supported!
@@ -364,7 +367,8 @@ namespace mapi::profile
364367
auto hRes = EC_MAPI(MAPIAdminProfiles(0, &lpProfAdmin));
365368
if (!lpProfAdmin) return hRes;
366369

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));
368372

369373
lpProfAdmin->Release();
370374

@@ -385,7 +389,8 @@ namespace mapi::profile
385389
auto hRes = EC_MAPI(MAPIAdminProfiles(0, &lpProfAdmin));
386390
if (!lpProfAdmin) return hRes;
387391

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));
389394

390395
lpProfAdmin->Release();
391396

@@ -511,7 +516,7 @@ namespace mapi::profile
511516
PR_PROFILE_SERVER_FULL_VERSION == lpServerFullVersion->ulPropTag &&
512517
sizeof(EXCHANGE_STORE_VERSION_NUM) == mapi::getBin(lpServerFullVersion).cb)
513518
{
514-
const auto bin = mapi::getBin(lpServerFullVersion);
519+
const SBinary& bin = mapi::getBin(lpServerFullVersion);
515520
output::DebugPrint(output::dbgLevel::Generic, L"PR_PROFILE_SERVER_FULL_VERSION = ");
516521
output::outputBinary(output::dbgLevel::Generic, nullptr, bin);
517522
output::DebugPrint(output::dbgLevel::Generic, L"\n");
@@ -553,9 +558,9 @@ namespace mapi::profile
553558
if (!lpProfAdmin) return hRes;
554559

555560
hRes = EC_MAPI(lpProfAdmin->CopyProfile(
556-
LPTSTR(strings::wstringTostring(lpszOldProfileName).c_str()),
561+
strings::LPCSTRToLPTSTR(strings::wstringTostring(lpszOldProfileName).c_str()),
557562
nullptr,
558-
LPTSTR(strings::wstringTostring(lpszNewProfileName).c_str()),
563+
strings::LPCSTRToLPTSTR(strings::wstringTostring(lpszNewProfileName).c_str()),
559564
NULL,
560565
NULL));
561566

0 commit comments

Comments
 (0)