[explorer_new]

use strsafe functions

svn path=/trunk/; revision=61712
This commit is contained in:
Christoph von Wittich 2014-01-19 19:49:12 +00:00
parent d0a842e852
commit 93b5f39fd8
3 changed files with 15 additions and 7 deletions

View file

@ -220,12 +220,14 @@ GetExplorerRegValueSet(IN HKEY hKey,
DWORD dwType, dwSize;
BOOL Ret = FALSE;
_tcscpy(szBuffer,
StringCbCopy(szBuffer, sizeof(szBuffer),
TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer"));
_tcscat(szBuffer,
_T("\\"));
_tcscat(szBuffer,
lpSubKey);
if (FAILED(StringCbCat(szBuffer, sizeof(szBuffer),
_T("\\"))))
return FALSE;
if (FAILED(StringCbCat(szBuffer, sizeof(szBuffer),
lpSubKey)))
return FALSE;
dwSize = sizeof(szBuffer);
if (RegOpenKeyEx(hKey,

View file

@ -22,6 +22,7 @@
#include <shlwapi.h>
#include <shlguid_undoc.h>
#include <uxtheme.h>
#include <strsafe.h>
#include "tmschema.h"
#include "resource.h"

View file

@ -99,8 +99,13 @@ typedef struct
BOOL LaunchCPanel(HWND hwnd, LPCTSTR applet)
{
TCHAR szParams[MAX_PATH];
_tcscpy(szParams, TEXT("shell32.dll,Control_RunDLL "));
_tcscat(szParams, applet);
StringCbCopy(szParams, sizeof(szParams),
TEXT("shell32.dll,Control_RunDLL "));
if (FAILED(StringCbCat(szParams, sizeof(szParams),
applet)))
return FALSE;
return (ShellExecute(hwnd, TEXT("open"), TEXT("rundll32.exe"), szParams, NULL, SW_SHOWDEFAULT) > (HINSTANCE)32);
}