DWMaxx going Open Source
February 4, 2008 on 6:32 am | In DWMaxx, Development, Projects |I’ve decided that for the good of this project, I may be best for it to go open source. So that’s it, DWMaxx is open sourced! It is distributed under GPLv2 (to prevent people from using it for commercial purposes). Of course, it doesn’t mean that I’m letting this project down, not at all! But I don’t want it to finish like SPrintWindow (I still have to commit the sources somewhere…).
I’ll try to comment the code as often as I can, and write documentations too.
Anyway, you can now find everything on the DWMaxx Google Code project page.
On a side note, I’ve been working pretty hard to get 3D window rotations working. I think I’m on something, but it might be trickier than I thought (because theses things are quite hard-wired inside the DWM). I’ll keep you guys posted.
38 Comments »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^
Great news !! thanks a lot !
is it possible to have a precompiled demo !?
Comment by Christian — February 4, 2008 #
Coool!!!! Great news
….
unfortunatly it can’t be compiled. in file CTopLevelWindow3D.cpp at line 36 is ) at the end of line is absent. should be ));
in injector.cpp line 219 - GetThreadId idenifier not found.
Comment by Nesher — February 4, 2008 #
milcore.lib is absent
Comment by Nesher — February 4, 2008 #
My bad, I’ve fixed the compilation errors and added milcore.lib in revision 4
Comment by siwu — February 4, 2008 #
Hello,
thank you very much. It compiled but there’s an error IDWMInjector::GetDWMExObject always return a null pointer (0×0000000) is there anything to do. I register dwmaxx and dwmaxxPS and i patch uDWM.dll. Can you explain how to configure the code for a first excecution. :):):)
Comment by xvanneste — February 4, 2008 #
Well it’s ok. Thank you very good work. :D:D:D
Comment by xvanneste — February 4, 2008 #
After executing injector->GetDWMExObject(&dwmObject); - dwmObject = 0×0
In slider, _injector.GetDWMExObject(out _dwm); _dwm is Null.
is there anything I should do besides compile and start?
I have seen there is a directory Pack with udwm.dll file and bat files. Do I have to start install_udwm.bat?
udwm.dll in Pack directory is the same that I have in windows\system32 (compared with fc.exe).
Comment by Nesher — February 4, 2008 #
I had the same problem. When you compile with visual studio on vista, it don’t register com component you need to register manually with regsvr32 dwmaxx.dll and dwmaxxps.dll. after start the tester (you need to start notepad.exe before) and is the tester is ok you can start slider for exemple
(uDWM.dll doesn’t need to be patch)
Comment by xvanneste — February 5, 2008 #
I have compiled on Vista with Visual Studio 2008. then registered dwmaxx.dll and dwmaxxps.dll. I didn’t replaced udwm, because it’s the same as I already have.
Started notepad, and then dwmaxx_test inside Visual Studio. Traced until .GetDWMExObject. Got 0×000000.
Also tried on Vista with SP1. Fails on injection
Comment by Nesher — February 5, 2008 #
xvanneste - are you from France? siwu is also from France (as I understand). Dumb question
- Can it be that DWMaxx works only on France edition of Vista (udwm has other method adresses in non france edition) ?
Comment by Nesher — February 5, 2008 #
Fantastic, just downloaded the source and compiled successfuly and it working like a charm, had some issues whan trying to run it as an administrator but appart from that its all good. I know what im going to be working on tonight
Comment by Pleh — February 5, 2008 #
In injector.cpp:
HRESULT hRes = GetActiveObject(CLSID_DWMEx, NULL, &unknownObject);
returns with hRes = 0×800401e3 “Operation unavailable”. I have searched in google and found this: http://support.microsoft.com/kb/238610/en-us
Can this be a problem?
Comment by Nesher — February 5, 2008 #
@Nesher: Indeed, I’m french, but I use the US version of Vista (can’t stand the french version).

However, because I’m using hardcoded RVAs (Relative Virtual Addresses), I need to ship a proper version of uDWM.dll (as new version might change RVAs, or optimisations).
So just in case I’ve put udwm.dll in the rep. As I understand yours is the same (compared with fc), you shouldn’t have to install it.
I would strongly suggest you to build and test with VS2005, as I had the same issue with VS2008b2 (the SAME code, from the wizard doesn’t work on VS2008b2 where it would on VS2005).
Also it seems you problems is that for some reason, the DWMaxx doesn’t register itself to the ROT (Runtime Object Table). I’ll commit a quick utility to verify if DWMaxx is indeed running properly inside the DWM (that is, injected and registered). In the mean time, you can try to download irotview.exe (google it), and check if the GUID {9C797EE5-8465-4980-B028-4244CB7740B2} is present (this is the GUID of IDWMEx). If it is, that means the DWMEx object is correctly registered. And you have another problem
Hope it’ll help you out
Comment by siwu — February 5, 2008 #
I use vista english and VS 2008 and everything work good
And yes i’m french :p. I will test on Vista SP1 :s I hope everything will be ok too
Comment by xvanneste — February 5, 2008 #
Ok I reproduce the issue, do you try to reboot, that work fine for me
Comment by xvanneste — February 5, 2008 #
Great. Compiled with VS2008 on Vista. Registered dwmaxx.dll and dwmaxxps.dll then rebooted. now it’s working

