winspool: Powerpoint XP expect a vailid PTR on win9x

Detlef Riekenberg wine.dev at web.de
Fri Aug 24 13:14:35 CDT 2007


Powerpoint XP expect, that di.pDependentFiles is never NULL on win9x
(w2k and current wine return NULL, when the Value in the Registry is
empty or not present)

Thanks Huw for finding that issue with Powerpoint.


Changelog:
winspool: Powerpoint XP expect a vailid PTR on win9x



-- 
 
By by ... Detlef

-------------- next part --------------
>From 0d6adaa416960d1193bf7536815e61c49cdecf8d Mon Sep 17 00:00:00 2001
From: Detlef Riekenberg <wine.dev at web.de>
Date: Fri, 24 Aug 2007 20:05:57 +0200
Subject: [PATCH] winspool: Powerpoint XP expect a vailid PTR on win9x
---
 dlls/winspool.drv/info.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c
index ce5323b..f6b9612 100644
--- a/dlls/winspool.drv/info.c
+++ b/dlls/winspool.drv/info.c
@@ -4591,6 +4591,15 @@ static BOOL WINSPOOL_GetDriverInfoFromRe
         if (di) di->pDependentFiles = (LPWSTR)strPtr;
         strPtr = (pDriverStrings) ? pDriverStrings + (*pcbNeeded) : NULL;
     }
+    else if (GetVersion() & 0x80000000) {
+        /* Powerpoint XP expect on win9x, that pDependentFiles is always valid! */
+        size = 2 * ((unicode) ? sizeof(WCHAR) : 1);
+        *pcbNeeded += size;
+        if ((*pcbNeeded <= cbBuf) && strPtr) ZeroMemory(strPtr, size);
+
+        if (di) di->pDependentFiles = (LPWSTR)strPtr;
+        strPtr = (pDriverStrings) ? pDriverStrings + (*pcbNeeded) : NULL;
+    }
 
     /* .pMonitorName is the optional Language Monitor */
     if (WINSPOOL_GetStringFromReg(hkeyDriver, MonitorW, strPtr, 0, &size, unicode)) {
-- 
1.4.1



More information about the wine-patches mailing list