Skybuck Flying
2015-01-05 07:50:30 UTC
Hello,
Trying to create a simply direct3d stub/proxy, it not working, why ? I know
nothing of stupid interfaces ?! and I know nothing of stupid
DirectX/Direct3D ?!
I simply build this sucker, and then put it in microsoft sdk samples bin
folder to test with executables but they don't load... nothing happens.
I tried getting rid of 81BD string and the release thing... but no luck...
any help how to get this to work/load ?
unit SuckMyCock;
interface
uses
Windows,
DXTypes,
Direct3D9;
type
IMyDirect3D9 = interface(IUnknown)
['{81BDCBCA-64D4-426d-AE8D-AD0147F4275C}']
(*** IDirect3D9 methods ***)
function RegisterSoftwareDevice(pInitializeFunction: Pointer): HResult;
stdcall;
function GetAdapterCount: LongWord; stdcall;
function GetAdapterIdentifier(Adapter: LongWord; Flags: DWord; out
pIdentifier: TD3DAdapterIdentifier9): HResult; stdcall;
function GetAdapterModeCount(Adapter: LongWord; Format: TD3DFormat):
LongWord; stdcall;
function EnumAdapterModes(Adapter: LongWord; Format: TD3DFormat; Mode:
LongWord; out pMode: TD3DDisplayMode): HResult; stdcall;
function GetAdapterDisplayMode(Adapter: LongWord; out pMode:
TD3DDisplayMode): HResult; stdcall;
function CheckDeviceType(Adapter: LongWord; CheckType: TD3DDevType;
AdapterFormat, BackBufferFormat: TD3DFormat; Windowed: BOOL): HResult;
stdcall;
function CheckDeviceFormat(Adapter: LongWord; DeviceType: TD3DDevType;
AdapterFormat: TD3DFormat; Usage: DWord; RType: TD3DResourceType;
CheckFormat: TD3DFormat): HResult; stdcall;
function CheckDeviceMultiSampleType(Adapter: LongWord; DeviceType:
TD3DDevType; SurfaceFormat: TD3DFormat; Windowed: BOOL; MultiSampleType:
TD3DMultiSampleType; pQualityLevels: PDWORD): HResult; stdcall;
function CheckDepthStencilMatch(Adapter: LongWord; DeviceType: TD3DDevType;
AdapterFormat, RenderTargetFormat, DepthStencilFormat: TD3DFormat): HResult;
stdcall;
function CheckDeviceFormatConversion(Adapter: LongWord; DeviceType:
TD3DDevType; SourceFormat, TargetFormat: TD3DFormat): HResult; stdcall;
function GetDeviceCaps(Adapter: LongWord; DeviceType: TD3DDevType; out
pCaps: TD3DCaps9): HResult; stdcall;
function GetAdapterMonitor(Adapter: LongWord): HMONITOR; stdcall;
function CreateDevice(Adapter: LongWord; DeviceType: TD3DDevType;
hFocusWindow: HWND; BehaviorFlags: DWord; pPresentationParameters:
PD3DPresentParameters; out ppReturnedDeviceInterface: IDirect3DDevice9):
HResult; stdcall;
end;
function Direct3DCreate9(SDKVersion: LongWord): IMyDirect3D9; stdcall;
export;
implementation
function Direct3DCreate9(SDKVersion: LongWord): IMyDirect3D9; stdcall;
export;
begin
Result:= IMyDirect3D9(_Direct3DCreate9(SDKVersion));
// if Assigned(Result) then Result._Release; // Delphi autoincrement
reference count
end;
end.
library d3d9;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
System.SysUtils,
System.Classes,
SuckMyCock in 'SuckMyCock.pas';
{$R *.res}
exports
Direct3DCreate9;
begin
end.
Maybe directx headers bad ?
Using the ones that contain note like:
"
Alexey Barkovoy,
30-Oct-2006
"
Bye,
Skybuck.
Trying to create a simply direct3d stub/proxy, it not working, why ? I know
nothing of stupid interfaces ?! and I know nothing of stupid
DirectX/Direct3D ?!
I simply build this sucker, and then put it in microsoft sdk samples bin
folder to test with executables but they don't load... nothing happens.
I tried getting rid of 81BD string and the release thing... but no luck...
any help how to get this to work/load ?
unit SuckMyCock;
interface
uses
Windows,
DXTypes,
Direct3D9;
type
IMyDirect3D9 = interface(IUnknown)
['{81BDCBCA-64D4-426d-AE8D-AD0147F4275C}']
(*** IDirect3D9 methods ***)
function RegisterSoftwareDevice(pInitializeFunction: Pointer): HResult;
stdcall;
function GetAdapterCount: LongWord; stdcall;
function GetAdapterIdentifier(Adapter: LongWord; Flags: DWord; out
pIdentifier: TD3DAdapterIdentifier9): HResult; stdcall;
function GetAdapterModeCount(Adapter: LongWord; Format: TD3DFormat):
LongWord; stdcall;
function EnumAdapterModes(Adapter: LongWord; Format: TD3DFormat; Mode:
LongWord; out pMode: TD3DDisplayMode): HResult; stdcall;
function GetAdapterDisplayMode(Adapter: LongWord; out pMode:
TD3DDisplayMode): HResult; stdcall;
function CheckDeviceType(Adapter: LongWord; CheckType: TD3DDevType;
AdapterFormat, BackBufferFormat: TD3DFormat; Windowed: BOOL): HResult;
stdcall;
function CheckDeviceFormat(Adapter: LongWord; DeviceType: TD3DDevType;
AdapterFormat: TD3DFormat; Usage: DWord; RType: TD3DResourceType;
CheckFormat: TD3DFormat): HResult; stdcall;
function CheckDeviceMultiSampleType(Adapter: LongWord; DeviceType:
TD3DDevType; SurfaceFormat: TD3DFormat; Windowed: BOOL; MultiSampleType:
TD3DMultiSampleType; pQualityLevels: PDWORD): HResult; stdcall;
function CheckDepthStencilMatch(Adapter: LongWord; DeviceType: TD3DDevType;
AdapterFormat, RenderTargetFormat, DepthStencilFormat: TD3DFormat): HResult;
stdcall;
function CheckDeviceFormatConversion(Adapter: LongWord; DeviceType:
TD3DDevType; SourceFormat, TargetFormat: TD3DFormat): HResult; stdcall;
function GetDeviceCaps(Adapter: LongWord; DeviceType: TD3DDevType; out
pCaps: TD3DCaps9): HResult; stdcall;
function GetAdapterMonitor(Adapter: LongWord): HMONITOR; stdcall;
function CreateDevice(Adapter: LongWord; DeviceType: TD3DDevType;
hFocusWindow: HWND; BehaviorFlags: DWord; pPresentationParameters:
PD3DPresentParameters; out ppReturnedDeviceInterface: IDirect3DDevice9):
HResult; stdcall;
end;
function Direct3DCreate9(SDKVersion: LongWord): IMyDirect3D9; stdcall;
export;
implementation
function Direct3DCreate9(SDKVersion: LongWord): IMyDirect3D9; stdcall;
export;
begin
Result:= IMyDirect3D9(_Direct3DCreate9(SDKVersion));
// if Assigned(Result) then Result._Release; // Delphi autoincrement
reference count
end;
end.
library d3d9;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
System.SysUtils,
System.Classes,
SuckMyCock in 'SuckMyCock.pas';
{$R *.res}
exports
Direct3DCreate9;
begin
end.
Maybe directx headers bad ?
Using the ones that contain note like:
"
Alexey Barkovoy,
30-Oct-2006
"
Bye,
Skybuck.