Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Nasty Directory Delete Function
#5
(09-15-2022, 02:06 AM)eoredson Wrote: " I haven't checked but does this work in 64 bit or is this code 32 bit only as it currently stands? If it is 32 bit only then you'll need to adjust your TYPE definitions so it will work in 64."

Could you be more specific when you meant to adjust your TYPE?

Erik.
On 64-bit, some the fields which are "_UNSIGNED LONG" (32-bit) might have to be changed to "_UNSIGNED _INTEGER64". That is to match the function parameters of type "_OFFSET" which are going to be 64-bit pointers. Like I've noticed from part of the code below.

Code: (Select All)
TYPE WIN32_FIND_DATAA
    dwFileAttributes AS _UNSIGNED LONG
    ftCreationTime AS FILETIME
    ftLastAccessTime AS FILETIME
    ftLastWriteTime AS FILETIME
    nFileSizeHigh AS _UNSIGNED LONG
    nFileSizeLow AS _UNSIGNED LONG
    dwReserved0 AS _UNSIGNED LONG
    dwReserved1 AS _UNSIGNED LONG
    cFileName AS STRING * MAX_PATH
    cAlternateFileName AS STRING * 14
END TYPE

' declare external libraries.
DECLARE DYNAMIC LIBRARY "kernel32"
    FUNCTION DeleteFileA% (F$)
    FUNCTION FindFirstFileA~%& (BYVAL lpFileName~%&, BYVAL lpFindFileData~%&)
    FUNCTION FindNextFileA& (BYVAL hFindFile~%&, BYVAL lpFindFileData~%&)
    FUNCTION FindClose& (BYVAL hFindFile~%&)
    FUNCTION RemoveDirectoryA% (F$)
END DECLARE
Reply


Messages In This Thread
Nasty Directory Delete Function - by eoredson - 09-14-2022, 05:51 AM
RE: Nasty Directory Delete Function - by eoredson - 09-15-2022, 02:06 AM
RE: Nasty Directory Delete Function - by mnrvovrfc - 09-15-2022, 02:39 AM
RE: Nasty Directory Delete Function - by eoredson - 09-15-2022, 03:45 AM



Users browsing this thread: 2 Guest(s)