diff --git a/libavdevice/dshow_capture.h b/libavdevice/dshow_capture.h
index 5a2691518c..21f5cf7e83 100644
--- a/libavdevice/dshow_capture.h
+++ b/libavdevice/dshow_capture.h
@@ -70,7 +70,7 @@ enum dshowSourceFilterType {
 };
 
 #define DECLARE_QUERYINTERFACE(prefix, class, ...)                           \
-long                                                                         \
+long WINAPI                                                                  \
 ff_dshow_##prefix##_QueryInterface(class *this, const GUID *riid, void **ppvObject) \
 {                                                                            \
     struct GUIDoffset ifaces[] = __VA_ARGS__;                                \
@@ -93,14 +93,14 @@ ff_dshow_##prefix##_QueryInterface(class *this, const GUID *riid, void **ppvObje
     return E_NOINTERFACE;                                                    \
 }
 #define DECLARE_ADDREF(prefix, class)                                        \
-unsigned long                                                                \
+unsigned long WINAPI                                                         \
 ff_dshow_##prefix##_AddRef(class *this)                                      \
 {                                                                            \
     dshowdebug("ff_dshow_"AV_STRINGIFY(prefix)"_AddRef(%p)\t%ld\n", this, this->ref+1); \
     return InterlockedIncrement(&this->ref);                                 \
 }
 #define DECLARE_RELEASE(prefix, class)                                       \
