Results 1 to 4 of 4

Thread: help: varptr question

  1. #1

    Question help: varptr question

    Hi,

    do varptr return real memory adress or something 'tb internal' as codeptr do ?

    I didn't understand this:

    I have two instance of thinbasic scripts. varptr gives me an adress for a variable in the script 1. If I peek(long, adress) at the same adress in script 2, thinbasic doesn't return the good value.
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

  2. #2
    Here a sample to illustrate :

    (launch sourcescript.tbasic)

    Archive.zip
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    Hi Sebastian,

    by default, it is not allowed to access memory of independent process from other independent process.

    VARPTR of given value in one process does not point to the same location in another process.

    I don't say it is not possible to access other process memory - but if you want avoid being triggered as false positive by AV programs, I would suggest to avoid it.

    If you need to exchange data between two processes, I would suggest to have a look at cMMF (thinBASIC helper for memory mapped files).


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  4. #4
    Quote Originally Posted by Petr Schreiber View Post
    Hi Sebastian,

    by default, it is not allowed to access memory of independent process from other independent process.

    VARPTR of given value in one process does not point to the same location in another process.

    I don't say it is not possible to access other process memory - but if you want avoid being triggered as false positive by AV programs, I would suggest to avoid it.

    If you need to exchange data between two processes, I would suggest to have a look at cMMF (thinBASIC helper for memory mapped files).


    Petr
    Thanks Petr !
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

Similar Threads

  1. Replies: 2
    Last Post: 09-04-2013, 16:48
  2. Varptr() as a function-parameter?
    By ReneMiner in forum thinBasic General
    Replies: 2
    Last Post: 20-02-2013, 21:58
  3. cast convert / varptr / peek
    By largo_winch in forum thinBasic General
    Replies: 3
    Last Post: 28-09-2012, 11:39
  4. gdi question
    By Lionheart008 in forum UI (User Interface)
    Replies: 6
    Last Post: 07-12-2009, 19:31
  5. m15 question
    By kryton9 in forum M15 file format
    Replies: 4
    Last Post: 20-06-2007, 20:18

Members who have read this thread: 0

There are no members to list at the moment.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •