diff --git a/Include/ddrawex.h b/Include/ddrawex.h new file mode 100644 index 0000000..e2b180b --- /dev/null +++ b/Include/ddrawex.h @@ -0,0 +1,218 @@ +//********************************************************************* +//* Microsoft Windows ** +//* Copyright(c) Microsoft Corp., 1995-1997 ** +//********************************************************************* +// +// DDRAWEX.H +// +// Header file for DirectDrawEx functionality + +#ifndef __DDRAWEXH__ +#define __DDRAWEXH__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +// {4FD2A832-86C8-11d0-8FCA-00C04FD9189D} +DEFINE_GUID(CLSID_DirectDrawFactory, +0x4fd2a832, 0x86c8, 0x11d0, 0x8f, 0xca, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d); + +DEFINE_GUID(IID_IDirectDrawFactory, +0x4fd2a833, 0x86c8, 0x11d0, 0x8f, 0xca, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d); + +#ifndef DIRECTDRAW_VERSION + +//Functionality supported by DDrawex but not DX3 +#define DDSD_LPSURFACE 0x00000800l + +DEFINE_GUID( IID_IDirectDrawSurface3, +0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB ); + +typedef struct IDirectDrawSurface3 FAR *LPDIRECTDRAWSURFACE3; + +#undef INTERFACE +#define INTERFACE IDirectDrawSurface3 +DECLARE_INTERFACE_( IDirectDrawSurface3, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectDrawSurface methods ***/ + STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE3) PURE; + STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; + STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE3, LPRECT,DWORD, LPDDBLTFX) PURE; + STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; + STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE3, LPRECT,DWORD) PURE; + STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE3) PURE; + STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE; + STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE; + STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE3, DWORD) PURE; + STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE3 FAR *) PURE; + STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; + STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE; + STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; + STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; + STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; + STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; + STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; + STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; + STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; + STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE; + STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE; + STDMETHOD(IsLost)(THIS) PURE; + STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE; + STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; + STDMETHOD(Restore)(THIS) PURE; + STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; + STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; + STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; + STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; + STDMETHOD(Unlock)(THIS_ LPVOID) PURE; + STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX) PURE; + STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; + STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE3) PURE; + /*** Added in the v2 interface ***/ + STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE; + STDMETHOD(PageLock)(THIS_ DWORD) PURE; + STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; + /*** Added in the v3 interface ***/ + STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC, DWORD ) PURE; +}; +#endif + + + + +#define DDSCAPS_DATAEXCHANGE (DDSCAPS_SYSTEMMEMORY|DDSCAPS_VIDEOMEMORY) + +#undef INTERFACE +#define INTERFACE IDirectDrawFactory + +DECLARE_INTERFACE_(IDirectDrawFactory, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectDrawFactory methods ***/ + STDMETHOD(CreateDirectDraw) (THIS_ GUID * pGUID, HWND hWnd, DWORD dwCoopLevelFlags, DWORD dwReserved, IUnknown *pUnkOuter, IDirectDraw **ppDirectDraw) PURE; + STDMETHOD(DirectDrawEnumerate) (THIS_ LPDDENUMCALLBACK lpCallback, LPVOID lpContext) PURE; +}; + + + +// {618F8AD4-8B7A-11d0-8FCC-00C04FD9189D} +DEFINE_GUID(IID_IDirectDraw3, +0x618f8ad4, 0x8b7a, 0x11d0, 0x8f, 0xcc, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d); + +typedef struct IDirectDraw3 FAR *LPDIRECTDRAW3; + +#undef INTERFACE +#define INTERFACE IDirectDraw3 + +DECLARE_INTERFACE_(IDirectDraw3, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectDraw methods ***/ + STDMETHOD(Compact)(THIS) PURE; + STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE; + STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE; + STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE; + STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE; + STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE; + STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE; + STDMETHOD(FlipToGDISurface)(THIS) PURE; + STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE; + STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE; + STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD ) PURE; + STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE; + STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE; + STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE; + STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE; + STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE; + STDMETHOD(RestoreDisplayMode)(THIS) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; + STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE; + STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; + /*** Added in the v2 interface ***/ + STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS, LPDWORD, LPDWORD) PURE; + /*** IDirectDraw3 methods ***/ + STDMETHOD(GetSurfaceFromDC) (THIS_ HDC, IDirectDrawSurface **) PURE; +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectDraw3_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) +#define IDirectDraw3_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectDraw3_Release(p) (p)->lpVtbl->Release(p) +#define IDirectDraw3_Compact(p) (p)->lpVtbl->Compact(p) +#define IDirectDraw3_CreateClipper(p, a, b, c) (p)->lpVtbl->CreateClipper(p, a, b, c) +#define IDirectDraw3_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d) +#define IDirectDraw3_CreateSurface(p, a, b, c) (p)->lpVtbl->CreateSurface(p, a, b, c) +#define IDirectDraw3_DuplicateSurface(p, a, b) (p)->lpVtbl->DuplicateSurface(p, a, b) +#define IDirectDraw3_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d) +#define IDirectDraw3_EnumSurfaces(p, a, b, c, d) (p)->lpVtbl->EnumSurfaces(p, a, b, c, d) +#define IDirectDraw3_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) +#define IDirectDraw3_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) +#define IDirectDraw3_GetDisplayMode(p, a) (p)->lpVtbl->GetDisplayMode(p, a) +#define IDirectDraw3_GetFourCCCodes(p, a, b) (p)->lpVtbl->GetFourCCCodes(p, a, b) +#define IDirectDraw3_GetGDISurface(p, a) (p)->lpVtbl->GetGDISurface(p, a) +#define IDirectDraw3_GetMonitorFrequency(p, a) (p)->lpVtbl->GetMonitorFrequency(p, a) +#define IDirectDraw3_GetScanLine(p, a) (p)->lpVtbl->GetScanLine(p, a) +#define IDirectDraw3_GetVerticalBlankStatus(p, a) (p)->lpVtbl->GetVerticalBlankStatus(p, a) +#define IDirectDraw3_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) +#define IDirectDraw3_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) +#define IDirectDraw3_SetCooperativeLevel(p, a, b) (p)->lpVtbl->SetCooperativeLevel(p, a, b) +#define IDirectDraw3_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e) +#define IDirectDraw3_WaitForVerticalBlank(p, a, b) (p)->lpVtbl->WaitForVerticalBlank(p, a, b) +#define IDirectDraw3_GetAvailableVidMem(p, a, b, c) (p)->lpVtbl->GetAvailableVidMem(p, a, b, c) +#define IDirectDraw3_GetSurfaceFromDC(p, a, b) (p)->lpVtbl->GetSurfaceFromDC(p, a, b) +#endif + + + +/*=========================================================================== + * + * + * DIRECTDRAWEX RETURN CODES + * + * The return values from DirectDrawEx Commands and Surface that return an + * HRESULT are codes from DirectDrawEx concerning the results of the action + * requested by DirectDrawEx. + * + *==========================================================================*/ + +/* + * An attempt was made to load ddraw.dll + */ +#define DDERR_LOADFAILED MAKE_DDHRESULT( 901 ) + +/* + * Unable to determine module/os version number + */ +#define DDERR_BADVERSIONINFO MAKE_DDHRESULT( 902 ) + +/* + * Unable to determine address of ddraw.dll exported symbol (DirectDrawCreate or + * DirectDrawEnumerate). + */ +#define DDERR_BADPROCADDRESS MAKE_DDHRESULT( 903 ) + +/* + * Legacy usage: do not use QI() to create D3D device objects from surface objects. + * Use IDirect3D2::CreateDevice() + */ +#define DDERR_LEGACYUSAGE MAKE_DDHRESULT( 904 ) + +#ifdef __cplusplus +} +#endif + + +#endif // __DDRAWEXH__ diff --git a/Release/-dxwnd (2).dll b/Release/-dxwnd (2).dll deleted file mode 100644 index ae75b63..0000000 --- a/Release/-dxwnd (2).dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:61559f87e638c3e804586c3a84c178771a9795a5160e46196267ba0bc551ce67 -size 654848 diff --git a/Release/-dxwnd.dll b/Release/-dxwnd.dll deleted file mode 100644 index f09497a..0000000 --- a/Release/-dxwnd.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2a37cc0d0feca74c6cad95af68a73bb1678677db3de38ed9d3dff3907ee05184 -size 653824 diff --git a/Release/.gitattributes b/Release/.gitattributes deleted file mode 100644 index b110a24..0000000 --- a/Release/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.{dll,exe} filter=lfs diff=lfs merge=lfs -text \ No newline at end of file diff --git a/Release/Disasm.dll b/Release/Disasm.dll deleted file mode 100644 index b9c3542..0000000 --- a/Release/Disasm.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f413a207787da88281500aaeae07fb98d7d438ecb4d67f8fcdf0aff2f988717f -size 138752 diff --git a/Release/dxwnd.ini b/Release/dxwnd.ini deleted file mode 100644 index 8d6fa2d..0000000 --- a/Release/dxwnd.ini +++ /dev/null @@ -1,459 +0,0 @@ -[window] -exepath=D:\Games\Imperialism II - Age of Exploration (GOG)\ -posx=-893 -posy=292 -sizx=320 -sizy=400 -exportpath=D:\DxWnd\export.wip\ -debug=1 -[target] -title0=Tanktics -path0=D:\Games\tanktics\tanktics.exe -launchpath0= -module0= -opengllib0= -notes0= -registry0= -ver0=0 -coord0=2 -flag0=-1398800350 -flagg0=1744830480 -flagh0=20 -flagi0=-2008543232 -flagj0=5248 -flagk0=65536 -flagl0=513 -flagm0=0 -tflag0=-2147477245 -dflag0=0 -posx0=50 -posy0=50 -sizx0=800 -sizy0=600 -maxfps0=0 -initts0=0 -winver0=0 -maxres0=3 -swapeffect0=0 -maxddinterface0=6 -slowratio0=2 -title1=Tanktics (no hook) -path1=D:\Games\tanktics\tanktics.exe -launchpath1= -module1= -opengllib1= -notes1= -registry1= -ver1=12 -coord1=0 -flag1=614465570 -flagg1=1073774592 -flagh1=4 -flagi1=-2009071612 -flagj1=4224 -flagk1=65536 -flagl1=1 -flagm1=0 -tflag1=-2147477245 -dflag1=0 -posx1=50 -posy1=50 -sizx1=800 -sizy1=600 -maxfps1=0 -initts1=0 -winver1=0 -maxres1=-1 -swapeffect1=0 -maxddinterface1=6 -slowratio1=2 -title2=ROADRASH.EXE -path2=D:\Games\road-rash\ROADRASH.EXE -launchpath2= -module2= -opengllib2= -notes2= -registry2= -ver2=0 -coord2=0 -flag2=136314914 -flagg2=1207959552 -flagh2=20 -flagi2=134217732 -flagj2=4224 -flagk2=65536 -flagl2=0 -flagm2=0 -tflag2=0 -dflag2=0 -posx2=50 -posy2=50 -sizx2=800 -sizy2=600 -maxfps2=0 -initts2=0 -winver2=0 -maxres2=-1 -swapeffect2=0 -maxddinterface2=7 -slowratio2=2 -title3=EMPIRES2.EXE -path3=D:\Games\Age of Empires II Trial\EMPIRES2.EXE -launchpath3= -module3= -opengllib3= -notes3= -registry3= -ver3=0 -coord3=0 -flag3=136314914 -flagg3=1207959552 -flagh3=20 -flagi3=134217732 -flagj3=4224 -flagk3=65536 -flagl3=0 -flagm3=0 -tflag3=0 -dflag3=0 -posx3=50 -posy3=50 -sizx3=800 -sizy3=600 -maxfps3=0 -initts3=0 -winver3=0 -maxres3=-1 -swapeffect3=0 -maxddinterface3=7 -slowratio3=2 -title4=Blade of Darkness (GOG-OpenGL) -path4=D:\Games\Blade of Darkness (GOG)\Bin\Blade.exe -launchpath4= -module4=raster\rOpenGL.dll -opengllib4= -notes4= -registry4=( -ver4=0 -coord4=0 -flag4=681574434 -flagg4=1208090624 -flagh4=21 -flagi4=205520902 -flagj4=4224 -flagk4=5308416 -flagl4=0 -flagm4=0 -tflag4=0 -dflag4=0 -posx4=50 -posy4=50 -sizx4=800 -sizy4=600 -maxfps4=0 -initts4=0 -winver4=0 -maxres4=-1 -swapeffect4=0 -maxddinterface4=7 -slowratio4=1 -title5=msgolf98 -path5=D:\Games\MSGolf98\MSGOLF98\GAME.EXE -launchpath5= -module5= -opengllib5= -notes5= -registry5= -ver5=0 -coord5=0 -flag5=136314914 -flagg5=1207959552 -flagh5=20 -flagi5=134217732 -flagj5=4224 -flagk5=327680 -flagl5=0 -flagm5=0 -tflag5=0 -dflag5=0 -posx5=50 -posy5=50 -sizx5=880 -sizy5=660 -maxfps5=0 -initts5=0 -winver5=0 -maxres5=-1 -swapeffect5=0 -maxddinterface5=7 -slowratio5=2 -title6=Vitae.exe -path6=D:\Games\Vitae\Vitae.exe -launchpath6= -module6= -opengllib6= -notes6= -registry6= -ver6=0 -coord6=0 -flag6=136314914 -flagg6=1744830592 -flagh6=20 -flagi6=138412036 -flagj6=4224 -flagk6=3473450 -flagl6=0 -flagm6=0 -tflag6=-2147476729 -dflag6=0 -posx6=50 -posy6=50 -sizx6=800 -sizy6=600 -maxfps6=0 -initts6=0 -winver6=0 -maxres6=-1 -swapeffect6=0 -maxddinterface6=7 -slowratio6=2 -title7=moto.exe -path7=D:\Games\Moto Racer 2 (GOG)\moto.exe -launchpath7=D:\Games\Moto Racer 2 (GOG)\moto.exe -NoPowerVr -KeepAvailableVram1073741824 -module7= -opengllib7= -notes7= -registry7= -ver7=0 -coord7=0 -flag7=681574434 -flagg7=1207959680 -flagh7=524308 -flagi7=138412036 -flagj7=33558656 -flagk7=196608 -flagl7=0 -flagm7=0 -tflag7=-1073735421 -dflag7=0 -posx7=50 -posy7=50 -sizx7=800 -sizy7=600 -maxfps7=0 -initts7=0 -winver7=0 -maxres7=-1 -swapeffect7=0 -maxddinterface7=7 -slowratio7=2 -title8=Army Men RTS -path8=D:\Games\Army Men RTS\amrts.exe -launchpath8= -module8= -opengllib8= -notes8= -registry8= -ver8=0 -coord8=0 -flag8=671088678 -flagg8=1207959552 -flagh8=20 -flagi8=4194304 -flagj8=128 -flagk8=65536 -flagl8=0 -flagm8=0 -tflag8=0 -dflag8=0 -posx8=50 -posy8=50 -sizx8=800 -sizy8=600 -maxfps8=0 -initts8=0 -winver8=0 -maxres8=0 -swapeffect8=0 -maxddinterface8=7 -slowratio8=1 -title9=Glover -path9=D:\Games\Glover\glover.exe -launchpath9= -module9= -opengllib9= -notes9= -registry9= -ver9=0 -coord9=0 -flag9=203423778 -flagg9=1207959552 -flagh9=20 -flagi9=138412052 -flagj9=67113088 -flagk9=65536 -flagl9=0 -flagm9=0 -tflag9=-2147477245 -dflag9=0 -posx9=50 -posy9=50 -sizx9=800 -sizy9=600 -maxfps9=0 -initts9=0 -winver9=0 -maxres9=-1 -swapeffect9=0 -maxddinterface9=7 -slowratio9=2 -title10=Moonbase.exe -path10=D:\Games\MoonBase Commander\Moonbase.exe -launchpath10= -module10= -opengllib10= -notes10= -registry10= -ver10=0 -coord10=0 -flag10=-1465909134 -flagg10=1744963584 -flagh10=524308 -flagi10=138412036 -flagj10=-2147479424 -flagk10=272957440 -flagl10=0 -flagm10=0 -tflag10=-2147477237 -dflag10=0 -posx10=150 -posy10=150 -sizx10=800 -sizy10=600 -maxfps10=0 -initts10=0 -winver10=0 -maxres10=-1 -swapeffect10=0 -maxddinterface10=7 -slowratio10=2 -title11=Lode Runner 2 -path11=D:\Games\Lode Runner 2\LR2.exe -launchpath11= -module11= -opengllib11= -notes11= -registry11= -ver11=0 -coord11=0 -flag11=136319010 -flagg11=1744830592 -flagh11=20 -flagi11=138416132 -flagj11=4224 -flagk11=327680 -flagl11=4 -flagm11=0 -tflag11=-2147477245 -dflag11=0 -posx11=50 -posy11=50 -sizx11=800 -sizy11=600 -maxfps11=0 -initts11=0 -winver11=0 -maxres11=3 -swapeffect11=0 -maxddinterface11=7 -slowratio11=2 -title12=Patrician III -path12=D:\Games\Patrician III - Impero dei Mari\Patrician3.exe -launchpath12= -module12= -opengllib12= -notes12= -registry12= -ver12=0 -coord12=0 -flag12=681574434 -flagg12=1744830464 -flagh12=20 -flagi12=136314886 -flagj12=4224 -flagk12=65536 -flagl12=0 -flagm12=0 -tflag12=-2147477245 -dflag12=0 -posx12=50 -posy12=50 -sizx12=800 -sizy12=600 -maxfps12=0 -initts12=0 -winver12=0 -maxres12=-1 -swapeffect12=0 -maxddinterface12=7 -slowratio12=2 -title13=Need for Speed SE -path13=D:\NFSSE\NFS_WIN.EXE -launchpath13= -module13= -opengllib13= -notes13= -registry13= -ver13=0 -coord13=0 -flag13=136314978 -flagg13=2013266048 -flagh13=532 -flagi13=138412036 -flagj13=4224 -flagk13=65536 -flagl13=0 -flagm13=0 -tflag13=-2147477245 -dflag13=0 -posx13=50 -posy13=50 -sizx13=800 -sizy13=600 -maxfps13=0 -initts13=0 -winver13=0 -maxres13=-1 -swapeffect13=0 -maxddinterface13=7 -slowratio13=2 -title14=Imperialism II.exe -path14=D:\Games\Imperialism II - Age of Exploration (GOG)\Imperialism II.exe -launchpath14= -module14= -opengllib14= -notes14= -registry14= -ver14=0 -coord14=0 -flag14=136314914 -flagg14=1209008128 -flagh14=20 -flagi14=138412036 -flagj14=4224 -flagk14=1073807360 -flagl14=0 -flagm14=0 -tflag14=0 -dflag14=0 -posx14=50 -posy14=50 -sizx14=800 -sizy14=600 -maxfps14=0 -initts14=0 -winver14=0 -maxres14=-1 -swapeffect14=0 -maxddinterface14=7 -slowratio14=2 diff --git a/Release/filter.dll b/Release/filter.dll deleted file mode 100644 index 41f9d5a..0000000 --- a/Release/filter.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d364d53ff922e8381c306d23d51c3a93a0512325824e5e0513c424e9372f9b4c -size 13312 diff --git a/Release/vcomp90.dll b/Release/vcomp90.dll deleted file mode 100644 index 71b9a14..0000000 --- a/Release/vcomp90.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9140efe26252b6329da254201219fc2d17a3f651e1591e32ae04c86a27e35bb2 -size 51024 diff --git a/build/dxwnd.dll b/build/dxwnd.dll index 4790bdc..19c1618 100644 --- a/build/dxwnd.dll +++ b/build/dxwnd.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1072541e0a7edd1b828cc7f0ea4aea38f4c8bddf9afbb732b583c11d066281ad -size 655360 +oid sha256:922db77cc7f8ea50e92a54d5579754a304cb92bdc3e422ac9d4f10d5e34f9227 +size 657920 diff --git a/build/dxwnd.exe b/build/dxwnd.exe index 75cb4f4..aafa999 100644 --- a/build/dxwnd.exe +++ b/build/dxwnd.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a96a88210c3088f48be0524d62bb5023d0ab66a3eff66817277a792e3ec210dd -size 568832 +oid sha256:567827f8871b476de40108507b8038afbf74faa88ad71aa7e50b9ba883ad9548 +size 575488 diff --git a/build/exports/Aura 2 The Sacred Rings.dxw b/build/exports/Aura 2 The Sacred Rings.dxw new file mode 100644 index 0000000..a0dbad5 --- /dev/null +++ b/build/exports/Aura 2 The Sacred Rings.dxw @@ -0,0 +1,31 @@ +[target] +title0=Aura 2 The Sacred Rings +path0=D:\Games\Aura 2 The Sacred Rings\TSR.exe +launchpath0= +module0= +opengllib0= +notes0= +registry0= +ver0=0 +coord0=0 +flag0=136314914 +flagg0=1207959552 +flagh0=20 +flagi0=134217732 +flagj0=4224 +flagk0=65536 +flagl0=0 +flagm0=0 +tflag0=0 +dflag0=0 +posx0=50 +posy0=50 +sizx0=800 +sizy0=600 +maxfps0=0 +initts0=0 +winver0=0 +maxres0=-1 +swapeffect0=0 +maxddinterface0=7 +slowratio0=2 diff --git a/build/exports/Contrast.dxw b/build/exports/Contrast.dxw new file mode 100644 index 0000000..820d90f --- /dev/null +++ b/build/exports/Contrast.dxw @@ -0,0 +1,31 @@ +[target] +title0=Contrast +path0=D:\Games\Contrast\Binaries\Win32\ContrastGame.exe +launchpath0= +module0= +opengllib0= +notes0= +registry0= +ver0=9 +coord0=0 +flag0=136314914 +flagg0=1207959552 +flagh0=20 +flagi0=134217732 +flagj0=4224 +flagk0=65536 +flagl0=0 +flagm0=0 +tflag0=0 +dflag0=0 +posx0=50 +posy0=50 +sizx0=800 +sizy0=600 +maxfps0=0 +initts0=0 +winver0=0 +maxres0=-1 +swapeffect0=0 +maxddinterface0=7 +slowratio0=2 diff --git a/build/exports/Outcast 1999 CD Retail release.dxw b/build/exports/Outcast 1999 CD Retail release.dxw new file mode 100644 index 0000000..4594e82 --- /dev/null +++ b/build/exports/Outcast 1999 CD Retail release.dxw @@ -0,0 +1,31 @@ +[target] +title0=Outcast 1999 CD Retail release +path0=C:\Outcast\oc\Oc3.exe +launchpath0=C:\Outcast\Outcast.exe +module0= +opengllib0= +notes0=This .dxw setup is meant for the Outcast 1999 CD Retail release of the game.\nIt is not tested with the DVD release or later versions / unofficial patches.\n\nThe official Patch 3 is recommended since without it the game may not start\nwith the message "Wrong Disc inserted".\n\n\nThe slow rice paddy movement and Twon-Ha riding bug and Lighthouse jump bug\nare caused by the game running too fast on modern cpu's. This is fixed with the \noptions in the Dxwnd Timing tab.\n\nAdditionaly Dxwnd needs to be run with admin rights or the game won't start.\n +registry0= +ver0=0 +coord0=1 +flag0=136314926 +flagg0=1207963664 +flagh0=20 +flagi0=138412036 +flagj0=5248 +flagk0=65536 +flagl0=0 +flagm0=0 +tflag0=0 +dflag0=0 +posx0=50 +posy0=50 +sizx0=800 +sizy0=600 +maxfps0=60 +initts0=0 +winver0=0 +maxres0=-1 +swapeffect0=0 +maxddinterface0=7 +slowratio0=2 diff --git a/build/exports/Whiteout.dxw b/build/exports/Whiteout.dxw index 69c375f..11ea546 100644 --- a/build/exports/Whiteout.dxw +++ b/build/exports/Whiteout.dxw @@ -3,13 +3,13 @@ title0=Whiteout path0=D:\Games\Whiteout\Whiteout.exe module0= opengllib0= -ver0=0 +ver0=7 coord0=0 -flag0=402653216 +flag0=402653218 flagg0=1207959552 flagh0=20 -flagi0=0 -tflag0=64 +flagi0=4194304 +tflag0=0 initx0=0 inity0=0 minx0=0 @@ -18,7 +18,20 @@ maxx0=0 maxy0=0 posx0=50 posy0=50 -sizx0=640 -sizy0=480 +sizx0=800 +sizy0=600 maxfps0=0 initts0=0 +launchpath0= +notes0= +registry0= +flagj0=0 +flagk0=0 +flagl0=0 +flagm0=0 +dflag0=0 +winver0=0 +maxres0=0 +swapeffect0=0 +maxddinterface0=7 +slowratio0=1 diff --git a/build/readme-relnotes.txt b/build/readme-relnotes.txt index 4d3b148..0cb617c 100644 --- a/build/readme-relnotes.txt +++ b/build/readme-relnotes.txt @@ -1124,3 +1124,8 @@ add: SetWindowsHookExA logging, SetWindowsHookExW hooking fix: MessageHook logging GUI: some rearrangements / rationalizations to the interface add: INIT24BPP and INIT32BPP flags + +v2.03.71 +fix: no need to save configuration before running with fake registry +add: icons to notify for non-empty registry and notes tabs +fix: hooked ddrawex.dll DirectDrawEx methods - fixes "Whiteout", what else? diff --git a/dll/ddblit.cpp b/dll/ddblit.cpp index 6a59562..842d1e7 100644 --- a/dll/ddblit.cpp +++ b/dll/ddblit.cpp @@ -33,7 +33,6 @@ extern void BlitTrace(char *, LPRECT, LPRECT, int); extern void DescribeSurface(LPDIRECTDRAWSURFACE, int, char *, int); extern void TextureHandling(LPDIRECTDRAWSURFACE, int); extern GetSurfaceDesc2_Type pGetSurfaceDescMethod(); -extern int GetSurfaceDescSize(); extern GetSurfaceDesc2_Type GetSurfaceDescMethod(); extern Blt_Type pBltMethod(); @@ -217,7 +216,7 @@ static HRESULT sBltToPrimary(int dxversion, Blt_Type pBlt, char *api, LPDIRECTDR extern CreateSurface2_Type pCreateSurfaceMethod(int); if (IsDebug) BlitTrace("KEYSRC", lpsrcrect, &destrect, __LINE__); memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = GetSurfaceDescSize(); + ddsd.dwSize = (dxversion < 4) ? sizeof(DDSURFACEDESC) : sizeof(DDSURFACEDESC2); (*pGetSurfaceDescMethod())((LPDIRECTDRAWSURFACE2)lpddssrc, &ddsd); res=(*pCreateSurfaceMethod(dxversion))(lpPrimaryDD, &ddsd, (LPDIRECTDRAWSURFACE *)&lpddsTmp, NULL); if(res) OutTraceE("CreateSurface: ERROR %x(%s) at %d", res, ExplainDDError(res), __LINE__); diff --git a/dll/ddraw.cpp b/dll/ddraw.cpp index dcaef85..492e7a2 100644 --- a/dll/ddraw.cpp +++ b/dll/ddraw.cpp @@ -425,12 +425,11 @@ DWORD gdwRefreshRate; #define MAXREFRESHDELAYCOUNT 20 int iRefreshDelays[MAXREFRESHDELAYCOUNT]={16, 17}; int iRefreshDelayCount=2; -int lpddHookedVersion(LPDIRECTDRAW); -static HRESULT myGetDisplayMode(LPDIRECTDRAW lpdd, LPDDSURFACEDESC lpdds) +static HRESULT myGetDisplayMode(int dxversion, LPDIRECTDRAW lpdd, LPDDSURFACEDESC lpdds) { HRESULT res; - switch(lpddHookedVersion(lpdd)){ + switch(dxversion){ default: case 1: res=(*pGetDisplayMode1)(lpdd, lpdds); break; case 2: res=(*pGetDisplayMode2)(lpdd, lpdds); break; @@ -440,14 +439,14 @@ static HRESULT myGetDisplayMode(LPDIRECTDRAW lpdd, LPDDSURFACEDESC lpdds) return res; } -void SetVSyncDelays(LPDIRECTDRAW lpdd) +void SetVSyncDelays(int dxversion, LPDIRECTDRAW lpdd) { DDSURFACEDESC2 ddsdRefreshRate; HRESULT res; memset(&ddsdRefreshRate, 0, sizeof(ddsdRefreshRate)); ddsdRefreshRate.dwSize = sizeof(DDSURFACEDESC); - res=myGetDisplayMode(lpdd, (LPDDSURFACEDESC)&ddsdRefreshRate); + res=myGetDisplayMode(dxversion, lpdd, (LPDDSURFACEDESC)&ddsdRefreshRate); if(res) return; dxw.SetVSyncDelays(ddsdRefreshRate.dwRefreshRate); } @@ -590,7 +589,7 @@ void InitDDScreenParameters(int dxversion, LPDIRECTDRAW lpdd) HRESULT res; DDSURFACEDESC2 ddsd; ddsd.dwSize=sizeof(DDSURFACEDESC); - res=myGetDisplayMode(lpdd, (LPDDSURFACEDESC)&ddsd); + res=myGetDisplayMode(dxversion, lpdd, (LPDDSURFACEDESC)&ddsd); if(res){ OutTraceE("GetDisplayMode: ERROR res=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__); return; @@ -994,34 +993,6 @@ int lpddsHookedVersion() return iBakBufferVersion; } -int GetSurfaceDescSize() -{ - return (iBakBufferVersion < 4) ? sizeof(DDSURFACEDESC) : sizeof(DDSURFACEDESC2); -} - -int lpddHookedVersion(LPDIRECTDRAW lpdd) -{ - char sMsg[81]; - void *extCreateSurface = NULL; - - if(lpPrimaryDD){ - __try{ - extCreateSurface=(void *)*(DWORD *)(*(DWORD *)lpdd + 24); - } - __except (EXCEPTION_EXECUTE_HANDLER){ - extCreateSurface=NULL; - }; - if(extCreateSurface==(void *)extCreateSurface7) return 7; - if(extCreateSurface==(void *)extCreateSurface4) return 4; - if(extCreateSurface==(void *)extCreateSurface2) return 2; - if(extCreateSurface==(void *)extCreateSurface1) return 1; - } - sprintf_s(sMsg, 80, "lpddHookedVersion(%x) can't match %x\n", lpdd, extCreateSurface); - OutTraceDW(sMsg); - if (IsAssertEnabled) MessageBox(0, sMsg, "lpddHookedVersion", MB_OK | MB_ICONEXCLAMATION); - return 0; -} - void DescribeSurface(LPDIRECTDRAWSURFACE lpdds, int dxversion, char *label, int line) { DDSURFACEDESC2 ddsd; @@ -1115,11 +1086,6 @@ int Set_dwSize_From_Surface() return size; } -int Set_dwSize_From_DDraw(LPDIRECTDRAW lpdd) -{ - return (lpddHookedVersion(lpdd) < 4) ? sizeof(DDSURFACEDESC) : sizeof(DDSURFACEDESC2); -} - void HookDDSession(LPDIRECTDRAW *lplpdd, int dxversion) { OutTraceDW("Hooking directdraw session dd=%x dxversion=%d thread_id=%x\n", @@ -2035,7 +2001,7 @@ HRESULT WINAPI extSetDisplayMode(int dxversion, LPDIRECTDRAW lpdd, SetBltTransformations(dxversion); if(dxw.Windowize) { OutTraceDW("SetDisplayMode: mode=EMULATE %s ret=OK\n", DumpPixelFormat(&ddsd)); - SetVSyncDelays(lpdd); + SetVSyncDelays(dxversion, lpdd); return DD_OK; } } @@ -2046,16 +2012,15 @@ HRESULT WINAPI extSetDisplayMode(int dxversion, LPDIRECTDRAW lpdd, } ZeroMemory(&ddsd, sizeof(ddsd)); - ddsd.dwSize = Set_dwSize_From_DDraw(lpdd); ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_REFRESHRATE; ddsd.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT); ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB; switch(dxversion){ default: - case 1: res=(*pGetDisplayMode1)(lpdd, (LPDDSURFACEDESC)&ddsd); break; - case 2: res=(*pGetDisplayMode2)(lpdd, (LPDDSURFACEDESC)&ddsd); break; - case 4: res=(*pGetDisplayMode4)(lpdd, &ddsd); break; - case 7: res=(*pGetDisplayMode7)(lpdd, &ddsd); break; + case 1: ddsd.dwSize=sizeof(LPDDSURFACEDESC); res=(*pGetDisplayMode1)(lpdd, (LPDDSURFACEDESC)&ddsd); break; + case 2: ddsd.dwSize=sizeof(LPDDSURFACEDESC); res=(*pGetDisplayMode2)(lpdd, (LPDDSURFACEDESC)&ddsd); break; + case 4: ddsd.dwSize=sizeof(LPDDSURFACEDESC2); res=(*pGetDisplayMode4)(lpdd, &ddsd); break; + case 7: ddsd.dwSize=sizeof(LPDDSURFACEDESC2); res=(*pGetDisplayMode7)(lpdd, &ddsd); break; } OutTraceB("SetDisplayMode: detected screen size=(%dx%d)\n", ddsd.dwWidth, ddsd.dwHeight); @@ -2082,7 +2047,7 @@ HRESULT WINAPI extSetDisplayMode(int dxversion, LPDIRECTDRAW lpdd, } if(res) OutTraceE("SetDisplayMode: error=%x\n", res); - SetVSyncDelays(lpdd); + SetVSyncDelays(dxversion, lpdd); // set a default palette ??? if(dxw.VirtualPixelFormat.dwRGBBitCount == 8) mySetPalette(0, 256, DefaultSystemPalette); @@ -3086,7 +3051,7 @@ static HRESULT WINAPI extCreateSurface(int dxversion, CreateSurface_Type pCreate // creation of the primary surface.... if(ddsd.dwFlags & DDSD_CAPS && ddsd.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE){ - SetVSyncDelays(lpdd); + SetVSyncDelays(dxversion, lpdd); GetHookInfo()->Height=(short)dxw.GetScreenHeight(); GetHookInfo()->Width=(short)dxw.GetScreenWidth(); GetHookInfo()->ColorDepth=(short)dxw.VirtualPixelFormat.dwRGBBitCount; @@ -4852,7 +4817,7 @@ HRESULT WINAPI extEnumDisplayModes(int dxversion, EnumDisplayModes1_Type pEnumDi DDSURFACEDESC2 EmuDesc; memset(&EmuDesc, 0, sizeof(EmuDesc)); EmuDesc.dwSize = sizeof(DDSURFACEDESC); // using release 1 type .... - res=myGetDisplayMode(lpdd, (LPDDSURFACEDESC)&EmuDesc); + res=myGetDisplayMode(dxversion, lpdd, (LPDDSURFACEDESC)&EmuDesc); if(res){ OutTraceE("EnumDisplayModes(D): GetDisplayMode ERROR res=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__); return res; diff --git a/dll/ddrawex.cpp b/dll/ddrawex.cpp new file mode 100644 index 0000000..3e1593f --- /dev/null +++ b/dll/ddrawex.cpp @@ -0,0 +1,259 @@ +#define _CRT_SECURE_NO_WARNINGS +#define INITGUID + +#include +#include +#include "dxwnd.h" +#include "dxhook.h" +#include "ddrawi.h" +#include "dxwcore.hpp" +#include "stdio.h" +#include "hddraw.h" +#include "dxhelper.h" +#include "syslibs.h" + +/* +Using DirectDrawEx + +This article provides a brief overview of DirectDrawEx and how it extends the functionality of a DirectDraw object as described in the Microsoft DirectX® SDK. + +Contents of this article: + What Is DirectDrawEx? + Advantages of Using DirectDrawEx + Creating DirectDraw Objects and Surfaces with DirectDrawEx + Distinctions Between DirectDraw and DirectDrawEx + +What Is DirectDrawEx? + +DirectDrawEx is a dynamic-link library (DLL) that embellishes current functionality of DirectDraw, enhancing +existing features and providing new functionality. +DirectDrawEx also exposes new interfaces that applications can use when you include the ddrawex.h header file. +To create a DirectDraw object that can use the extended features provided by DirectDrawEx, you must create the +object by using the IDirectDrawFactory interface. A DirectDraw object created with the IDirectDrawFactory +interface will support the IDirectDraw3 interface, aggregation of DirectDraw surfaces, data exchange, and palette +mapping, in addition to the features of DirectDraw objects described in the DirectX SDK. + +Advantages of Using DirectDrawEx + +The primary advantage of creating a DirectDraw object through the IDirectDrawFactory interface is that it exposes +the IDirectDraw3 interface. The IDirectDraw3 interface inherits all the functionality of the IDirectDraw and the +IDirectDraw2 interfaces and provides a new method that can retrieve a pointer to an IDirectDrawSurface interface, +given a handle to a device context. +To obtain the IDirectDraw3 interface, you must call the IDirectDrawFactory::CreateDirectDraw method to create the +DirectDraw object and expose the IUnknown and IDirectDraw interfaces. Applications can then call QueryInterface to +obtain a pointer to the IDirectDraw3 interface. To view sample code that demonstrates this, see Creating DirectDraw +Objects and Surfaces with DirectDrawEx. +Another advantage of using DirectDrawEx over using DirectDraw is that you can now aggregate inner objects with outer +objects by using the IDirectDraw3::CreateSurface method. Formerly, IDirectDraw::CreateSurface and +IDirectDraw2::CreateSurface did not provide COM aggregation features. +For a thorough description of how IDirectDraw3 implements aggregation see, IDirectDraw3::CreateSurface. + +Finally, DirectDrawEx now also provides the DDSCAPS_DATAEXCHANGE flag for the DDSCAPS structure's dwcaps member. +Setting this flag in conjunction with the DDSCAPS_OWNDC flag enables applications to call the +IDirectDrawSurface::GetDC method to lock the device context for as long they require, without holding a lock on the surface. + +Creating DirectDraw Objects and Surfaces with DirectDrawEx + +The following sample code demonstrates how to create a DirectDraw object by using DirectDrawEx, and get a pointer to +the IDirectDraw3 interface. The code shows how to create and call DirectDraw objects. + +#include ddrawex.h + +void CreateDDEx() +{ + //Declarations + HRESULT hr; + IDirectDraw *pDD; + IDirectDraw3 *pDD3; + IDirectDrawFactory *pDDF; + + //Initialize COM library + CoInitialize(NULL); + + + //Create a DirectDrawFactory object and get + //an IDirectDrawFactory interface pointer + CoCreateInstance(CLSID_DirectDrawFactory, NULL, CLSCTX_INPROC_SERVER, + IID_IDirectDrawFactory, (void **)&pDDF); + + //Call the IDirectDrawFactory::CreateDirectDraw method to create the + //DirectDraw surface, set the cooperative level, and get the address + //of an IDirectDraw interface pointer + hr = (pDDF->CreateDirectDraw(NULL, GetDesktopWindow(), DDSCL_NORMAL, + NULL, NULL, &pDD)); + + if (hr !=DD_OK) {//error checking + } + + //Now query for the new IDirectDraw3 interface, and release the old one. + hr =(pDD->QueryInterface(IID_IDirectDraw3, (LPVOID*)&pDD3)); + + if (hr !=S_OK) {//error checking + } + + //Release IDirectDraw + pDD->Release(); + pDD= NULL; + + //Initialize the DDSURFACEDESC structure for the primary surface + ZeroMemory(&ddsd, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_CAPS; + ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + hr = pDD3->CreateSurface(&ddsd, &pPrimarySurface, NULL); + + + //Do whatever you need to do in your application here with your + //DirectDraw surface + + //Release IDirectDraw3, IDirectDrawFactory, and the DirectDraw surface + pDD3->Release(); + pDDF->Release(); + pPrimarySurface->Release(); + + //Close the COM library + CoUninitialize(); +} + +Distinctions Between DirectDraw and DirectDrawEx +One important distinction to note between DirectDrawEx and DirectDraw is that applications that have created +multiple DirectDrawSurfaces through a DirectDrawEx surface must release every DirectDraw surface. +Also, calling the GetDDInterface method from any surface created under DirectDrawEx will return a pointer to +the IUnknown interface instead of a pointer to an IDirectDraw interface. Applications must use the +IUnknown::QueryInterface method to retrieve the IDirectDraw, IDirectDraw2, or IDirectDraw3 interfaces. +Finally, DirectDrawEx does not currently support blitting between surfaces created by DirectDrawEx and surfaces +created by DirectDraw. Applications should blit only between similar surfaces. + +© 1997 Microsoft Corporation. All rights reserved. Terms of Use. +*/ + +// DirectDrawEx API (undocumented) +HRESULT WINAPI extDllCanUnloadNow(void); +HRESULT WINAPI extDllGetClassObject(REFCLSID, REFIID, void **); +HRESULT WINAPI extDllRegisterServer(void); +HRESULT WINAPI extDllUnregisterServer(void); + +typedef HRESULT (WINAPI *DllCanUnloadNow_Type)(void); +typedef HRESULT (WINAPI *DllGetClassObject_Type)(REFCLSID, REFIID, void **); +typedef HRESULT (WINAPI *DllRegisterServer_Type)(void); +typedef HRESULT (WINAPI *DllUnregisterServer_Type)(void); + +DllCanUnloadNow_Type pDllCanUnloadNow; +DllGetClassObject_Type pDllGetClassObject; +DllRegisterServer_Type pDllRegisterServer; +DllUnregisterServer_Type pDllUnregisterServer; + +// DirectDrawEx class objects +HRESULT WINAPI extCreateDirectDrawEX(void *, GUID *, HWND, DWORD, DWORD, IUnknown *, IDirectDraw **); +HRESULT WINAPI extDirectDrawEnumerateEX(void *, LPDDENUMCALLBACK, LPVOID); + +typedef HRESULT (WINAPI *CreateDirectDrawEX_Type)(void *, GUID *, HWND, DWORD, DWORD, IUnknown *, IDirectDraw **); +typedef HRESULT (WINAPI *DirectDrawEnumerateEX_Type)(void *, LPDDENUMCALLBACK, LPVOID); + +CreateDirectDrawEX_Type pCreateDirectDrawEX = NULL; +DirectDrawEnumerateEX_Type pDirectDrawEnumerateEX = NULL; + +// static functions + +static char *sGUID(GUID *pGUID) +{ + static char sGUIDBuffer[81]; + switch ((DWORD)pGUID){ + case 0: return "(NULL)"; break; + case DDCREATE_EMULATIONONLY: return "DDCREATE_EMULATIONONLY"; break; + case DDCREATE_HARDWAREONLY: return "DDCREATE_HARDWAREONLY"; break; + default: sprintf(sGUIDBuffer, "%x.%x.%x.%x", pGUID->Data1, pGUID->Data2, pGUID->Data3, pGUID->Data4); return sGUIDBuffer; break; + } +} + +// Library hook + +static HookEntryEx_Type ddexHooks[]={ + {HOOK_HOT_CANDIDATE, 0x01, "DllCanUnloadNow", (FARPROC)NULL, (FARPROC *)&pDllCanUnloadNow, (FARPROC)extDllCanUnloadNow}, + {HOOK_HOT_CANDIDATE, 0x02, "DllGetClassObject", (FARPROC)NULL, (FARPROC *)&pDllGetClassObject, (FARPROC)extDllGetClassObject}, + {HOOK_HOT_CANDIDATE, 0x03, "DllRegisterServer", (FARPROC)NULL, (FARPROC *)&pDllRegisterServer, (FARPROC)extDllRegisterServer}, + {HOOK_HOT_CANDIDATE, 0x04, "DllUnregisterServer", (FARPROC)NULL, (FARPROC *)&pDllUnregisterServer, (FARPROC)extDllUnregisterServer}, + {HOOK_IAT_CANDIDATE, 0, 0, NULL, 0, 0} // terminator +}; + +void HookDirectDrawFactoryLib(HMODULE module) +{ + HookLibraryEx(module, ddexHooks, "ddrawex.dll"); +} + +// Objects Hook + +void HookDirectDrawFactory(void *obj) +{ + MessageBox(0,"Hooking IID_DirectDrawFactory object", "DxWnd", MB_OK); + OutTrace("Hooking IID_DirectDrawFactory object\n"); + SetHook((void *)(**(DWORD **)obj + 12), extCreateDirectDrawEX, (void **)&pCreateDirectDrawEX, "CreateDirectDraw(ex)"); + SetHook((void *)(**(DWORD **)obj + 16), extDirectDrawEnumerateEX, (void **)&pDirectDrawEnumerateEX, "DirectDrawEnumerate(ex)"); +} + +// API wrappers + +HRESULT WINAPI extDllCanUnloadNow(void) +{ + HRESULT res; + OutTraceDW("ddrawex#DllCanUnloadNow\n"); + res = (*pDllCanUnloadNow)(); + if(res) OutTraceE("ddrawex#DllCanUnloadNow ERROR: res=%x\n", res); + return res; +} + +HRESULT WINAPI extDllGetClassObject(REFCLSID rclsid, REFIID riid, void **out) +{ + HRESULT res; + OutTraceDW("ddrawex#DllGetClassObject: clsid=%x refiid=%x\n", rclsid, riid); + res = (*pDllGetClassObject)(rclsid, riid, out); + if(res) OutTraceE("ddrawex#DllGetClassObject ERROR: res=%x\n", res); + return res; +} + +HRESULT WINAPI extDllRegisterServer(void) +{ + HRESULT res; + OutTraceDW("ddrawex#DllRegisterServer\n"); + res = (*pDllRegisterServer)(); + if(res) OutTraceE("ddrawex#DllRegisterServer ERROR: res=%x\n", res); + return res; +} + +HRESULT WINAPI extDllUnregisterServer(void) +{ + HRESULT res; + OutTraceDW("ddrawex#DllUnregisterServer\n"); + res = (*pDllUnregisterServer)(); + if(res) OutTraceE("ddrawex#DllUnregisterServer ERROR: res=%x\n", res); + return res; +} + +// COM bject wrappers + +HRESULT WINAPI extCreateDirectDrawEX(void *ddf, GUID *pGUID, HWND hWnd, DWORD dwCoopLevelFlags, DWORD dwReserved, IUnknown *pUnkOuter, IDirectDraw **ppDirectDraw) +{ + HRESULT res; + if(IsTraceDW){ + OutTrace("CreateDirectDraw(EX): factory=%x guid=%s hwnd=%x coopflags=%x(%s)\n", + ddf, sGUID(pGUID), hWnd, dwCoopLevelFlags, ExplainCoopFlags(dwCoopLevelFlags)); + } + res = (*pCreateDirectDrawEX)(ddf, pGUID, hWnd, dwCoopLevelFlags, dwReserved, pUnkOuter, ppDirectDraw); + if(res){ + OutTraceE("CreateDirectDraw(EX) ERROR: res=%x\n"); + } + else { + OutTraceDW("CreateDirectDraw(EX): guid=%s pDirectDraw=%x\n", sGUID(pGUID), *ppDirectDraw); + } + + return res; +} + +HRESULT WINAPI extDirectDrawEnumerateEX(void *ddf, LPDDENUMCALLBACK lpCallback, LPVOID lpContext) +{ + HRESULT res; + OutTraceDW("DirectDrawEnumerate(EX): factory=%x\n", ddf); + res = (*pDirectDrawEnumerateEX)(ddf, lpCallback, lpContext); + if(res) OutTraceE("DirectDrawEnumerate(EX) ERROR: res=%x\n"); + return res; +} diff --git a/dll/dxhook.cpp b/dll/dxhook.cpp index a449987..68183b8 100644 --- a/dll/dxhook.cpp +++ b/dll/dxhook.cpp @@ -1418,7 +1418,7 @@ void HookInit(TARGETMAP *target, HWND hwnd) extern HINSTANCE hInst; typedef HHOOK (WINAPI *SetWindowsHookEx_Type)(int, HOOKPROC, HINSTANCE, DWORD); extern SetWindowsHookEx_Type pSetWindowsHookExA; - hMouseHook=(*pSetWindowsHookExA)(WH_GETMESSAGE, MessageHook, hInst, GetCurrentThreadId()); + hMouseHook =(*pSetWindowsHookExA)(WH_GETMESSAGE, MessageHook, hInst, GetCurrentThreadId()); if(hMouseHook==NULL) OutTraceE("SetWindowsHookEx WH_GETMESSAGE failed: error=%d\n", GetLastError()); } diff --git a/dll/dxwnd.vs2008.suo b/dll/dxwnd.vs2008.suo index d7efafe..b1a7d62 100644 Binary files a/dll/dxwnd.vs2008.suo and b/dll/dxwnd.vs2008.suo differ diff --git a/dll/dxwnd.vs2008.vcproj b/dll/dxwnd.vs2008.vcproj index 0ba64fe..a1c9194 100644 --- a/dll/dxwnd.vs2008.vcproj +++ b/dll/dxwnd.vs2008.vcproj @@ -273,6 +273,10 @@ /> + + diff --git a/dll/ole32.cpp b/dll/ole32.cpp index d28c39b..99f84f1 100644 --- a/dll/ole32.cpp +++ b/dll/ole32.cpp @@ -8,6 +8,7 @@ extern void HookModule(HMODULE, int); extern void HookDirectSoundObj(LPDIRECTSOUND *); +extern void HookDirectDrawFactory(void *); static BOOL bRecursedHook = FALSE; @@ -43,9 +44,10 @@ struct { } AddedModules[ADDITIONAL_MODULE_COUNT]= { {FALSE, "quartz"}, - {FALSE, "ddrawex"}, + //{FALSE, "ddrawex"}, //v2.03.71: hooking this library makes "WhiteOut" crash {FALSE, "amstream"}, - {FALSE, "dplayx"} + {FALSE, "dplayx"}, + {0, 0} // it seems necessary to also repeat the hook the main module .... }; static void HookAdditionalModules() @@ -103,7 +105,7 @@ HRESULT STDAPICALLTYPE extCoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, OutTraceDW("CoCreateInstance: ppv=%x->%x\n", *ppv, *(DWORD *)*ppv); - switch (*(DWORD *)&rclsid) { + switch (rclsid.Data1) { case 0xD7B70EE0: // CLSID_DirectDraw: // v2.03.18: fixed OutTraceDW("CoCreateInstance: CLSID_DirectDraw object\n"); @@ -143,14 +145,23 @@ HRESULT STDAPICALLTYPE extCoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, break; } break; - case 0xA65B8071: // CLSID_DxDiagProvider + case 0xA65B8071: // CLSID_DxDiagProvider: + if ((rclsid.Data2==0x3BFE) && (rclsid.Data3 == 0x4213)){ OutTraceDW("CoCreateInstance: CLSID_DxDiagProvider object\n"); - HookDxDiag(riid, ppv); + res=HookDxDiag(riid, ppv); + } break; case 0x47d4d946: // CLSID_DirectSound OutTraceDW("CoCreateInstance: CLSID_DirectSound object\n"); HookDirectSoundObj((LPDIRECTSOUND *)ppv); break; + case 0x4fd2a832: // CLSID_DirectDrawFactory + if ((rclsid.Data2==0x86c8) && (rclsid.Data3 == 0x11d0)){ + OutTraceDW("CoCreateInstance: CLSID_DirectDrawFactory object\n"); + HookDirectDrawFactory((void *)ppv); + } + break; + default: break; } @@ -186,25 +197,25 @@ HRESULT STDAPICALLTYPE extCoCreateInstanceEx(REFCLSID rclsid, IUnknown *punkOute // CLSID e436ebb3 implies loading quartz.dll to play movies through dshow: // quartz.dll must be hooked. - if (*(DWORD *)&rclsid==0xe436ebb3){ + switch (rclsid.Data1) { + case 0xe436ebb3: HMODULE qlib; OutTraceDW("CoCreateInstanceEx: CLSID_FilterGraph RIID=%x\n", *(DWORD *)&riid); qlib=(*pLoadLibraryA)("quartz.dll"); OutTraceDW("CoCreateInstanceEx: quartz lib handle=%x\n", qlib); HookModule(qlib, 0); - } - - if (*(DWORD *)&rclsid==*(DWORD *)&CLSID_DirectDraw){ + break; + case 0xD7B70EE0: // CLSID_DirectDraw: extern void HookDDSession(LPDIRECTDRAW *, int); - OutTraceDW("CoCreateInstance: CLSID_DirectDraw object\n"); + OutTraceDW("CoCreateInstanceEx: CLSID_DirectDraw object\n"); switch (*(DWORD *)&riid){ LPDIRECTDRAW lpOldDDraw; case 0x6C14DB80: - OutTraceDW("CoCreateInstance: IID_DirectDraw RIID\n"); + OutTraceDW("CoCreateInstanceEx: IID_DirectDraw RIID\n"); HookDDSession((LPDIRECTDRAW *)ppv, 1); break; case 0xB3A6F3E0: - OutTraceDW("CoCreateInstance: IID_DirectDraw2 RIID\n"); + OutTraceDW("CoCreateInstanceEx: IID_DirectDraw2 RIID\n"); res=extDirectDrawCreate(NULL, &lpOldDDraw, 0); if(res)OutTraceDW("DirectDrawCreate: res=%x(%s)\n", res, ExplainDDError(res)); res=lpOldDDraw->QueryInterface(IID_IDirectDraw2, (LPVOID *)ppv); @@ -212,7 +223,7 @@ HRESULT STDAPICALLTYPE extCoCreateInstanceEx(REFCLSID rclsid, IUnknown *punkOute lpOldDDraw->Release(); break; case 0x9C59509A: - OutTraceDW("CoCreateInstance: IID_DirectDraw4 RIID\n"); + OutTraceDW("CoCreateInstanceEx: IID_DirectDraw4 RIID\n"); res=extDirectDrawCreate(NULL, &lpOldDDraw, 0); if(res)OutTraceDW("DirectDrawCreate: res=%x(%s)\n", res, ExplainDDError(res)); res=lpOldDDraw->QueryInterface(IID_IDirectDraw4, (LPVOID *)ppv); @@ -220,16 +231,26 @@ HRESULT STDAPICALLTYPE extCoCreateInstanceEx(REFCLSID rclsid, IUnknown *punkOute lpOldDDraw->Release(); break; case 0x15E65EC0: - OutTraceDW("CoCreateInstance: IID_DirectDraw7 RIID\n"); + OutTraceDW("CoCreateInstanceEx: IID_DirectDraw7 RIID\n"); res=extDirectDrawCreateEx(NULL, (LPDIRECTDRAW *)ppv, IID_IDirectDraw7, 0); if(res)OutTraceDW("DirectDrawCreateEx: res=%x(%s)\n", res, ExplainDDError(res)); break; case 0xE436EBB3: break; } + break; + case 0xA65B8071: // CLSID_DxDiagProvider: + if ((rclsid.Data2==0x3BFE) && (rclsid.Data3 == 0x4213)){ + OutTraceDW("CoCreateInstanceEx: CLSID_DxDiagProvider object\n"); + res=HookDxDiag(riid, ppv); + } + break; + case 0x4fd2a832: // CLSID_DirectDrawFactory + if ((rclsid.Data2==0x86c8) && (rclsid.Data3 == 0x11d0)){ + OutTraceDW("CoCreateInstanceEx: CLSID_DirectDrawFactory object\n"); + HookDirectDrawFactory((LPDIRECTSOUND *)ppv); } - else { - if (*(DWORD *)&rclsid==*(DWORD *)&CLSID_DxDiagProvider) res=HookDxDiag(riid, ppv); + break; } } diff --git a/dll/syslibs.h b/dll/syslibs.h index 3051c58..997f5fa 100644 --- a/dll/syslibs.h +++ b/dll/syslibs.h @@ -423,7 +423,8 @@ DXWEXTERN GetWindowRect_Type pGetWindowRect DXWINITIALIZED; DXWEXTERN InvalidateRect_Type pInvalidateRect DXWINITIALIZED; DXWEXTERN MapWindowPoints_Type pMapWindowPoints DXWINITIALIZED; DXWEXTERN MoveWindow_Type pMoveWindow DXWINITIALIZED; -DXWEXTERN PeekMessage_Type pPeekMessage DXWINITIALIZED; +DXWEXTERN PeekMessage_Type pPeekMessageA DXWINITIALIZED; +DXWEXTERN PeekMessage_Type pPeekMessageW DXWINITIALIZED; DXWEXTERN RedrawWindow_Type pRedrawWindow DXWINITIALIZED; DXWEXTERN RegisterClassExA_Type pRegisterClassExA DXWINITIALIZED; DXWEXTERN RegisterClassA_Type pRegisterClassA DXWINITIALIZED; @@ -652,7 +653,8 @@ extern BOOL WINAPI extGetWindowRect(HWND, LPRECT); extern BOOL WINAPI extInvalidateRect(HWND, RECT *, BOOL); extern int WINAPI extMapWindowPoints(HWND, HWND, LPPOINT, UINT); extern BOOL WINAPI extMoveWindow(HWND, int, int, int, int, BOOL); -extern BOOL WINAPI extPeekMessage(LPMSG, HWND, UINT, UINT, UINT); +extern BOOL WINAPI extPeekMessageA(LPMSG, HWND, UINT, UINT, UINT); +extern BOOL WINAPI extPeekMessageW(LPMSG, HWND, UINT, UINT, UINT); extern BOOL WINAPI extRedrawWindow(HWND, const RECT *, HRGN, UINT); extern ATOM WINAPI extRegisterClassExA(WNDCLASSEXA *); extern ATOM WINAPI extRegisterClassA(WNDCLASSA *); diff --git a/dll/user32.cpp b/dll/user32.cpp index 31743bf..e2d3ff6 100644 --- a/dll/user32.cpp +++ b/dll/user32.cpp @@ -105,6 +105,9 @@ BOOL WINAPI extShowScrollBar(HWND, int, BOOL); typedef BOOL (WINAPI *DrawMenuBar_Type)(HWND); DrawMenuBar_Type pDrawMenuBar = NULL; BOOL WINAPI extDrawMenuBar(HWND); +//typedef BOOL (WINAPI *TranslateMessage_Type)(MSG *); +//TranslateMessage_Type pTranslateMessage = NULL; +//BOOL WINAPI extTranslateMessage(MSG *); #ifdef TRACEPALETTE @@ -117,6 +120,9 @@ UINT WINAPI extSetDIBColorTable(HDC, UINT, UINT, const RGBQUAD *); #endif static HookEntryEx_Type Hooks[]={ + + //{HOOK_IAT_CANDIDATE, 0, "TranslateMessage", (FARPROC)TranslateMessage, (FARPROC *)&pTranslateMessage, (FARPROC)extTranslateMessage}, + {HOOK_IAT_CANDIDATE, 0, "UpdateWindow", (FARPROC)NULL, (FARPROC *)&pUpdateWindow, (FARPROC)extUpdateWindow}, //{HOOK_IAT_CANDIDATE, 0, "GetWindowPlacement", (FARPROC)NULL, (FARPROC *)&pGetWindowPlacement, (FARPROC)extGetWindowPlacement}, //{HOOK_IAT_CANDIDATE, 0, "SetWindowPlacement", (FARPROC)NULL, (FARPROC *)&pSetWindowPlacement, (FARPROC)extSetWindowPlacement}, @@ -244,8 +250,8 @@ static HookEntryEx_Type ScaledHooks[]={ }; static HookEntryEx_Type PeekAllHooks[]={ - {HOOK_IAT_CANDIDATE, 0, "PeekMessageA", (FARPROC)NULL, (FARPROC *)&pPeekMessage, (FARPROC)extPeekMessage}, - {HOOK_IAT_CANDIDATE, 0, "PeekMessageW", (FARPROC)NULL, (FARPROC *)&pPeekMessage, (FARPROC)extPeekMessage}, + {HOOK_IAT_CANDIDATE, 0, "PeekMessageA", (FARPROC)PeekMessageA, (FARPROC *)&pPeekMessageA, (FARPROC)extPeekMessageA}, + {HOOK_IAT_CANDIDATE, 0, "PeekMessageW", (FARPROC)PeekMessageW, (FARPROC *)&pPeekMessageW, (FARPROC)extPeekMessageW}, {HOOK_IAT_CANDIDATE, 0, 0, NULL, 0, 0} // terminator }; @@ -973,14 +979,9 @@ LRESULT WINAPI extSendMessage(char *apiname, SendMessage_Type pSendMessage, HWND } LRESULT WINAPI extSendMessageA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - return extSendMessage("SendMessageA", pSendMessageA, hwnd, Msg, wParam, lParam); -} - +{ return extSendMessage("SendMessageA", pSendMessageA, hwnd, Msg, wParam, lParam); } LRESULT WINAPI extSendMessageW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - return extSendMessage("SendMessageW", pSendMessageW, hwnd, Msg, wParam, lParam); -} +{ return extSendMessage("SendMessageW", pSendMessageW, hwnd, Msg, wParam, lParam); } HCURSOR WINAPI extSetCursor(HCURSOR hCursor) { @@ -1061,7 +1062,7 @@ BOOL WINAPI extSetCursorPos(int x, int y) return res; } -BOOL WINAPI extPeekMessage(LPMSG lpMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg) +static BOOL WINAPI extPeekMessage(PeekMessage_Type pPeekMessage, LPMSG lpMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg) { BOOL res; @@ -1091,6 +1092,11 @@ BOOL WINAPI extPeekMessage(LPMSG lpMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsg return res; } +BOOL WINAPI extPeekMessageA(LPMSG lpMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg) +{ return extPeekMessage(pPeekMessageA, lpMsg, hwnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg); } +BOOL WINAPI extPeekMessageW(LPMSG lpMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg) +{ return extPeekMessage(pPeekMessageW, lpMsg, hwnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg); } + BOOL WINAPI extClientToScreen(HWND hwnd, LPPOINT lppoint) { // v2.02.10: fully revised to handle scaled windows @@ -3695,4 +3701,25 @@ BOOL WINAPI extDrawMenuBar(HWND hWnd) ret=(*pDrawMenuBar)(hWnd); if(!ret) OutTraceE("DrawMenuBar ERROR: err=%d\n", GetLastError()); return ret; -} \ No newline at end of file +} + +#if 0 +BOOL WINAPI extTranslateMessage(MSG *pMsg) +{ + BOOL ret; + OutTraceDW("TranslateMessage: type=%x pos=(%d,%d)\n", pMsg->message, pMsg->pt.x, pMsg->pt.y); + if(dxw.Windowize){ + + pMsg->pt=dxw.ScreenToClient(pMsg->pt); + pMsg->pt=dxw.FixCursorPos(pMsg->pt); + + pMsg->pt.x *= 4; + pMsg->pt.y *= 4; + //if((pMsg->message <= WM_MOUSELAST) && (pMsg->message >= WM_MOUSEFIRST)) + // pMsg->lParam = MAKELPARAM(pMsg->pt.x, pMsg->pt.y); + OutTraceDW("TranslateMessage: new pos=(%d,%d)\n", pMsg->pt.x, pMsg->pt.y); + } + ret=(*pTranslateMessage)(pMsg); + return ret; +} +#endif \ No newline at end of file diff --git a/dll/winproc.cpp b/dll/winproc.cpp index a1f3816..59e58e7 100644 --- a/dll/winproc.cpp +++ b/dll/winproc.cpp @@ -260,10 +260,11 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp } if(LastTimeShift != dxw.TimeShift){ - extern void SetVSyncDelays(LPDIRECTDRAW); + extern void SetVSyncDelays(int, LPDIRECTDRAW); extern LPDIRECTDRAW lpPrimaryDD; + extern int iBakBufferVersion; if(dxw.dwFlags4 & STRETCHTIMERS) dxw.RenewTimers(); - if(lpPrimaryDD) SetVSyncDelays(lpPrimaryDD); + if(lpPrimaryDD) SetVSyncDelays(iBakBufferVersion, lpPrimaryDD); LastTimeShift=dxw.TimeShift; } diff --git a/host/TabProgram.cpp b/host/TabProgram.cpp index 6f3775c..0cce3dd 100644 --- a/host/TabProgram.cpp +++ b/host/TabProgram.cpp @@ -160,14 +160,21 @@ BOOL CTabProgram::OnInitDialog() CDialog::OnInitDialog(); CTargetDlg *cTarget = ((CTargetDlg *)(this->GetParent()->GetParent())); Hinst = ::LoadLibrary(cTarget->m_FilePath); - if(!Hinst) return TRUE; - Icon = ::ExtractIcon(Hinst, cTarget->m_FilePath, 0); - IconBox=(CStatic *)this->GetDlgItem(IDC_STATIC_ICON); - PrevIcon = IconBox->SetIcon(Icon); - if (IconBox->GetIcon() == NULL) - IconBox->SetIcon(::LoadIcon(NULL, IDI_ERROR)); - ::FreeLibrary(Hinst); - if(PrevIcon) ::DestroyIcon(PrevIcon); + if(Hinst){ + Icon = ::ExtractIcon(Hinst, cTarget->m_FilePath, 0); + IconBox=(CStatic *)this->GetDlgItem(IDC_STATIC_ICON); + PrevIcon = IconBox->SetIcon(Icon); + if (IconBox->GetIcon() == NULL) + IconBox->SetIcon(::LoadIcon(NULL, IDI_ERROR)); + ::FreeLibrary(Hinst); + if(PrevIcon) ::DestroyIcon(PrevIcon); + } + + IconBox=(CStatic *)this->GetDlgItem(IDC_NOTES); + if(cTarget->m_Notes.IsEmpty()) IconBox->SetBitmap(NULL); + + IconBox=(CStatic *)this->GetDlgItem(IDC_REGISTRY); + if(cTarget->m_Registry.IsEmpty()) IconBox->SetBitmap(NULL); m_EditPosX.SubclassDlgItem(IDC_POSX, this); m_EditPosY.SubclassDlgItem(IDC_POSY, this); diff --git a/host/dxwndhost.aps b/host/dxwndhost.aps index d76af9d..181d7cd 100644 Binary files a/host/dxwndhost.aps and b/host/dxwndhost.aps differ diff --git a/host/dxwndhost.rc b/host/dxwndhost.rc index 46ca319..04d385a 100644 Binary files a/host/dxwndhost.rc and b/host/dxwndhost.rc differ diff --git a/host/dxwndhost.vs2008.suo b/host/dxwndhost.vs2008.suo index 54599a1..93a3e43 100644 Binary files a/host/dxwndhost.vs2008.suo and b/host/dxwndhost.vs2008.suo differ diff --git a/host/dxwndhost.vs2008.vcproj b/host/dxwndhost.vs2008.vcproj index 3489566..bbe4e0b 100644 --- a/host/dxwndhost.vs2008.vcproj +++ b/host/dxwndhost.vs2008.vcproj @@ -625,6 +625,10 @@ RelativePath=".\res\bitmap1.bmp" > + + @@ -649,10 +653,18 @@ RelativePath=".\res\idr_main.ico" > + + + + diff --git a/host/dxwndhostView.cpp b/host/dxwndhostView.cpp index 5798398..70f4d92 100644 --- a/host/dxwndhostView.cpp +++ b/host/dxwndhostView.cpp @@ -2530,6 +2530,16 @@ void CDxwndhostView::OnRun() } } + if((TargetMaps[i].flags3 & EMULATEREGISTRY) || (TargetMaps[i].flags4 & OVERRIDEREGISTRY)){ + FILE *regfp; + char *Registry; + Registry = PrivateMaps[i].registry; + regfp=fopen("dxwnd.reg", "w"); + if(regfp==NULL)MessageBox("Error writing virtual registry file", "Error", MB_ICONERROR|MB_OK); + fwrite(Registry, strlen(Registry), 1, regfp); + fclose(regfp); + } + if(TargetMaps[i].flags2 & STARTDEBUG){ ThreadInfo_Type ThreadInfo; ThreadInfo.TM=&TargetMaps[i]; diff --git a/host/host.aps b/host/host.aps index 7892e20..561c5ce 100644 Binary files a/host/host.aps and b/host/host.aps differ diff --git a/host/res/notes.bmp b/host/res/notes.bmp new file mode 100644 index 0000000..13dcbe2 Binary files /dev/null and b/host/res/notes.bmp differ diff --git a/host/res/registry.bmp b/host/res/registry.bmp new file mode 100644 index 0000000..62fbf79 Binary files /dev/null and b/host/res/registry.bmp differ diff --git a/host/resource b/host/resource index 0b391aa..d81bb2b 100644 Binary files a/host/resource and b/host/resource differ