My Wine static analysis tool

André Hentschel nerv at
Tue Jan 15 13:06:38 CST 2013

Am 15.01.2013 18:51, schrieb Damjan Jovanovic:
> Hi
> I've hacked together a simple tool for analyzing Wine code. Currently
> it can do the following:
> 1. Find BOOL functions returning non-BOOL.
> 2. Find HRESULT functions returning non-HRESULTs.
> 3. Generate a TRACE() for each function showing all its parameters.
> It isn't really a formal C parser, as it ignores all preprocessor
> directives, but this makes it *much* simpler and shorter than a real C
> parser, and it sees original Windows types like LPCWSTR etc. It's not
> 100% accurate, but it's very effective. 3 of my recent patches have
> been generated with its help - and I've barely gotten started.
> I'd like to add the following features at some stage:
> * Populate all functions with a TRACE() of their arguments, if they
> don't already have it.
> * Scan all GUIDs in include/ and generate a full list of all GUIDs and
> their names. Then patch debugstr_guid() to also output the name of the
> GUID when available, and/or search and replace GUIDs in WINEDEBUG
> traces after they've been recorded.
> * Update .spec files from .c file contents, and verify .spec file accuracy.
> * It could be extended to examine contents of functions and enforce
> the absence of W->A and 32->16 calls, etc.
> * etc.

I'd say put it on github. Which language do you use? I have a hacked tool for one feature, maybe i'll clean it up and send a patch/git-pull-request.


Best Regards, André Hentschel

More information about the wine-devel mailing list