Author: akhaldi
Date: Thu Jul 28 19:34:06 2016
New Revision: 72037
URL:
http://svn.reactos.org/svn/reactos?rev=72037&view=rev
Log:
[0.4.2] * Merge the shell fixes by Joachim and Christoph in revisions 72033 and 72034.
CORE-5272
Modified:
branches/ros-branch-0_4_2/reactos/ (props changed)
branches/ros-branch-0_4_2/reactos/dll/win32/shell32/CShellLink.cpp
Propchange: branches/ros-branch-0_4_2/reactos/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jul 28 19:34:06 2016
@@ -20,4 +20,4 @@
/branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859
/branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567
/branches/wlan-bringup:54809-54998
-/trunk/reactos:72020-72022,72026,72028
+/trunk/reactos:72020-72022,72026,72028,72033-72034
Modified: branches/ros-branch-0_4_2/reactos/dll/win32/shell32/CShellLink.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_2/reactos/dll/wi…
==============================================================================
--- branches/ros-branch-0_4_2/reactos/dll/win32/shell32/CShellLink.cpp [iso-8859-1]
(original)
+++ branches/ros-branch-0_4_2/reactos/dll/win32/shell32/CShellLink.cpp [iso-8859-1] Thu
Jul 28 19:34:06 2016
@@ -1332,12 +1332,18 @@
TRACE("(%p)->(desc=%s)\n", this, debugstr_w(pszName));
HeapFree(GetProcessHeap(), 0, sDescription);
- sDescription = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
- (wcslen(pszName) + 1) * sizeof(WCHAR));
- if (!sDescription)
- return E_OUTOFMEMORY;
-
- wcscpy(sDescription, pszName);
+ if (pszName)
+ {
+ sDescription = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
+ (wcslen(pszName) + 1) * sizeof(WCHAR));
+ if (!sDescription)
+ return E_OUTOFMEMORY;
+
+ wcscpy(sDescription, pszName);
+ }
+ else
+ sDescription = NULL;
+
bDirty = TRUE;
return S_OK;
@@ -1360,11 +1366,17 @@
TRACE("(%p)->(dir=%s)\n", this, debugstr_w(pszDir));
HeapFree(GetProcessHeap(), 0, sWorkDir);
- sWorkDir = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
- (wcslen(pszDir) + 1) * sizeof (WCHAR));
- if (!sWorkDir)
- return E_OUTOFMEMORY;
- wcscpy(sWorkDir, pszDir);
+ if (pszDir)
+ {
+ sWorkDir = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
+ (wcslen(pszDir) + 1) * sizeof (WCHAR));
+ if (!sWorkDir)
+ return E_OUTOFMEMORY;
+ wcscpy(sWorkDir, pszDir);
+ }
+ else
+ sWorkDir = NULL;
+
bDirty = TRUE;
return S_OK;
@@ -1387,12 +1399,18 @@
TRACE("(%p)->(args=%s)\n", this, debugstr_w(pszArgs));
HeapFree(GetProcessHeap(), 0, sArgs);
- sArgs = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
- (wcslen(pszArgs) + 1) * sizeof (WCHAR));
- if (!sArgs)
- return E_OUTOFMEMORY;
-
- wcscpy(sArgs, pszArgs);
+ if (pszArgs)
+ {
+ sArgs = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
+ (wcslen(pszArgs) + 1) * sizeof (WCHAR));
+ if (!sArgs)
+ return E_OUTOFMEMORY;
+
+ wcscpy(sArgs, pszArgs);
+ }
+ else
+ sArgs = NULL;
+
bDirty = TRUE;
return S_OK;
@@ -1473,11 +1491,16 @@
TRACE("(%p)->(path=%s iicon=%u)\n", this, debugstr_w(pszIconPath),
iIcon);
HeapFree(GetProcessHeap(), 0, sIcoPath);
- sIcoPath = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
- (wcslen(pszIconPath) + 1) * sizeof (WCHAR));
- if (!sIcoPath)
- return E_OUTOFMEMORY;
- wcscpy(sIcoPath, pszIconPath);
+ if (pszIconPath)
+ {
+ sIcoPath = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
+ (wcslen(pszIconPath) + 1) * sizeof (WCHAR));
+ if (!sIcoPath)
+ return E_OUTOFMEMORY;
+ wcscpy(sIcoPath, pszIconPath);
+ }
+ else
+ sIcoPath = NULL;
iIcoNdx = iIcon;
bDirty = TRUE;
@@ -1490,11 +1513,17 @@
TRACE("(%p)->(path=%s %x)\n", this, debugstr_w(pszPathRel),
dwReserved);
HeapFree(GetProcessHeap(), 0, sPathRel);
- sPathRel = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
- (wcslen(pszPathRel) + 1) * sizeof (WCHAR));
- if (!sPathRel)
- return E_OUTOFMEMORY;
- wcscpy(sPathRel, pszPathRel);
+ if (pszPathRel)
+ {
+ sPathRel = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
+ (wcslen(pszPathRel) + 1) * sizeof (WCHAR));
+ if (!sPathRel)
+ return E_OUTOFMEMORY;
+ wcscpy(sPathRel, pszPathRel);
+ }
+ else
+ sPathRel = NULL;
+
bDirty = TRUE;
return ShellLink_UpdatePath(sPathRel, sPath, sWorkDir, &sPath);