Jump to content

pass __int64 to SetFilePointer


 Share

Recommended Posts

Hi:

I want porting VC++ source code to Autoit,

How can set __int64 to function SetFilePointer in Autoit ??

//////////////////Autoit////////////////////////////////////

Func Read($TestDecive,$LBAPos,$Readlength)

local $Result = _WinAPI_SetFilePointer($TestDecive, $LBAPos*512,0)

EndFunc

//////////////////Autoit////////////////////////////////////

//////////////////VC++////////////////////////////////////

BOOL Read(HANDLE dev,DWORD Sector_Start,int Sector_num)

{

BOOL flag;

DWORD Program_len;

__int64 distance = Sector_Start*0x200;

LARGE_INTEGER li;

li.QuadPart = distance;

li.LowPart = SetFilePointer (dev, li.LowPart, &li.HighPart, FILE_BEGIN);

if (li.LowPart == 0xFFFFFFFF && GetLastError() != NO_ERROR)

{

li.QuadPart = -1;

return false;

}

flag = ReadFile(dev,Buffer,Sector_num*0x200,&Program_len,NULL);

return flag;

}

//////////////////VC++////////////////////////////////////

Thanks for your answering !! :blink:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...