Results 1 to 7 of 7

Thread: tWin32_Find_Data in tWinStructs.pkg

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default tWin32_Find_Data in tWinStructs.pkg

    Hi,

    Seeing regular crashes on the 64 bit version of The Hammer4 and some times it is hard to track down why (I'm sure part of it is caused by me, myself and I)

    One of them however was on a FindFirstFile call and it took me a bit before I saw a possible candidate.

    In tWinStructs.pkg there's this bit of code:
    Code:
    Struct tWin32FindData
        DWord dwFileAttributes
        tWinFileTime ftCreationTime
        tWinFileTime ftLastAccessTime
        tWinFileTime ftLastWriteTime
        DWord nFileSizeHigh
        DWord nFileSizeLow
        DWord dwReserved0
        DWord dwReserved1
        Char[MAX_PATH] cFileName
        Char[MAX_ALTPATH] cAlternateFileName
    End_Struct
    Define tWin32_Find_Data for tWin32FindData
    
    // WChar version for interfacing Windows functions
    Struct tWin32FindDataW
        DWord dwFileAttributes
        tWinFileTime ftCreationTime
        tWinFileTime ftLastAccessTime
        tWinFileTime ftLastWriteTime
        DWord nFileSizeHigh
        DWord nFileSizeLow
        DWord dwReserved0
        DWord dwReserved1
        Short[MAX_PATH] cFileName              // WCHAR array using Short
        Short[MAX_ALTPATH] cAlternateFileName  // WCHAR array 
    End_Struct
    Why O why is there no 64 bit/Widechar version of
    Code:
    Define tWin32_Find_Data for tWin32FindData
    I now added this to The Hammer4 to fix the crash (I hope)
    Code:
    #IF (!@ < 200)
        tWIN32_FIND_DATA FindData
    #ELSE
        tWin32FindDataW  FindData
    #ENDIF
    (note that I wasn't using cFileName/cAlternateFilename from this FindFirstFile API call making it less obvious to track down)

    edit: That fix _and_ a fix of a structure used by the scintilla control where I had already added a new field apparently not yet available, appears to have fixed the weird instability issues I was seeing (pfew)
    --
    Wil
    Last edited by wila; 21-Feb-2020 at 01:54 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •