; _APIFileOpen( ) ; ; Returns a "REAL" file handle for reading and writing. ; The return value comes directly from "CreateFile" api. Func _APIFileOpen( $szFile ) Local $GENERIC_READ = 0x80000000, $GENERIC_WRITE = 0x40000000 Local $OPEN_ALWAYS = 4, $FILE_ATTRIBUTE_NORMAL = 0x00000080 Local $AFO_h $AFO_h = DllCall( "kernel32.dll", "hwnd", "CreateFile", _ "str", $szFile, _ "long", BitOR($GENERIC_READ,$GENERIC_WRITE), _ "long", 0, _ "ptr", 0, _ "long", $OPEN_ALWAYS, _ "long", $FILE_ATTRIBUTE_NORMAL, _ "long", 0 ) Return $AFO_h[0] EndFunc ; _APIFileClose( ) ; ; The return value comes directly from "CloseHandle" api. Func _APIFileClose( $hFile ) Local $AFC_r $AFC_r = DllCall( "kernel32.dll", "int", "CloseHandle", _ "hwnd", $hFile ) Return $AFC_r[0] EndFunc ; _APIFileSetPos( , ) ; ; The return value comes directly from "SetFilePointer" api. Func _APIFileSetPos( $hFile, $nPos ) Local $FILE_BEGIN = 0 Local $AFSP_r $AFSP_r = DllCall( "kernel32.dll", "long", "SetFilePointer", _ "hwnd",$hFile, _ "long",$nPos, _ "long_ptr",0, _ "long",$FILE_BEGIN ) Return $AFSP_r[0] EndFunc ; _APIFileRead( , ,