-unsigned long                                                                \
+unsigned long WINAPI                                                         \
 ff_dshow_##prefix##_Release(class *this)                                     \
 {                                                                            \
     long ref = InterlockedDecrement(&this->ref);                             \
@@ -167,34 +167,34 @@ struct DShowPin {
     IMemInputPinVtbl *imemvtbl;
 };
 
-long          ff_dshow_pin_QueryInterface          (DShowPin *, const GUID *, void **);
-unsigned long ff_dshow_pin_AddRef                  (DShowPin *);
-unsigned long ff_dshow_pin_Release                 (DShowPin *);
-long          ff_dshow_pin_Connect                 (DShowPin *, IPin *, const AM_MEDIA_TYPE *);
-long          ff_dshow_pin_ReceiveConnection       (DShowPin *, IPin *, const AM_MEDIA_TYPE *);
-long          ff_dshow_pin_Disconnect              (DShowPin *);
-long          ff_dshow_pin_ConnectedTo             (DShowPin *, IPin **);
-long          ff_dshow_pin_ConnectionMediaType     (DShowPin *, AM_MEDIA_TYPE *);
-long          ff_dshow_pin_QueryPinInfo            (DShowPin *, PIN_INFO *);
-long          ff_dshow_pin_QueryDirection          (DShowPin *, PIN_DIRECTION *);
-long          ff_dshow_pin_QueryId                 (DShowPin *, wchar_t **);
-long          ff_dshow_pin_QueryAccept             (DShowPin *, const AM_MEDIA_TYPE *);
-long          ff_dshow_pin_EnumMediaTypes          (DShowPin *, IEnumMediaTypes **);
-long          ff_dshow_pin_QueryInternalConnections(DShowPin *, IPin **, unsigned long *);
-long          ff_dshow_pin_EndOfStream             (DShowPin *);
-long          ff_dshow_pin_BeginFlush              (DShowPin *);
-long          ff_dshow_pin_EndFlush                (DShowPin *);
-long          ff_dshow_pin_NewSegment              (DShowPin *, REFERENCE_TIME, REFERENCE_TIME, double);
-
-long          ff_dshow_meminputpin_QueryInterface          (DShowMemInputPin *, const GUID *, void **);
-unsigned long ff_dshow_meminputpin_AddRef                  (DShowMemInputPin *);
-unsigned long ff_dshow_meminputpin_Release                 (DShowMemInputPin *);
-long          ff_dshow_meminputpin_GetAllocator            (DShowMemInputPin *, IMemAllocator **);
-long          ff_dshow_meminputpin_NotifyAllocator         (DShowMemInputPin *, IMemAllocator *, BOOL);
-long          ff_dshow_meminputpin_GetAllocatorRequirements(DShowMemInputPin *, ALLOCATOR_PROPERTIES *);
-long          ff_dshow_meminputpin_Receive                 (DShowMemInputPin *, IMediaSample *);
-long          ff_dshow_meminputpin_ReceiveMultiple         (DShowMemInputPin *, IMediaSample **, long, long *);
-long          ff_dshow_meminputpin_ReceiveCanBlock         (DShowMemInputPin *);
+long          WINAPI ff_dshow_pin_QueryInterface          (DShowPin *, const GUID *, void **);
+unsigned long WINAPI ff_dshow_pin_AddRef                  (DShowPin *);
+unsigned long WINAPI ff_dshow_pin_Release                 (DShowPin *);
+long          WINAPI ff_dshow_pin_Connect                 (DShowPin *, IPin *, const AM_MEDIA_TYPE *);
+long          WINAPI ff_dshow_pin_ReceiveConnection       (DShowPin *, IPin *, const AM_MEDIA_TYPE *);
+long          WINAPI ff_dshow_pin_Disconnect              (DShowPin *);
+long          WINAPI ff_dshow_pin_ConnectedTo             (DShowPin *, IPin **);
+long          WINAPI ff_dshow_pin_ConnectionMediaType     (DShowPin *, AM_MEDIA_TYPE *);
+long          WINAPI ff_dshow_pin_QueryPinInfo            (DShowPin *, PIN_INFO *);
+long          WINAPI ff_dshow_pin_QueryDirection          (DShowPin *, PIN_DIRECTION *);
+long          WINAPI ff_dshow_pin_QueryId                 (DShowPin *, wchar_t **);
+long          WINAPI ff_dshow_pin_QueryAccept             (DShowPin *, const AM_MEDIA_TYPE *);
+long          WINAPI ff_dshow_pin_EnumMediaTypes          (DShowPin *, IEnumMediaTypes **);
+long          WINAPI ff_dshow_pin_QueryInternalConnections(DShowPin *, IPin **, unsigned long *);
+long          WINAPI ff_dshow_pin_EndOfStream             (DShowPin *);
+long          WINAPI ff_dshow_pin_BeginFlush              (DShowPin *);
+long          WINAPI ff_dshow_pin_EndFlush                (DShowPin *);
+long          WINAPI ff_dshow_pin_NewSegment              (DShowPin *, REFERENCE_TIME, REFERENCE_TIME, double);
+
+long          WINAPI ff_dshow_meminputpin_QueryInterface          (DShowMemInputPin *, const GUID *, void **);
+unsigned long WINAPI ff_dshow_meminputpin_AddRef                  (DShowMemInputPin *);
+unsigned long WINAPI ff_dshow_meminputpin_Release                 (DShowMemInputPin *);
+long          WINAPI ff_dshow_meminputpin_GetAllocator            (DShowMemInputPin *, IMemAllocator **);
+long          WINAPI ff_dshow_meminputpin_NotifyAllocator         (DShowMemInputPin *, IMemAllocator *, BOOL);
+long          WINAPI ff_dshow_meminputpin_GetAllocatorRequirements(DShowMemInputPin *, ALLOCATOR_PROPERTIES *);
+long          WINAPI ff_dshow_meminputpin_Receive                 (DShowMemInputPin *, IMediaSample *);
+long          WINAPI ff_dshow_meminputpin_ReceiveMultiple         (DShowMemInputPin *, IMediaSample **, long, long *);
+long          WINAPI ff_dshow_meminputpin_ReceiveCanBlock         (DShowMemInputPin *);
 
 void                 ff_dshow_pin_Destroy(DShowPin *);
 DShowPin            *ff_dshow_pin_Create (DShowFilter *filter);
@@ -212,13 +212,13 @@ struct DShowEnumPins {
     DShowFilter *filter;
 };
 
-long          ff_dshow_enumpins_QueryInterface(DShowEnumPins *, const GUID *, void **);
-unsigned long ff_dshow_enumpins_AddRef        (DShowEnumPins *);
-unsigned long ff_dshow_enumpins_Release       (DShowEnumPins *);
-long          ff_dshow_enumpins_Next          (DShowEnumPins *, unsigned long, IPin **, unsigned long *);
-long          ff_dshow_enumpins_Skip          (DShowEnumPins *, unsigned long);
-long          ff_dshow_enumpins_Reset         (DShowEnumPins *);
-long          ff_dshow_enumpins_Clone         (DShowEnumPins *, DShowEnumPins **);
+long          WINAPI ff_dshow_enumpins_QueryInterface(DShowEnumPins *, const GUID *, void **);
+unsigned long WINAPI ff_dshow_enumpins_AddRef        (DShowEnumPins *);
+unsigned long WINAPI ff_dshow_enumpins_Release       (DShowEnumPins *);
+long          WINAPI ff_dshow_enumpins_Next          (DShowEnumPins *, unsigned long, IPin **, unsigned long *);
+long          WINAPI ff_dshow_enumpins_Skip          (DShowEnumPins *, unsigned long);
+long          WINAPI ff_dshow_enumpins_Reset         (DShowEnumPins *);
+long          WINAPI ff_dshow_enumpins_Clone         (DShowEnumPins *, DShowEnumPins **);
 
 void                 ff_dshow_enumpins_Destroy(DShowEnumPins *);
 DShowEnumPins       *ff_dshow_enumpins_Create (DShowPin *pin, DShowFilter *filter);
@@ -233,13 +233,13 @@ struct DShowEnumMediaTypes {
     AM_MEDIA_TYPE type;
 };
 
-long          ff_dshow_enummediatypes_QueryInterface(DShowEnumMediaTypes *, const GUID *, void **);
-unsigned long ff_dshow_enummediatypes_AddRef        (DShowEnumMediaTypes *);
-unsigned long ff_dshow_enummediatypes_Release       (DShowEnumMediaTypes *);
-long          ff_dshow_enummediatypes_Next          (DShowEnumMediaTypes *, unsigned long, AM_MEDIA_TYPE **, unsigned long *);
-long          ff_dshow_enummediatypes_Skip          (DShowEnumMediaTypes *, unsigned long);
-long          ff_dshow_enummediatypes_Reset         (DShowEnumMediaTypes *);
-long          ff_dshow_enummediatypes_Clone         (DShowEnumMediaTypes *, DShowEnumMediaTypes **);
+long          WINAPI ff_dshow_enummediatypes_QueryInterface(DShowEnumMediaTypes *, const GUID *, void **);
+unsigned long WINAPI ff_dshow_enummediatypes_AddRef        (DShowEnumMediaTypes *);
+unsigned long WINAPI ff_dshow_enummediatypes_Release       (DShowEnumMediaTypes *);
+long          WINAPI ff_dshow_enummediatypes_Next          (DShowEnumMediaTypes *, unsigned long, AM_MEDIA_TYPE **, unsigned long *);
+long          WINAPI ff_dshow_enummediatypes_Skip          (DShowEnumMediaTypes *, unsigned long);
+long          WINAPI ff_dshow_enummediatypes_Reset         (DShowEnumMediaTypes *);
+long          WINAPI ff_dshow_enummediatypes_Clone         (DShowEnumMediaTypes *, DShowEnumMediaTypes **);
 
 void                 ff_dshow_enummediatypes_Destroy(DShowEnumMediaTypes *);
 DShowEnumMediaTypes *ff_dshow_enummediatypes_Create(const AM_MEDIA_TYPE *type);
@@ -262,21 +262,21 @@ struct DShowFilter {
     void (*callback)(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time, enum dshowDeviceType type);
 };
 
-long          ff_dshow_filter_QueryInterface (DShowFilter *, const GUID *, void **);
-unsigned long ff_dshow_filter_AddRef         (DShowFilter *);
-unsigned long ff_dshow_filter_Release        (DShowFilter *);
-long          ff_dshow_filter_GetClassID     (DShowFilter *, CLSID *);
-long          ff_dshow_filter_Stop           (DShowFilter *);
-long          ff_dshow_filter_Pause          (DShowFilter *);
-long          ff_dshow_filter_Run            (DShowFilter *, REFERENCE_TIME);
-long          ff_dshow_filter_GetState       (DShowFilter *, DWORD, FILTER_STATE *);
-long          ff_dshow_filter_SetSyncSource  (DShowFilter *, IReferenceClock *);
-long          ff_dshow_filter_GetSyncSource  (DShowFilter *, IReferenceClock **);
-long          ff_dshow_filter_EnumPins       (DShowFilter *, IEnumPins **);
-long          ff_dshow_filter_FindPin        (DShowFilter *, const wchar_t *, IPin **);
-long          ff_dshow_filter_QueryFilterInfo(DShowFilter *, FILTER_INFO *);
-long          ff_dshow_filter_JoinFilterGraph(DShowFilter *, IFilterGraph *, const wchar_t *);
-long          ff_dshow_filter_QueryVendorInfo(DShowFilter *, wchar_t **);
+long          WINAPI ff_dshow_filter_QueryInterface (DShowFilter *, const GUID *, void **);
+unsigned long WINAPI ff_dshow_filter_AddRef         (DShowFilter *);
+unsigned long WINAPI ff_dshow_filter_Release        (DShowFilter *);
+long          WINAPI ff_dshow_filter_GetClassID     (DShowFilter *, CLSID *);
+long          WINAPI ff_dshow_filter_Stop           (DShowFilter *);
+long          WINAPI ff_dshow_filter_Pause          (DShowFilter *);
+long          WINAPI ff_dshow_filter_Run            (DShowFilter *, REFERENCE_TIME);
+long          WINAPI ff_dshow_filter_GetState       (DShowFilter *, DWORD, FILTER_STATE *);
+long          WINAPI ff_dshow_filter_SetSyncSource  (DShowFilter *, IReferenceClock *);
+long          WINAPI ff_dshow_filter_GetSyncSource  (DShowFilter *, IReferenceClock **);
+long          WINAPI ff_dshow_filter_EnumPins       (DShowFilter *, IEnumPins **);
+long          WINAPI ff_dshow_filter_FindPin        (DShowFilter *, const wchar_t *, IPin **);
+long          WINAPI ff_dshow_filter_QueryFilterInfo(DShowFilter *, FILTER_INFO *);
+long          WINAPI ff_dshow_filter_JoinFilterGraph(DShowFilter *, IFilterGraph *, const wchar_t *);
+long          WINAPI ff_dshow_filter_QueryVendorInfo(DShowFilter *, wchar_t **);
 
 void                 ff_dshow_filter_Destroy(DShowFilter *);
 DShowFilter         *ff_dshow_filter_Create (void *, void *, enum dshowDeviceType);
diff --git a/libavdevice/dshow_enummediatypes.c b/libavdevice/dshow_enummediatypes.c
index 82944507f6..4cb7057e17 100644
--- a/libavdevice/dshow_enummediatypes.c
+++ b/libavdevice/dshow_enummediatypes.c
@@ -26,7 +26,7 @@ DECLARE_QUERYINTERFACE(enummediatypes, DShowEnumMediaTypes,
 DECLARE_ADDREF(enummediatypes, DShowEnumMediaTypes)
 DECLARE_RELEASE(enummediatypes, DShowEnumMediaTypes)
 
-long ff_dshow_enummediatypes_Next(DShowEnumMediaTypes *this, unsigned long n,
+long WINAPI ff_dshow_enummediatypes_Next(DShowEnumMediaTypes *this, unsigned long n,
                          AM_MEDIA_TYPE **types, unsigned long *fetched)
 {
     int count = 0;
@@ -50,20 +50,20 @@ long ff_dshow_enummediatypes_Next(DShowEnumMediaTypes *this, unsigned long n,
         return S_FALSE;
     return S_OK;
 }
-long ff_dshow_enummediatypes_Skip(DShowEnumMediaTypes *this, unsigned long n)
+long WINAPI ff_dshow_enummediatypes_Skip(DShowEnumMediaTypes *this, unsigned long n)
 {
     dshowdebug("ff_dshow_enummediatypes_Skip(%p)\n", this);
     if (n) /* Any skip will always fall outside of the only valid type. */
         return S_FALSE;
     return S_OK;
 }
-long ff_dshow_enummediatypes_Reset(DShowEnumMediaTypes *this)
+long WINAPI ff_dshow_enummediatypes_Reset(DShowEnumMediaTypes *this)
 {
     dshowdebug("ff_dshow_enummediatypes_Reset(%p)\n", this);
     this->pos = 0;
     return S_OK;
 }
-long ff_dshow_enummediatypes_Clone(DShowEnumMediaTypes *this, DShowEnumMediaTypes **enums)
+long WINAPI ff_dshow_enummediatypes_Clone(DShowEnumMediaTypes *this, DShowEnumMediaTypes **enums)
 {
     DShowEnumMediaTypes *new;
     dshowdebug("ff_dshow_enummediatypes_Clone(%p)\n", this);
diff --git a/libavdevice/dshow_enumpins.c b/libavdevice/dshow_enumpins.c
index 6bf59928f9..759b589ade 100644
--- a/libavdevice/dshow_enumpins.c
+++ b/libavdevice/dshow_enumpins.c
@@ -26,7 +26,7 @@ DECLARE_QUERYINTERFACE(enumpins, DShowEnumPins,
 DECLARE_ADDREF(enumpins, DShowEnumPins)
 DECLARE_RELEASE(enumpins, DShowEnumPins)
 
-long ff_dshow_enumpins_Next(DShowEnumPins *this, unsigned long n, IPin **pins,
+long WINAPI ff_dshow_enumpins_Next(DShowEnumPins *this, unsigned long n, IPin **pins,
                    unsigned long *fetched)
 {
     int count = 0;
@@ -45,20 +45,20 @@ long ff_dshow_enumpins_Next(DShowEnumPins *this, unsigned long n, IPin **pins,
         return S_FALSE;
     return S_OK;
 }
-long ff_dshow_enumpins_Skip(DShowEnumPins *this, unsigned long n)
+long WINAPI ff_dshow_enumpins_Skip(DShowEnumPins *this, unsigned long n)
 {
     dshowdebug("ff_dshow_enumpins_Skip(%p)\n", this);
     if (n) /* Any skip will always fall outside of the only valid pin. */
         return S_FALSE;
     return S_OK;
 }
-long ff_dshow_enumpins_Reset(DShowEnumPins *this)
+long WINAPI ff_dshow_enumpins_Reset(DShowEnumPins *this)
 {
     dshowdebug("ff_dshow_enumpins_Reset(%p)\n", this);
     this->pos = 0;
     return S_OK;
 }
-long ff_dshow_enumpins_Clone(DShowEnumPins *this, DShowEnumPins **pins)
+long WINAPI ff_dshow_enumpins_Clone(DShowEnumPins *this, DShowEnumPins **pins)
 {
     DShowEnumPins *new;
     dshowdebug("ff_dshow_enumpins_Clone(%p)\n", this);
diff --git a/libavdevice/dshow_filter.c b/libavdevice/dshow_filter.c
index 61e057a836..4642ac077c 100644
--- a/libavdevice/dshow_filter.c
+++ b/libavdevice/dshow_filter.c
@@ -26,32 +26,32 @@ DECLARE_QUERYINTERFACE(filter, DShowFilter,
 DECLARE_ADDREF(filter, DShowFilter)
 DECLARE_RELEASE(filter, DShowFilter)
 
-long ff_dshow_filter_GetClassID(DShowFilter *this, CLSID *id)
+long WINAPI ff_dshow_filter_GetClassID(DShowFilter *this, CLSID *id)
 {
     dshowdebug("ff_dshow_filter_GetClassID(%p)\n", this);
     /* I'm not creating a ClassID just for this. */
     return E_FAIL;
 }
-long ff_dshow_filter_Stop(DShowFilter *this)
+long WINAPI ff_dshow_filter_Stop(DShowFilter *this)
 {
     dshowdebug("ff_dshow_filter_Stop(%p)\n", this);
     this->state = State_Stopped;
     return S_OK;
 }
-long ff_dshow_filter_Pause(DShowFilter *this)
+long WINAPI ff_dshow_filter_Pause(DShowFilter *this)
 {
     dshowdebug("ff_dshow_filter_Pause(%p)\n", this);
     this->state = State_Paused;
     return S_OK;
 }
-long ff_dshow_filter_Run(DShowFilter *this, REFERENCE_TIME start)
+long WINAPI ff_dshow_filter_Run(DShowFilter *this, REFERENCE_TIME start)
 {
     dshowdebug("ff_dshow_filter_Run(%p) %"PRId64"\n", this, start);
     this->state = State_Running;
     this->start_time = start;
     return S_OK;
 }
-long ff_dshow_filter_GetState(DShowFilter *this, DWORD ms, FILTER_STATE *state)
+long WINAPI ff_dshow_filter_GetState(DShowFilter *this, DWORD ms, FILTER_STATE *state)
 {
     dshowdebug("ff_dshow_filter_GetState(%p)\n", this);
     if (!state)
@@ -59,7 +59,7 @@ long ff_dshow_filter_GetState(DShowFilter *this, DWORD ms, FILTER_STATE *state)
     *state = this->state;
     return S_OK;
 }
-long ff_dshow_filter_SetSyncSource(DShowFilter *this, IReferenceClock *clock)
+long WINAPI ff_dshow_filter_SetSyncSource(DShowFilter *this, IReferenceClock *clock)
 {
     dshowdebug("ff_dshow_filter_SetSyncSource(%p)\n", this);
 
@@ -73,7 +73,7 @@ long ff_dshow_filter_SetSyncSource(DShowFilter *this, IReferenceClock *clock)
 
     return S_OK;
 }
-long ff_dshow_filter_GetSyncSource(DShowFilter *this, IReferenceClock **clock)
+long WINAPI ff_dshow_filter_GetSyncSource(DShowFilter *this, IReferenceClock **clock)
 {
     dshowdebug("ff_dshow_filter_GetSyncSource(%p)\n", this);
 
@@ -85,7 +85,7 @@ long ff_dshow_filter_GetSyncSource(DShowFilter *this, IReferenceClock **clock)
 
     return S_OK;
 }
-long ff_dshow_filter_EnumPins(DShowFilter *this, IEnumPins **enumpin)
+long WINAPI ff_dshow_filter_EnumPins(DShowFilter *this, IEnumPins **enumpin)
 {
     DShowEnumPins *new;
     dshowdebug("ff_dshow_filter_EnumPins(%p)\n", this);
@@ -99,7 +99,7 @@ long ff_dshow_filter_EnumPins(DShowFilter *this, IEnumPins **enumpin)
     *enumpin = (IEnumPins *) new;
     return S_OK;
 }
-long ff_dshow_filter_FindPin(DShowFilter *this, const wchar_t *id, IPin **pin)
+long WINAPI ff_dshow_filter_FindPin(DShowFilter *this, const wchar_t *id, IPin **pin)
 {
     DShowPin *found = NULL;
     dshowdebug("ff_dshow_filter_FindPin(%p)\n", this);
@@ -116,7 +116,7 @@ long ff_dshow_filter_FindPin(DShowFilter *this, const wchar_t *id, IPin **pin)
 
     return S_OK;
 }
-long ff_dshow_filter_QueryFilterInfo(DShowFilter *this, FILTER_INFO *info)
+long WINAPI ff_dshow_filter_QueryFilterInfo(DShowFilter *this, FILTER_INFO *info)
 {
     dshowdebug("ff_dshow_filter_QueryFilterInfo(%p)\n", this);
 
@@ -128,7 +128,7 @@ long ff_dshow_filter_QueryFilterInfo(DShowFilter *this, FILTER_INFO *info)
 
     return S_OK;
 }
-long ff_dshow_filter_JoinFilterGraph(DShowFilter *this, IFilterGraph *graph,
+long WINAPI ff_dshow_filter_JoinFilterGraph(DShowFilter *this, IFilterGraph *graph,
                             const wchar_t *name)
 {
     dshowdebug("ff_dshow_filter_JoinFilterGraph(%p)\n", this);
@@ -139,7 +139,7 @@ long ff_dshow_filter_JoinFilterGraph(DShowFilter *this, IFilterGraph *graph,
 
     return S_OK;
 }
-long ff_dshow_filter_QueryVendorInfo(DShowFilter *this, wchar_t **info)
+long WINAPI ff_dshow_filter_QueryVendorInfo(DShowFilter *this, wchar_t **info)
 {
     dshowdebug("ff_dshow_filter_QueryVendorInfo(%p)\n", this);
 
diff --git a/libavdevice/dshow_pin.c b/libavdevice/dshow_pin.c
index 2d1fa0e882..f846b68918 100644
--- a/libavdevice/dshow_pin.c
+++ b/libavdevice/dshow_pin.c
@@ -29,13 +29,13 @@ DECLARE_QUERYINTERFACE(pin, DShowPin,
 DECLARE_ADDREF(pin, DShowPin)
 DECLARE_RELEASE(pin, DShowPin)
 
-long ff_dshow_pin_Connect(DShowPin *this, IPin *pin, const AM_MEDIA_TYPE *type)
+long WINAPI ff_dshow_pin_Connect(DShowPin *this, IPin *pin, const AM_MEDIA_TYPE *type)
 {
     dshowdebug("ff_dshow_pin_Connect(%p, %p, %p)\n", this, pin, type);
     /* Input pins receive connections. */
     return S_FALSE;
 }
-long ff_dshow_pin_ReceiveConnection(DShowPin *this, IPin *pin,
+long WINAPI ff_dshow_pin_ReceiveConnection(DShowPin *this, IPin *pin,
                            const AM_MEDIA_TYPE *type)
 {
     enum dshowDeviceType devtype = this->filter->type;
@@ -62,7 +62,7 @@ long ff_dshow_pin_ReceiveConnection(DShowPin *this, IPin *pin,
 
     return S_OK;
 }
-long ff_dshow_pin_Disconnect(DShowPin *this)
+long WINAPI ff_dshow_pin_Disconnect(DShowPin *this)
 {
     dshowdebug("ff_dshow_pin_Disconnect(%p)\n", this);
 
@@ -75,7 +75,7 @@ long ff_dshow_pin_Disconnect(DShowPin *this)
 
     return S_OK;
 }
-long ff_dshow_pin_ConnectedTo(DShowPin *this, IPin **pin)
+long WINAPI ff_dshow_pin_ConnectedTo(DShowPin *this, IPin **pin)
 {
     dshowdebug("ff_dshow_pin_ConnectedTo(%p)\n", this);
 
@@ -88,7 +88,7 @@ long ff_dshow_pin_ConnectedTo(DShowPin *this, IPin **pin)
 
     return S_OK;
 }
-long ff_dshow_pin_ConnectionMediaType(DShowPin *this, AM_MEDIA_TYPE *type)
+long WINAPI ff_dshow_pin_ConnectionMediaType(DShowPin *this, AM_MEDIA_TYPE *type)
 {
     dshowdebug("ff_dshow_pin_ConnectionMediaType(%p)\n", this);
 
@@ -99,7 +99,7 @@ long ff_dshow_pin_ConnectionMediaType(DShowPin *this, AM_MEDIA_TYPE *type)
 
     return ff_copy_dshow_media_type(type, &this->type);
 }
-long ff_dshow_pin_QueryPinInfo(DShowPin *this, PIN_INFO *info)
+long WINAPI ff_dshow_pin_QueryPinInfo(DShowPin *this, PIN_INFO *info)
 {
     dshowdebug("ff_dshow_pin_QueryPinInfo(%p)\n", this);
 
@@ -115,7 +115,7 @@ long ff_dshow_pin_QueryPinInfo(DShowPin *this, PIN_INFO *info)
 
     return S_OK;
 }
-long ff_dshow_pin_QueryDirection(DShowPin *this, PIN_DIRECTION *dir)
+long WINAPI ff_dshow_pin_QueryDirection(DShowPin *this, PIN_DIRECTION *dir)
 {
     dshowdebug("ff_dshow_pin_QueryDirection(%p)\n", this);
     if (!dir)
@@ -123,7 +123,7 @@ long ff_dshow_pin_QueryDirection(DShowPin *this, PIN_DIRECTION *dir)
     *dir = PINDIR_INPUT;
     return S_OK;
 }
-long ff_dshow_pin_QueryId(DShowPin *this, wchar_t **id)
+long WINAPI ff_dshow_pin_QueryId(DShowPin *this, wchar_t **id)
 {
     dshowdebug("ff_dshow_pin_QueryId(%p)\n", this);
 
@@ -134,12 +134,12 @@ long ff_dshow_pin_QueryId(DShowPin *this, wchar_t **id)
 
     return S_OK;
 }
-long ff_dshow_pin_QueryAccept(DShowPin *this, const AM_MEDIA_TYPE *type)
+long WINAPI ff_dshow_pin_QueryAccept(DShowPin *this, const AM_MEDIA_TYPE *type)
 {
     dshowdebug("ff_dshow_pin_QueryAccept(%p)\n", this);
     return S_FALSE;
 }
-long ff_dshow_pin_EnumMediaTypes(DShowPin *this, IEnumMediaTypes **enumtypes)
+long WINAPI ff_dshow_pin_EnumMediaTypes(DShowPin *this, IEnumMediaTypes **enumtypes)
 {
     const AM_MEDIA_TYPE *type = NULL;
     DShowEnumMediaTypes *new;
@@ -154,31 +154,31 @@ long ff_dshow_pin_EnumMediaTypes(DShowPin *this, IEnumMediaTypes **enumtypes)
     *enumtypes = (IEnumMediaTypes *) new;
     return S_OK;
 }
-long ff_dshow_pin_QueryInternalConnections(DShowPin *this, IPin **pin,
+long WINAPI ff_dshow_pin_QueryInternalConnections(DShowPin *this, IPin **pin,
                                   unsigned long *npin)
 {
     dshowdebug("ff_dshow_pin_QueryInternalConnections(%p)\n", this);
     return E_NOTIMPL;
 }
-long ff_dshow_pin_EndOfStream(DShowPin *this)
+long WINAPI ff_dshow_pin_EndOfStream(DShowPin *this)
 {
     dshowdebug("ff_dshow_pin_EndOfStream(%p)\n", this);
     /* I don't care. */
     return S_OK;
 }
-long ff_dshow_pin_BeginFlush(DShowPin *this)
+long WINAPI ff_dshow_pin_BeginFlush(DShowPin *this)
 {
     dshowdebug("ff_dshow_pin_BeginFlush(%p)\n", this);
     /* I don't care. */
     return S_OK;
 }
-long ff_dshow_pin_EndFlush(DShowPin *this)
+long WINAPI ff_dshow_pin_EndFlush(DShowPin *this)
 {
     dshowdebug("ff_dshow_pin_EndFlush(%p)\n", this);
     /* I don't care. */
     return S_OK;
 }
-long ff_dshow_pin_NewSegment(DShowPin *this, REFERENCE_TIME start, REFERENCE_TIME stop,
+long WINAPI ff_dshow_pin_NewSegment(DShowPin *this, REFERENCE_TIME start, REFERENCE_TIME stop,
                     double rate)
 {
     dshowdebug("ff_dshow_pin_NewSegment(%p)\n", this);
@@ -250,43 +250,43 @@ DECLARE_DESTROY(pin, DShowPin, ff_dshow_pin_Free)
 /*****************************************************************************
  * DShowMemInputPin
  ****************************************************************************/
-long ff_dshow_meminputpin_QueryInterface(DShowMemInputPin *this, const GUID *riid,
+long WINAPI ff_dshow_meminputpin_QueryInterface(DShowMemInputPin *this, const GUID *riid,
                                 void **ppvObject)
 {
     DShowPin *pin = (DShowPin *) ((uint8_t *) this - imemoffset);
     dshowdebug("ff_dshow_meminputpin_QueryInterface(%p)\n", this);
     return ff_dshow_pin_QueryInterface(pin, riid, ppvObject);
 }
-unsigned long ff_dshow_meminputpin_AddRef(DShowMemInputPin *this)
+unsigned long WINAPI ff_dshow_meminputpin_AddRef(DShowMemInputPin *this)
 {
     DShowPin *pin = (DShowPin *) ((uint8_t *) this - imemoffset);
     dshowdebug("ff_dshow_meminputpin_AddRef(%p)\n", this);
     return ff_dshow_pin_AddRef(pin);
 }
-unsigned long ff_dshow_meminputpin_Release(DShowMemInputPin *this)
+unsigned long WINAPI ff_dshow_meminputpin_Release(DShowMemInputPin *this)
 {
     DShowPin *pin = (DShowPin *) ((uint8_t *) this - imemoffset);
     dshowdebug("ff_dshow_meminputpin_Release(%p)\n", this);
     return ff_dshow_pin_Release(pin);
 }
-long ff_dshow_meminputpin_GetAllocator(DShowMemInputPin *this, IMemAllocator **alloc)
+long WINAPI ff_dshow_meminputpin_GetAllocator(DShowMemInputPin *this, IMemAllocator **alloc)
 {
     dshowdebug("ff_dshow_meminputpin_GetAllocator(%p)\n", this);
     return VFW_E_NO_ALLOCATOR;
 }
-long ff_dshow_meminputpin_NotifyAllocator(DShowMemInputPin *this, IMemAllocator *alloc,
+long WINAPI ff_dshow_meminputpin_NotifyAllocator(DShowMemInputPin *this, IMemAllocator *alloc,
                                  BOOL rdwr)
 {
     dshowdebug("ff_dshow_meminputpin_NotifyAllocator(%p)\n", this);
     return S_OK;
 }
-long ff_dshow_meminputpin_GetAllocatorRequirements(DShowMemInputPin *this,
+long WINAPI ff_dshow_meminputpin_GetAllocatorRequirements(DShowMemInputPin *this,
                                           ALLOCATOR_PROPERTIES *props)
 {
     dshowdebug("ff_dshow_meminputpin_GetAllocatorRequirements(%p)\n", this);
     return E_NOTIMPL;
 }
-long ff_dshow_meminputpin_Receive(DShowMemInputPin *this, IMediaSample *sample)
+long WINAPI ff_dshow_meminputpin_Receive(DShowMemInputPin *this, IMediaSample *sample)
 {
     DShowPin *pin = (DShowPin *) ((uint8_t *) this - imemoffset);
     enum dshowDeviceType devtype = pin->filter->type;
@@ -354,7 +354,7 @@ long ff_dshow_meminputpin_Receive(DShowMemInputPin *this, IMediaSample *sample)
 
     return S_OK;
 }
-long ff_dshow_meminputpin_ReceiveMultiple(DShowMemInputPin *this,
+long WINAPI ff_dshow_meminputpin_ReceiveMultiple(DShowMemInputPin *this,
                                  IMediaSample **samples, long n, long *nproc)
 {
     int i;
@@ -366,7 +366,7 @@ long ff_dshow_meminputpin_ReceiveMultiple(DShowMemInputPin *this,
     *nproc = n;
     return S_OK;
 }
-long ff_dshow_meminputpin_ReceiveCanBlock(DShowMemInputPin *this)
+long WINAPI ff_dshow_meminputpin_ReceiveCanBlock(DShowMemInputPin *this)
 {
     dshowdebug("ff_dshow_meminputpin_ReceiveCanBlock(%p)\n", this);
     /* I swear I will not block. */
