Do not forget to allocate internal OPENFILENAMEW structure for 16-bit
GetOpenFileName, initialize it by zeros for 16/A cases.
This commit is contained in:
parent
c7e88e0820
commit
781b451a70
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue