[PROGMAN]

- Fix MSVC warnings
- Use strsafe printf

svn path=/trunk/; revision=73050
This commit is contained in:
Thomas Faber 2016-10-27 10:21:13 +00:00
parent 3d8a01fc0d
commit f642128e8f
4 changed files with 11 additions and 10 deletions

View file

@ -32,7 +32,6 @@
*/
#include "progman.h"
#include <strsafe.h>
#include <commdlg.h>
@ -514,7 +513,7 @@ EnumPickIconResourceProc(HMODULE hModule, LPCWSTR lpszType, LPWSTR lpszName, LON
WCHAR szName[100];
if (IS_INTRESOURCE(lpszName))
swprintf(szName, L"%u", lpszName);
StringCbPrintfW(szName, sizeof(szName), L"%u", (unsigned)(UINT_PTR)lpszName);
else
StringCbCopyW(szName, sizeof(szName), lpszName);

View file

@ -463,7 +463,7 @@ GROUP_AddGroup(GROUPFORMAT format, BOOL bIsCommonGroup, LPCWSTR lpszName, LPCWST
&WndPl.rcNormalPosition.top,
&WndPl.rcNormalPosition.right,
&WndPl.rcNormalPosition.bottom,
&WndPl.ptMinPosition,
&WndPl.ptMinPosition.x,
&WndPl.ptMinPosition.y,
&WndPl.showCmd,
&skip) == 7)

View file

@ -306,7 +306,7 @@ MAIN_SetMainWindowTitle(VOID)
caption = Alloc(HEAP_ZERO_MEMORY, size);
if (caption)
{
swprintf(caption, L"%s - %s\\%s", szTitle, lpDomainName, lpUserName);
StringCbPrintfW(caption, size, L"%s - %s\\%s", szTitle, lpDomainName, lpUserName);
SetWindowTextW(Globals.hMainWnd, caption);
Free(caption);
}
@ -582,12 +582,13 @@ MAIN_SaveSettings(VOID)
WndPl.length = sizeof(WndPl);
GetWindowPlacement(Globals.hMainWnd, &WndPl);
swprintf(buffer, L"%d %d %d %d %d",
WndPl.rcNormalPosition.left,
WndPl.rcNormalPosition.top,
WndPl.rcNormalPosition.right,
WndPl.rcNormalPosition.bottom,
WndPl.showCmd);
StringCbPrintfW(buffer, sizeof(buffer),
L"%d %d %d %d %d",
WndPl.rcNormalPosition.left,
WndPl.rcNormalPosition.top,
WndPl.rcNormalPosition.right,
WndPl.rcNormalPosition.bottom,
WndPl.showCmd);
dwSize = wcslen(buffer) * sizeof(WCHAR);
RegSetValueExW(Globals.hKeyPMSettings, L"Window", 0, REG_SZ, (LPBYTE)buffer, dwSize);

View file

@ -48,6 +48,7 @@
#include <richedit.h>
#include <windowsx.h>
#include <strsafe.h>
#define MAX_STRING_LEN 255
#define MAX_PATHNAME_LEN 1024