[GDI32] sync GetICMProfileA to wine
authorChristoph von Wittich <christoph_vw@reactos.org>
Mon, 15 Aug 2016 17:04:05 +0000 (17:04 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Mon, 15 Aug 2016 17:04:05 +0000 (17:04 +0000)
svn path=/trunk/; revision=72230

reactos/win32ss/gdi/gdi32/objects/icm.c

index e6c2fbd..520463a 100644 (file)
@@ -144,11 +144,18 @@ GetICMProfileA(
     DWORD buflen = MAX_PATH;
     BOOL ret = FALSE;
 
-    if (!hdc || !pBufSize || !pszFilename) return FALSE;
+    if (!hdc || !pBufSize) return FALSE;
 
     if (GetICMProfileW(hdc, &buflen, filenameW))
     {
         ULONG len = WideCharToMultiByte(CP_ACP, 0, filenameW, -1, NULL, 0, NULL, NULL);
+
+        if (!pszFilename)
+        {
+            *pBufSize = len;
+            return FALSE;
+        }
+
         if (*pBufSize >= len)
         {
             WideCharToMultiByte(CP_ACP, 0, filenameW, -1, pszFilename, *pBufSize, NULL, NULL);