[PATCH 4/5] winspool.drv: Fix AddPrinterDriverA so that the strings actually get written.

Detlef Riekenberg wine.dev at web.de
Tue Nov 7 10:35:25 CST 2006


On Di, 2006-11-07 at 14:37 +0000, Huw Davies wrote:
>      RegSetValueExA(hkeyName, "Dependent Files", 0, REG_MULTI_SZ,
> +                  (LPBYTE) di3.pDependentFiles,
> lstrlenA(di3.pDependentFiles) + 1); 

Hi Huw.
Thanks for working on winspool.drv again, but:
"lstrlenA(di3.pDependentFiles) + 1" is not correct for REG_MULTI_SZ

I suggest:

LPSTR ptr;
DWORD total;

....

total = 0;
ptr = di3.pDependentFiles;
if (ptr) {
  while (ptr[0]) {
    len = lstrlenA(ptr) + 1;  /* actual string */
    total += len;
    ptr += len;
  }
  total++; /* extra '\0' for REG_MULTI_SZ - termination */
}



-- 
 
By by ... Detlef





More information about the wine-patches mailing list