Skip to content
Permalink
Browse files

Fix startup crash caused by August Win 10 update

Grrrrr Microsoft!

The August Win 10 cumulutive security update contains a serious regression that breaks the oleaut32 system library:

https://docs.microsoft.com/en-us/windows/release-information/status-windows-10-1903#629msgdesc

https://answers.microsoft.com/en-us/msoffice/forum/all/windows-update-2019-08-cumulative-update-has/baeea089-9bba-4a2a-9660-0a220f1656e9?auth=1&page=1

PhotoDemon uses this library.  This is a problem with Microsoft, not me (or the dozens of other developers who have reported this issue) so I don't have an ETA.

In the meantime, I can at least coax PhotoDemon into starting by manually working around the bug in critical codepaths.  I do not have the time to investigate every conceivable place where this issue could bite, but this quick-fix should at least make nightly builds usable again.
  • Loading branch information...
tannerhelland committed Aug 16, 2019
1 parent c8926cc commit 754fc156378ad7fde2d09f62643498ff023a5f90
Showing with 26 additions and 6 deletions.
  1. +8 −3 Modules/Plugin_Cairo.bas
  2. +6 −1 Modules/Plugin_libdeflate.bas
  3. +6 −1 Modules/Plugin_lz4.bas
  4. +6 −1 Modules/Plugin_zstd.bas
@@ -384,8 +384,8 @@ Public Function Pattern_CreateLinearGradient(ByVal x0 As Double, ByVal y0 As Dou
Pattern_CreateLinearGradient = CallCDeclW(cairo_pattern_create_linear, vbLong, x0, y0, x1, y1)
End Function

Public Function Pattern_CreateRadialGradient(ByVal cx0 As Double, ByVal cy0 As Double, ByVal radius0 As Double, ByVal cx1 As Double, ByVal cy1 As Double, ByVal radius1 As Double) As Long
Pattern_CreateRadialGradient = CallCDeclW(cairo_pattern_create_radial, vbLong, cx0, cy0, radius0, cx1, cy1, radius1)
Public Function Pattern_CreateRadialGradient(ByVal cx0 As Double, ByVal cy0 As Double, ByVal radius0 As Double, ByVal cX1 As Double, ByVal cY1 As Double, ByVal radius1 As Double) As Long
Pattern_CreateRadialGradient = CallCDeclW(cairo_pattern_create_radial, vbLong, cx0, cy0, radius0, cX1, cY1, radius1)
End Function

'Return a pattern handle to a cairo surface; this pattern can subsequently be used for painting,
@@ -467,7 +467,12 @@ Private Function CallCDeclW(ByVal lProc As Cairo_ProcAddress, ByVal fRetType As
Dim numParams As Long
If (UBound(pa) < LBound(pa)) Then numParams = 0 Else numParams = UBound(pa) + 1

vTemp = pa 'make a copy of the params, to prevent problems with VT_Byref-Members in the ParamArray
If IsMissing(pa) Then
ReDim vTemp(0) As Variant
Else
vTemp = pa 'make a copy of the params, to prevent problems with VT_Byref-Members in the ParamArray
End If

For i = 0 To numParams - 1
If VarType(pa(i)) = vbString Then vTemp(i) = StrPtr(pa(i))
m_vType(i) = VarType(vTemp(i))
@@ -408,7 +408,12 @@ Private Function CallCDeclW(ByVal lProc As LD_ProcAddress, ByVal fRetType As VbV
Dim numParams As Long
If (UBound(pa) < LBound(pa)) Then numParams = 0 Else numParams = UBound(pa) + 1

vTemp = pa 'make a copy of the params, to prevent problems with VT_Byref-Members in the ParamArray
If IsMissing(pa) Then
ReDim vTemp(0) As Variant
Else
vTemp = pa 'make a copy of the params, to prevent problems with VT_Byref-Members in the ParamArray
End If

For i = 0 To numParams - 1
If VarType(pa(i)) = vbString Then vTemp(i) = StrPtr(pa(i))
m_vType(i) = VarType(vTemp(i))
@@ -304,7 +304,12 @@ Private Function CallCDeclW(ByVal lProc As LZ4_ProcAddress, ByVal fRetType As Vb
Dim numParams As Long
If (UBound(pa) < LBound(pa)) Then numParams = 0 Else numParams = UBound(pa) + 1

vTemp = pa 'make a copy of the params, to prevent problems with VT_Byref-Members in the ParamArray
If IsMissing(pa) Then
ReDim vTemp(0) As Variant
Else
vTemp = pa 'make a copy of the params, to prevent problems with VT_Byref-Members in the ParamArray
End If

For i = 0 To numParams - 1
If VarType(pa(i)) = vbString Then vTemp(i) = StrPtr(pa(i))
m_vType(i) = VarType(vTemp(i))
@@ -333,7 +333,12 @@ Private Function CallCDeclW(ByVal lProc As Zstd_ProcAddress, ByVal fRetType As V
Dim numParams As Long
If (UBound(pa) < LBound(pa)) Then numParams = 0 Else numParams = UBound(pa) + 1

vTemp = pa 'make a copy of the params, to prevent problems with VT_Byref-Members in the ParamArray
If IsMissing(pa) Then
ReDim vTemp(0) As Variant
Else
vTemp = pa 'make a copy of the params, to prevent problems with VT_Byref-Members in the ParamArray
End If

For i = 0 To numParams - 1
If VarType(pa(i)) = vbString Then vTemp(i) = StrPtr(pa(i))
m_vType(i) = VarType(vTemp(i))

0 comments on commit 754fc15

Please sign in to comment.
You can’t perform that action at this time.