In Delphi XE2, the Compiler swears on the WriteProcessMemory and ReadProcessMemory , yielding an error
error E2033: E2033 Types
Everything works great in Delphi7. Has anyone come across?
In Delphi XE2, the Compiler swears on the WriteProcessMemory and ReadProcessMemory , yielding an error
error E2033: E2033 Types
Everything works great in Delphi7. Has anyone come across?
Compare the definition of methods in 2010 (there are no 7s at hand) and XE2:
//Delphi 2010 function ReadProcessMemory(hProcess: THandle; const lpBaseAddress: Pointer; lpBuffer: Pointer; nSize: DWORD; var lpNumberOfBytesRead: DWORD): BOOL; stdcall; function WriteProcessMemory(hProcess: THandle; const lpBaseAddress: Pointer; lpBuffer: Pointer; nSize: DWORD; var lpNumberOfBytesWritten: DWORD): BOOL; stdcall; //Delphi XE2 function ReadProcessMemory(hProcess: THandle; const lpBaseAddress: Pointer; lpBuffer: Pointer; nSize: SIZE_T; var lpNumberOfBytesRead: SIZE_T): BOOL; stdcall; function WriteProcessMemory(hProcess: THandle; const lpBaseAddress: Pointer; lpBuffer: Pointer; nSize: SIZE_T; var lpNumberOfBytesWritten: SIZE_T): BOOL; stdcall; Those. all you need to do is explicitly specify the data type for the variable passed as lpNumberOfBytesWritten , as SIZE_T .
SIZE_T , obviously, appeared with support for 64-bit systems.
Source: https://ru.stackoverflow.com/questions/75969/
All Articles