[PATCH]setup.exe mklink2.cc some function arguments need to be pointers

Michael A Chase mchase@ix.netcom.com
Thu Apr 18 14:32:00 GMT 2002

I couldn't get mklink2.cc to compile until I made the attached changes.

It appears that CoCreateInstance() and sl->lpVtbl->QueryInterface() are
looking for pointers to values in certain arguments instead of the values.
Almost the exact same code is used in src/winsup/cygwin/shortcut.c except
for the '&'s and it compiles cleanly.  Both functions defined in mklink2.cc
are declared extern "C" so the function calls should work the same.

Here are the relevant pieces of code.

src/winsup/cinstall/mklink2.cc (make_link_2):
23:   CoCreateInstance (CLSID_ShellLink, NULL,
24:             CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID *) & sl);
25:   sl->lpVtbl->QueryInterface (sl, IID_IPersistFile, (void **) &pf);

src/winsup/cygwin/shortcut.c (check_shortcut):
85:   hres = CoCreateInstance (&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
86:                &IID_IShellLink, (void **)&psl);
87:   if (FAILED (hres))
88:     goto close_it;
89:   /* Get a pointer to the IPersistFile interface. */
90:   hres = psl->lpVtbl->QueryInterface (psl, &IID_IPersistFile, (void

640: EXTERN_C const IID IID_IPersistFile;

76: extern const GUID IID_IPersistFile;

13: extern const GUID CLSID_ShellLink;
28: extern const GUID IID_IShellLinkA;
68: #define IID_IShellLink  IID_IShellLinkA

 6: DEFINE_SHLGUID(CLSID_ShellLink,0x00021401L,0,0);
21: DEFINE_SHLGUID(IID_IShellLinkA,0x000214EEL,0,0);

226: DEFINE_GUID(IID_IPersistFile,0x10b,0,0,0xc0,0,0,0,0,0,0,0x46);

Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.


2002-04-18  Michael A Chase <mchase@ix.netcom.com>

    * mklink2.cc (check_shortcut): Change arguments from values to pointers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cinstall-mac-020418-1.patch
Type: application/octet-stream
Size: 629 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20020418/4492d48e/attachment.obj>

More information about the Cygwin-patches mailing list