E2033 Types of actual and formal var parameters must be identical



  • In Delphi XE2, the Compiler swears on functions WriteProcessMemory and ReadProcessMemorymaking a mistake

    error E2033: E2033 Types of actual and formal var parameters must be identical

    Delphi7 works great. Has anyone encountered it?



  • Comparison of methods in 2010 (7k) 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;

    I mean, all you need is to clearly indicate the type of data for variables transmitted as lpNumberOfBytesWrittenLike SIZE_T

    SIZE_TApparently, there was support for 64-bit systems.


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2