Author: cwittich Date: Sun Jan 19 19:49:12 2014 New Revision: 61712
URL: http://svn.reactos.org/svn/reactos?rev=61712&view=rev Log: [explorer_new] use strsafe functions
Modified: trunk/reactos/base/shell/explorer-new/explorer.c trunk/reactos/base/shell/explorer-new/precomp.h trunk/reactos/base/shell/explorer-new/traywnd.c
Modified: trunk/reactos/base/shell/explorer-new/explorer.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/exp... ============================================================================== --- trunk/reactos/base/shell/explorer-new/explorer.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/explorer.c [iso-8859-1] Sun Jan 19 19:49:12 2014 @@ -220,12 +220,14 @@ 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,
Modified: trunk/reactos/base/shell/explorer-new/precomp.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/pre... ============================================================================== --- trunk/reactos/base/shell/explorer-new/precomp.h [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/precomp.h [iso-8859-1] Sun Jan 19 19:49:12 2014 @@ -22,6 +22,7 @@ #include <shlwapi.h> #include <shlguid_undoc.h> #include <uxtheme.h> +#include <strsafe.h>
#include "tmschema.h" #include "resource.h"
Modified: trunk/reactos/base/shell/explorer-new/traywnd.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/tra... ============================================================================== --- trunk/reactos/base/shell/explorer-new/traywnd.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/traywnd.c [iso-8859-1] Sun Jan 19 19:49:12 2014 @@ -99,8 +99,13 @@ 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); }