This is the mail archive of the 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]

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

I couldn't get 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
are declared extern "C" so the function calls should work the same.

Here are the relevant pieces of code.

src/winsup/cinstall/ (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:
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 <>

    * (check_shortcut): Change arguments from values to pointers.

Attachment: cinstall-mac-020418-1.patch
Description: Binary data

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