Custom Query

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (94 - 96 of 3882)

Ticket Resolution Summary Owner Reporter
#1690 No Bug GuiTreeView.au3, GuiListView.au3 and possibly others ASCII mode Bug Jon Authenticity
Description

I didn't have the time to check through all of the functions in these (or other) UDFs, but I'm quite sure there are more:

In _GUICtrlListView_InsertItem function:

If _WinAPI_InProcess($hWnd, $_lv_ghLastWnd) Or ($sText = -1) Then
   $iRet = _SendMessage($hWnd, $LVM_INSERTITEMW, 0, $pItem, 0, "wparam", "ptr")
Else ; not our control

should be:

If _WinAPI_InProcess($hWnd, $_lv_ghLastWnd) Or ($sText = -1) Then
   If $fUnicode Then
      $iRet = _SendMessage($hWnd, $LVM_INSERTITEMW, 0, $pItem, 0, "wparam", "ptr")
   Else
      $iRet = _SendMessage($hWnd, $LVM_INSERTITEMA, 0, $pItem, 0, "wparam", "ptr")
   EndIf
Else ; not our control

Other text related functions in GuiListView.au3 are probably coded the same.

In _GUICtrlTreeView_GetText function:

If _WinAPI_InProcess($hWnd, $__ghTVLastWnd) Then
   DllStructSetData($tTVITEM, "Text", $pBuffer)
   _SendMessage($hWnd, $TVM_GETITEMW, 0, $pItem, 0, "wparam", "ptr")
Else

should be:

If _WinAPI_InProcess($hWnd, $__ghTVLastWnd) Then
   DllStructSetData($tTVITEM, "Text", $pBuffer)
   If $fUnicode Then
      _SendMessage($hWnd, $TVM_GETITEMW, 0, $pItem, 0, "wparam", "ptr")
   Else
      _SendMessage($hWnd, $TVM_GETITEMA, 0, $pItem, 0, "wparam", "ptr")
   EndIf
Else
#3930 No Bug DllStructs created in one scope gets dropped if chained with a function that returns a re-structured-by-pointer version of it AutoXenon
Description

Original thread: https://www.autoitscript.com/forum/topic/209074-dllstructs-created-in-one-scope-gets-dropped-if-chained-with-a-function-that-returns-a-re-structured-by-pointer-version-of-it

GUICreate('')
Local $unreliable_data, $reliable_data, $intermediate_ref, $labelunreliable = GUICtrlCreateLabel('',0,0,400,25), $labelreliable = GUICtrlCreateLabel('',0,30,400,25)
GUISetState()
HotKeySet('{esc}',quit)
While True
      $unreliable_data = parseStruct(createStruct())  ; struct technically goes out of scope, this saves a "slave struct" but the master struct gets dropped when it goes out of parseStruct's scope
      $intermediate_ref = createStruct()              ; struct scope gets transferred, this is a "master struct"
      $reliable_data = parseStruct($intermediate_ref) ; a "slave struct" of a master struct that is scoped here
      Sleep(100)                                      ; wait some time for garbage to get written into the freed memory 
      GUICtrlSetData($labelunreliable,DllStructGetData($unreliable_data,'msg'))
      GUICtrlSetData($labelreliable,DllStructGetData($reliable_data,'msg'))
WEnd


Func createStruct()
     Local $struct = DllStructCreate('char[16]')
     DllStructSetData($struct,1,'hello world')
     Return $struct
EndFunc

Func parseStruct($struct)
     Return DllStructCreate('char msg[16]',DllStructGetPtr($struct))
EndFunc

Func quit()
     Exit
EndFunc

The question is, should create-by-pointer structs count as valid references? I can imagine that if it is change to be so, it might cause headaches with ad-hoc throwaway "lens" structs unintentionally preventing the memory from being freed if the programmer is expecting it to not count as valid references. I guess it's up to you to decide on which tradeoff to pick.

#3237 Fixed _EventLog__Read has an error in the __EventLog_DecodeDesc Function, Insertions replace unintended variables after %1- %9 Jon BILGUS
Description

EventLog_DecodeDesc uses string replace on Insertion place holders returned from _WinAPI_FormatMessage ex. %1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12 However every instance is replaced therefore The data in %1 is also replaced in %10, %11, %12, %13 etc the data in %2 is replaced in %20 %21 etc.

For instance if %1 contains Foo %10 becomes Foo0 %11 becomes Foo1 %12 becomes Foo2

The fix is to change $sDesc = StringReplace($sDesc, "%" & $iI, $aStrings[$iI]) to $sDesc = StringReplace($sDesc, "%" & $iI, $aStrings[$iI],1)

Func EventLog_DecodeDesc($tEventLog)

Local $aStrings = EventLog_DecodeStrings($tEventLog) Local $sSource = EventLog_DecodeSource($tEventLog) Local $iEventID = DllStructGetData($tEventLog, "EventID") Local $sKey = "HKLM\SYSTEM\CurrentControlSet\Services\Eventlog\" & $g_sSourceName_Event & "\" & $sSource

Local $aMsgDLL = StringSplit(_WinAPI_ExpandEnvironmentStrings(RegRead($sKey, "EventMessageFile")), ";")

Local $iFlags = BitOR($EVENTLOG_FORMAT_MESSAGE_FROM_HMODULE, $EVENTLOG_FORMAT_MESSAGE_IGNORE_INSERTS) Local $sDesc = "" For $iI = 1 To $aMsgDLL[0]

Local $hDLL = _WinAPI_LoadLibraryEx($aMsgDLL[$iI], $EVENTLOG_LOAD_LIBRARY_AS_DATAFILE) If $hDLL = 0 Then ContinueLoop Local $tBuffer = DllStructCreate("wchar Text[4096]") _WinAPI_FormatMessage($iFlags, $hDLL, $iEventID, 0, $tBuffer, 4096, 0) _WinAPI_FreeLibrary($hDLL) $sDesc &= DllStructGetData($tBuffer, "Text")

Next

If $sDesc = "" Then

For $iI = 1 To $aStrings[0]

$sDesc &= $aStrings[$iI]

Next

Else

For $iI = 1 To $aStrings[0]

$sDesc = StringReplace($sDesc, "%" & $iI, $aStrings[$iI],1);<<<<<<<<<HERE Added as 1st occurrence Bilgus 5-20-2016

Next

EndIf

Return StringStripWS($sDesc, $STR_STRIPLEADING + $STR_STRIPTRAILING)

EndFunc ;==>EventLog_DecodeDesc

Note: See TracQuery for help on using queries.