X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/073e9f42f40b00c570bacb92c54cd7b83b13fa31..e99bb8bfc8d2c1a47b6ae90ef43683d191c30f66:/windows/winjump.c diff --git a/windows/winjump.c b/windows/winjump.c index 6552e074..563d42cd 100644 --- a/windows/winjump.c +++ b/windows/winjump.c @@ -40,6 +40,11 @@ typedef struct _tagpropertykey { #define _REFPROPVARIANT_DEFINED typedef PROPVARIANT *REFPROPVARIANT; #endif +/* MinGW doesn't define this yet: */ +#ifndef _PROPVARIANTINIT_DEFINED_ +#define _PROPVARIANTINIT_DEFINED_ +#define PropVariantInit(pvar) memset((pvar),0,sizeof(PROPVARIANT)) +#endif #define IID_IShellLink IID_IShellLinkA @@ -348,7 +353,12 @@ static const PROPERTYKEY PKEY_Title = { 0x00000002 }; -#define COMPTR(type, obj) &IID_##type, ((sizeof((obj)-(type **)(obj))), (obj)) +/* Type-checking macro to provide arguments for CoCreateInstance() etc. + * The pointer arithmetic is a compile-time pointer type check that 'obj' + * really is a 'type **', but is intended to have no effect at runtime. */ +#define COMPTR(type, obj) &IID_##type, \ + (void **)(void *)((obj) + (sizeof((obj)-(type **)(obj))) \ + - (sizeof((obj)-(type **)(obj)))) static char putty_path[2048]; @@ -653,11 +663,9 @@ static void update_jumplist_from_registry(void) } /* Clears the entire jumplist. */ -static void clear_jumplist(void) +void clear_jumplist(void) { ICustomDestinationList *pCDL; - UINT num_items; - IObjectArray *pRemoved; if (CoCreateInstance(&CLSID_DestinationList, NULL, CLSCTX_INPROC_SERVER, COMPTR(ICustomDestinationList, &pCDL)) == S_OK) {