AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Python4Delphi - Integrationsprobleme

Ein Thema von 0xDEAD · begonnen am 10. Nov 2008 · letzter Beitrag vom 11. Nov 2008
Antwort Antwort
0xDEAD

Registriert seit: 9. Okt 2008
33 Beiträge
 
#1

Re: Problem ein Projekt zu einem anderen hinzuzufügen

  Alt 11. Nov 2008, 08:55
Hallo,

nachwievor bin ich noch nicht auf eine Lösung gestoßen.
Die Exception wird an der markierten Stelle angezeigt (bei der if-Abfrage).

Hat jemand eine Idee wie es dazu kommen kann oder einen Tipp wie ich das Problem in den Griff kriegen kann?

Grüße,
der Tom



Delphi-Quellcode:


procedure GetCodeMem(var ptr: PByte; size: integer);
var
  page: PCodeMemPage;
  block: PCodeMemBlock;
begin

  //---allocates Block from executable memory
  // executable memory is requested in pages via VirtualAlloc
  // handed back in blocks of requested size
  // determine if there is already a page assigned and
  // that it has enough space requested block

  page := CodeMemPages;

->>>if (page = nil) or (Longint(CodeMemPages^.CodeBlocks) - Longint(Pointer(CodeMemPages)) <= (size + 3*sizeof(PCodeMemBlock))) then
  begin
    // allocate new Page
    page := VirtualAlloc(nil, PageSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
    page^.next := CodeMemPages;
    CodeMemPages := page;
    // init pointer to end of page
    page^.CodeBlocks := Pointer(Longint(page) + PageSize);
  end;

  //---blocks are assigned starting from the end of the page
  block := Pointer(Longint(page^.codeBlocks) - (size + sizeof(PCodeMemBlock)));
  block^.Next := page^.CodeBlocks;
  page^.CodeBlocks := block;

  ptr := @(block^.Code[0]);

end;
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:46 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz