Hi,
Hmm ich hab die Funktion mal minimal verändert und das hat bereits zu Fehlern bzw. Hardcrash's geführt.
Spoiler anzeigen
Func _LZNTCompress($vInput, $iCompressionFormatAndEngine = 2)
[/autoit] [autoit][/autoit] [autoit]If Not ($iCompressionFormatAndEngine = 258) Then
$iCompressionFormatAndEngine = 2
EndIf
Local $bBinary = Binary($vInput)
[/autoit] [autoit][/autoit] [autoit]Local Static $tInput = DllStructCreate("byte[" & $iWidth * $iHeight & "]")
DllStructSetData($tInput, 1, $bBinary)
Local $a_Call = DllCall("ntdll.dll", "int", "RtlGetCompressionWorkSpaceSize", _
"ushort", $iCompressionFormatAndEngine, _
"dword*", 0, _
"dword*", 0)
If @error Or $a_Call[0] Then
Return SetError(1, 0, "") ; error determining workspace buffer size
EndIf
Local Static $tWorkSpace = DllStructCreate("byte[" & $a_Call[2] & "]") ; workspace is needed for compression
Local $tBuffer = DllStructCreate("byte[" & 16 * DllStructGetSize($tInput) & "]") ; initially oversizing buffer
Local $a_Call = DllCall("ntdll.dll", "int", "RtlCompressBuffer", _
"ushort", $iCompressionFormatAndEngine, _
"ptr", DllStructGetPtr($tInput), _
"dword", DllStructGetSize($tInput), _
"ptr", DllStructGetPtr($tBuffer), _
"dword", DllStructGetSize($tBuffer), _
"dword", 4096, _
"dword*", 0, _
"ptr", DllStructGetPtr($tWorkSpace))
If @error Or $a_Call[0] Then
Return SetError(2, 0, "") ; error compressing
EndIf
Local $tOutput = DllStructCreate("byte[" & $a_Call[7] & "]", DllStructGetPtr($tBuffer))
[/autoit] [autoit][/autoit] [autoit]Return SetError(0, 0, DllStructGetData($tOutput, 1))
EndFunc ;==>_LZNTCompress
Was ich mitbekommen hab ist das Workspace immer gleich bleibt und daher Static bleiben kann. Jedoch ändern sich alle anderen Werte...
//Edit: Das problem mit dem Hardcrash des Clients besteht immernoch... Ich hatte bereits versucht beim Server immer die DC des Desktops bzw. des Fensters, das gerade im Vollbildmodus ist, zu nehmen aber es ist immer das gleiche.