1. Winthor Caingles
  2. PowerBuilder
  3. Tuesday, 5 September 2023 08:46 AM UTC

Good day,

 

Hope you can help me on this matter.

 

I am using copymemory and it is working fine in 32bit.. however, I cannot used it in 64bit... any suggestions? 

 

thanks in advance.

René Ullrich Accepted Answer Pending Moderation
  1. Tuesday, 5 September 2023 08:54 AM UTC
  2. PowerBuilder
  3. # 1

How is your declaration? Do you use Longptr variable instead of long or ulong?

How do you use it?

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 5 September 2023 14:49 PM UTC
  2. PowerBuilder
  3. # 2

Hi Winthor;

 FYI: Here is what my STD Framework is using ...

SUBROUTINE  CopyMemory ( Ref string Destination, ulong Source, long Length ) Library  "KERNEL32.dll" Alias For "RtlMoveMemory"
SUBROUTINE  CopyMemory ( REF blob dest, longptr srcAddr, longptr len ) LIBRARY "kernel32.dll"Alias For "RtlMoveMemory"

HTH

Regards... Chris

Comment
  1. John Fauss
  2. Tuesday, 5 September 2023 17:59 PM UTC
Chris, I do not believe the first external function declaration will work in a 64-bit application, because the second argument (ulong Source, the memory address of the source data) is always a 32-bit value and RtlMoveMemory API expects a 64-bit address when running in a 64-bit process. Also, why use a Long datatype for the length argument in the first declaration and a Longptr in the second?
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 5 September 2023 18:30 PM UTC
Hi John;

That still seems to work OK for me in 64 bit mode however, I am still catching up on converting all my uLong's to LongPTR's. ;-)

FWIW: Thus far in my PB 2022 R2 framework - where R2 is built using VC++ 2022 - these declarations seem to still be OK to use.

Regards ... Chris
  1. Helpful 1
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 5 September 2023 18:03 PM UTC
  2. PowerBuilder
  3. # 3

Hi, Winthor -

What type(s) of data are you copying? Strings? Blobs? Arrays? If you can supply some details I should be able to provide you with the external function declaration(s) that will work in both 32-bit and 64-bit applications.

Best regards, John

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.