Cool, thank you all
Comment by Nesher — February 5, 2008 #
Don’t work with SP1 (refresh 2) :(. Is it possible to generate RVAs from new uDWM? With IDA?
Comment by Nesher — February 5, 2008 #
It looks like window positioning isnt working, either through SetWindowOffset or SetWindowMatrix. It does not return an error, it just doesnt reposition the window. Any ideas?
Comment by Pleh — February 5, 2008 #
Updated udwm_rva.h. Now it’s working on Vista SP1 Refresh 2 (non RTM).
Comment by Nesher — February 6, 2008 #
Can you put udwm_rva.h on download ??
Comment by xvanneste — February 7, 2008 #
I hope the adresses are correct. The injection and window rotation is working.
http://rapidshare.com/files/89959282/udwm_rva.h.html
(for Vista SP1 Refresh Update 2 - non RTM)
Comment by Nesher — February 7, 2008 #
@Nesher: I’ve uploaded your udwm_rva.h file on the DWMaxx Wiki. Thanks for making it
However, I would not suggest using it, because the compiler optimisations might be the same as the original udwm.dll, which can cause DWMaxx to crash (mainly
thisbeing passed on other registers). However, I’ll move on to the SP1 version of udwm.dll.Comment by siwu — February 11, 2008 #
@siwu: How did you generated original udwm_rva.h file?
Comment by Nesher — February 11, 2008 #
@Nesher: Using a small IDC script in IDA. However, I kinda made it on purpose, since I prefer to deploy my own uDWM.dll rather than having the preople download a 1mb file, and custom generate RVAs. That’s why it’s hardcoded inside the dll, and not in a separate file like with SPrintWindow. However, the best way to do that would be to use a program that fetches the PDB, and generate that file, like InfoFetch for SPrintWindow. Is there any way you could send the uDWM.dll from Vista SP1? I’d like to see if it works when I replace my RTM version with it
Comment by siwu — February 12, 2008 #
is anyone able to get window positioning working? if so, can you post a c# example, or modify the existing one to show how to use it?
Thanks
Comment by Pleh — February 12, 2008 #
@Pleh: use IDWMEx::SetWindowMatrix(), as the IDWMEx::SetWindowOffset() code is commented.
Also, folks, please remember that this is NOT a release! This is development code at the moment!
Comment by siwu — February 12, 2008 #
I think i tried SetWindowMatrix and it had no effect, i will double check and let you know.
Comment by Pleh — February 12, 2008 #
I just gave it another go with SetWindowMatrix and its not having any effect. This is what im trying…
_dwm.SetWindowMatrix(WindowHandle, 10, 10, 1, 1, 0)
this should position the window at screen coordinates of 10,10 but it just leaves the window in exactly the same place, am i using it wrong? I know everything else is working because if i try…
_dwm.SetWindowMatrix(WindowHandle, 10, 10, 2, 2, 1)
I get the window twice as big at a 45 degree angle. Ive also tried extreem values to see if made any difference and it appears to be doing nothing.
Comment by Pleh — February 12, 2008 #
@siwu: here is udwm.dll from sp1
Is there any other place where I can download it?
http://rapidshare.com/files/91266351/uDWM.dll.html
Where can I get InfoFetch? What IDC script have you used?
I have tried to download SPrintWindow, but expire.free.fr is broken
Do you think it will be possible to make VisualBrush from a Window?
Comment by Nesher — February 12, 2008 #
I just found what my problem was, the position is never getting used in SetWindowMatrix and is commented out like you said in SetPosition. Here is the 2 lines of code that need to be added to fix it…
D3DXMatrixTranslation(&tmpMatrix, x, y, 0.0f);
D3DXMatrixMultiply(&endMatrix, &endMatrix, &tmpMatrix);
in CVisual.cpp line 121
Now its working like a charm
Comment by Pleh — February 12, 2008 #
@Pleh: Indeed, your patch is exactly right
Also, just for the record:
The rotation for the CVisual object is done around the upper left corner of the object (window). This code moves the rotation center at the center of the object. Ultimately, it’ll be possible to make a rotation around a specified center
Comment by siwu — February 13, 2008 #
Thats exactly what I got from reading the code, I was thinking of modifying it to take 2 more parameters (an x and y coordinate for the center of rotation) so I could do just that
I will post a video of what im working on once I have it working nicely
Comment by Pleh — February 13, 2008 #
I confirm that dwmaxx doesn’t work on Vista SP1. This is because DWM.exe and Dwmredir.dll are different on sp1. I try to recreate RVA
Comment by xvanneste — February 16, 2008 #
@xvanneste: did you tried my RVA? (look at googlecode wiki)
Comment by Nesher — February 16, 2008 #
Yeah you can use it for the rtm :):):) Thanks a lot
Comment by xvanneste — February 16, 2008 #
@siwu: do you know if CVisual->Size client area size, or full window size?
Any ideas?
I’m making a program that converts input coordinates and allow to interact with rotated windows. Unfortunatly each program gets its own offset
Comment by Nesher — February 27, 2008 #
I’m doing full screen capture on Vista with aeroglass on. GDI and DX9 API are very slow -> I get 20fps at most with a whole CPU core utilized at maximum. Interestingly DWM.exe consumes half of the CPU time and my program the other half. I compiled and run unsuccessfully dwmaxx. I’m trying to see if if is possible to get a DX9 surface of the whole screen. Then I need to do some postprocessing with a pixel shader (so I prefer DX9 texture surface, cause it is passed easily to PX shader). SIFU, what tools are you using to reverse engineer DWM? Do you have some hints on how to capture the whole screen?
Comment by Glen — April 2, 2008 #
@Glen: I’m mainly using IDA Pro, and a second computer to restart DWM when it crashes.
About the capture screen thing, the simplest way is to go the Fraps way: hook IDirect3DDevice9::BeginScene to render to a texture, and put that texture on an orthogonal transformed screen, and hook IDirect3DDevice9::Present to extract that very texture back to your program
It’s basically the same as if you were capturing a game’s video. But be careful, as the Direct3D Device doesn’t reside in DWM.exe, but in milcore.dll (when you look for the symbol), as DWM just uses a MIL channel to render.
Comment by siwu — May 7, 2008 #