Jump to content

Search the Community

Showing results for tags 'ntsetinformationfile'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Looking for a way to pre-allocate space in your WinAPI created file, don't wanna write a bunch of zeros? SetFileInformationByHandle looks promising for Vista+ but I never did get it working I did however find 'NtSetInformationFile' - Available starting with Windows 2000 ;hfile - handle to file opened with $GENERIC_WRITE access ;$llAllocationBytes - 64 bit int size to allocate for file __WinAPI_SetFileAllocationInfo($hFile, $llAllocationBytes) Func __WinAPI_SetFileAllocationInfo($hFile, $llAllocationBytes) Local Const $eFileAllocationInformation = 0x13 Local $t_FILE_ALLOCATION_INFO = DllStructCreate("Align 8;INT64") DllStructSetData($t_FILE_ALLOCATION_INFO, 1, $llAllocationBytes) Local $iRet = DllCall("ntdll.dll", "int", "NtSetInformationFile", _ "handle", $hFile, _ "int64*", 0, _ "ptr", DllStructGetPtr($t_FILE_ALLOCATION_INFO), _ "ulong", DllStructGetSize($t_FILE_ALLOCATION_INFO), _ "int", $eFileAllocationInformation) If @error Then Return False Return $iRet[0] = 0 EndFunc ;==>__WinAPI_SetFileAllocationInfo In case you are wondering (wandering?) here is my failed Attempt to call SetFileInformationByHandle more info: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/ns-ntifs-_file_allocation_information
×
×
  • Create New...