This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: w32api question
- From: Chris Sutcliffe <ir0nh34d at gmail dot com>
- To: cygwin-apps at cygwin dot com
- Date: Wed, 6 Oct 2010 07:34:23 -0400
- Subject: Re: w32api question
- References: <AANLkTil-JgLSj4OiPLDzRb3FJ0wAmlPJ4jxQlHwWN-7n@mail.gmail.com> <20100720143255.GS6944@calimero.vinschen.de> <AANLkTikHn1nJDHaLG8bPJIDcolPBDYBgW16_kJY1SXH_@mail.gmail.com> <20100720165823.GA6723@calimero.vinschen.de>
Hi Corinna,
On 20 July 2010 12:58, Corinna Vinschen wrote:
> On Jul 20 11:51, Chris Sutcliffe wrote:
>> 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.
>
> Hmm, that looks... interesting. ?No worries for the CLSID value which
> can easily be extracted from the registry (HKEY_CLASSES_ROOT\CLSID),
> but otherwise...
>
>> > 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.
>
> Ok, I'll forward this problem.
Did you have a chance to follow up on the 'blackbox' approach to
including IActiveDesktop in w32api?
Thank you,
Chris
--
Chris Sutcliffe
http://emergedesktop.org
http://www.google.com/profiles/ir0nh34d