Skip to content

[Error] WatchDirectory.ahk  #4

@superuser7777

Description

@superuser7777

This is exactly the function I was looking for. Thank you for your wonderful work.

I got an error when running with the latest version of AHK.
Do you know the cause?
+Start OK
+An error occurs when a change is detected

Win10 Pro : latest
AHK : AutoHotkey v1.1.34.03 U64

---------------------------
Critical Error:  Invalid memory read/write.

	Line#
	047: Return
	048: r += 1
	049: CurrentFolder := Dir%r%Path
	050: PointerFNI := &Dir%r%FNI
	051: DllCall( "GetOverlappedResult", UInt, hDir, UInt, &Dir%r%Overlapped, UIntP, nReadLen, Int, true )  
	052: Loop
	052: {
--->	053: pNext := NumGet( PointerFNI + 0  )
	054: Action := NumGet( PointerFNI + 4  )
	055: FileNameLen := NumGet( PointerFNI + 8  )
	056: pFileName := ( PointerFNI + 12 )
	057: if (Action < 0x6)  
	057: {
	058: VarSetCapacity( FileNameANSI, FileNameLen )  
	059: DllCall( "WideCharToMultiByte",UInt,0,UInt,0,UInt,pFileName,UInt,FileNameLen,Str,FileNameANSI,UInt,FileNameLen,UInt,0,UInt,0)  

The program is now unstable and will exit.
---------------------------
OK   
---------------------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions