AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia Delphi D3D9 Hook bzw. als "proxy.dll"
Thema durchsuchen
Ansicht
Themen-Optionen

D3D9 Hook bzw. als "proxy.dll"

Ein Thema von GOOFY009 · begonnen am 24. Okt 2009 · letzter Beitrag vom 21. Nov 2009
Antwort Antwort
Benutzerbild von Remko
Remko

Registriert seit: 10. Okt 2006
Ort: 's-Hertogenbosch, Die Niederlande
222 Beiträge
 
RAD-Studio 2010 Arc
 
#1

Re: D3D9 Hook bzw. als "proxy.dll"

  Alt 27. Okt 2009, 20:17
I think this is a Delphi bug, I remember it because I had a problem with some other winapi call that returned an interface.
I quickly tested this (I used IUnknown because I don't have DirectX):

Delphi-Quellcode:
function Direct3DCreate9(SDKVersion: Cardinal): IUnknown; stdcall; external 'd3d9.dll';

procedure TForm2.Button1Click(Sender: TObject);
var
  Unknown: IUnknown;
begin
  Unknown := Direct3DCreate9(32);
end;
When I look in the CPU window we can see the problem:
Delphi-Quellcode:
Unit2.pas.31: Unknown := Direct3DCreate9(32);
004A3B0F 6A20 push $20
004A3B11 8D45F8 lea eax,[ebp-$08]
004A3B14 50 push eax
004A3B15 E8CEFFFFFF call Direct3DCreate9
For some reason Delphi put's the result (which is in eax when using stdcall) on stack (push eax).

If I declare like this it looks ok:
Delphi-Quellcode:
function Direct3DCreate9(SDKVersion: Cardinal): Pointer; stdcall; external 'd3d9.dll';

procedure TForm2.Button1Click(Sender: TObject);
var
  Unknown: IUnknown;
begin
  Pointer(Unknown) := Direct3DCreate9(32);
end;
The CPU window shows:
Delphi-Quellcode:
Unit2.pas.31: Pointer(Unknown) := Direct3DCreate9(32);
004A3B0F 6A20 push $20
004A3B11 E8D2FFFFFF call Direct3DCreate9
004A3B16 8945F8 mov [ebp-$08],eax
See my blog blog
See our Jedi blog
  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 12:45 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