w32api question

Chris Sutcliffe ir0nh34d@gmail.com
Tue Jul 20 16:35:00 GMT 2010


On 20 July 2010 10:32, Corinna Vinschen wrote:
> Can you please explain this a bit more?  What exactly are these
> applications doing?  I'm asking because one way to extract the constants
> via an application is "grep" in the VC++ include directory.  How are the
> apps in question extracting constants?

One example is the following code employed by a user to determine the
value IID_IActiveDesktop:

#include <windows.h>
#include <shlguid.h>
#include <stdio.h>
#include <string.h>

void print_guid(const char *name, const GUID *guid)
{
	int mem[4]; /* Assume sizeof(int) == 4 */
	int i;

	memcpy(mem, guid, sizeof(mem));

	printf("%s: 0x", name);
	for (i = 0; i < 4; i++)
		printf("%X", mem[i]);
	printf("\n");
}

int main(void) {
	GUID template = IID_IShellView2;
	GUID cls = CLSID_ActiveDesktop;
	GUID iid = IID_IActiveDesktop;

	print_guid("template", &template);
	print_guid("cls", &cls);
	print_guid("iid", &iid);

	return 0;
}

This code was compiled VC++ and run to extract IID_IActiveDesktop.
From what the OP stated, he never looked at the header files, just
used this 'blackbox' approach.

> FYI, I already asked for legal advice about the situation with Mingw64,
> which is different, but might give some important insight.  kIf you give
> me some hints about these apps, I'll forward your request as well.  The
> reply might take some time, though.

No worries, I would very much appreciate the legal advice around this
and will gladly hold off doing anything with the patch until I've
heard back.

Thank you,

Chris

-- 
Chris Sutcliffe
http://emergedesktop.org
http://www.google.com/profiles/ir0nh34d



More information about the Cygwin-apps mailing list