Author: tfaber
Date: Thu Oct 27 10:21:13 2016
New Revision: 73050
URL:
http://svn.reactos.org/svn/reactos?rev=73050&view=rev
Log:
[PROGMAN]
- Fix MSVC warnings
- Use strsafe printf
Modified:
trunk/reactos/base/shell/progman/dialog.c
trunk/reactos/base/shell/progman/group.c
trunk/reactos/base/shell/progman/main.c
trunk/reactos/base/shell/progman/progman.h
Modified: trunk/reactos/base/shell/progman/dialog.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/progman/dialog.…
==============================================================================
--- trunk/reactos/base/shell/progman/dialog.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/progman/dialog.c [iso-8859-1] Thu Oct 27 10:21:13 2016
@@ -32,7 +32,6 @@
*/
#include "progman.h"
-#include <strsafe.h>
#include <commdlg.h>
@@ -514,7 +513,7 @@
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);
Modified: trunk/reactos/base/shell/progman/group.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/progman/group.c…
==============================================================================
--- trunk/reactos/base/shell/progman/group.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/progman/group.c [iso-8859-1] Thu Oct 27 10:21:13 2016
@@ -463,7 +463,7 @@
&WndPl.rcNormalPosition.top,
&WndPl.rcNormalPosition.right,
&WndPl.rcNormalPosition.bottom,
- &WndPl.ptMinPosition,
+ &WndPl.ptMinPosition.x,
&WndPl.ptMinPosition.y,
&WndPl.showCmd,
&skip) == 7)
Modified: trunk/reactos/base/shell/progman/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/progman/main.c?…
==============================================================================
--- trunk/reactos/base/shell/progman/main.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/progman/main.c [iso-8859-1] Thu Oct 27 10:21:13 2016
@@ -306,7 +306,7 @@
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 @@
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);
Modified: trunk/reactos/base/shell/progman/progman.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/progman/progman…
==============================================================================
--- trunk/reactos/base/shell/progman/progman.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/progman/progman.h [iso-8859-1] Thu Oct 27 10:21:13 2016
@@ -48,6 +48,7 @@
#include <richedit.h>
#include <windowsx.h>
+#include <strsafe.h>
#define MAX_STRING_LEN 255
#define MAX_PATHNAME_LEN 1024