This is the mail archive of the cygwin-apps mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: w32api question

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]);

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 Sutcliffe

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]