Commit 781b451a authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

Do not forget to allocate internal OPENFILENAMEW structure for 16-bit

GetOpenFileName, initialize it by zeros for 16/A cases.
parent c7e88e08
......@@ -3456,7 +3456,7 @@ static BOOL CALLBACK FD32_Init(LPARAM lParam, PFD31_DATA lfs, DWORD data)
if (priv->ofnA->Flags & OFN_ENABLEHOOK)
if (priv->ofnA->lpfnHook)
lfs->hook = TRUE;
lfs->ofnW = HeapAlloc(GetProcessHeap(), 0, sizeof(*lfs->ofnW));
lfs->ofnW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*lfs->ofnW));
FD31_MapOfnStructA(priv->ofnA, lfs->ofnW, lfs->open);
}
......
......@@ -170,6 +170,7 @@ static BOOL CALLBACK FD16_Init(LPARAM lParam, PFD31_DATA lfs, DWORD data)
if (priv->ofn16->lpfnHook)
lfs->hook = TRUE;
lfs->ofnW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*lfs->ofnW));
FD16_MapOfnStruct16(priv->ofn16, lfs->ofnW, lfs->open);
if (! FD16_GetTemplate(lfs)) return FALSE;
......@@ -280,6 +281,7 @@ static void CALLBACK FD16_Destroy(PFD31_DATA lfs)
GlobalFree16(priv->hGlobal16);
}
FD31_FreeOfnW(lfs->ofnW);
HeapFree(GetProcessHeap(), 0, lfs->ofnW);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment