src/joystick/windows/SDL_dxjoystick.c
changeset 7260 7601833a69ee
parent 7230 757e9812ef1c
child 7265 3bb309bb6bfe
equal deleted inserted replaced
7259:be3edef98d4b 7260:7601833a69ee
    33  * let it return 0 events. */
    33  * let it return 0 events. */
    34 
    34 
    35 #include "SDL_error.h"
    35 #include "SDL_error.h"
    36 #include "SDL_assert.h"
    36 #include "SDL_assert.h"
    37 #include "SDL_events.h"
    37 #include "SDL_events.h"
    38 #include "SDL_joystick.h"
       
    39 #include "../SDL_sysjoystick.h"
       
    40 #define INITGUID /* Only set here, if set twice will cause mingw32 to break. */
       
    41 #include "SDL_dxjoystick_c.h"
       
    42 #include "SDL_thread.h"
    38 #include "SDL_thread.h"
    43 #include "SDL_timer.h"
    39 #include "SDL_timer.h"
    44 #include "SDL_mutex.h"
    40 #include "SDL_mutex.h"
    45 #include "SDL_events.h"
    41 #include "SDL_events.h"
    46 #include "SDL_hints.h"
    42 #include "SDL_hints.h"
       
    43 #include "SDL_joystick.h"
       
    44 #include "../SDL_sysjoystick.h"
    47 #if !SDL_EVENTS_DISABLED
    45 #if !SDL_EVENTS_DISABLED
    48 #include "../../events/SDL_events_c.h"
    46 #include "../../events/SDL_events_c.h"
    49 #endif
    47 #endif
       
    48 
       
    49 /* The latest version of mingw-w64 defines IID_IWbemLocator in wbemcli.h
       
    50    instead of declaring it like Visual Studio and other mingw32 compilers.
       
    51    So, we need to take care of this here before we define INITGUID.
       
    52 */
       
    53 #ifdef __MINGW32__
       
    54 #define __IWbemLocator_INTERFACE_DEFINED__
       
    55 #endif /* __MINGW32__ */
       
    56 
       
    57 #define INITGUID /* Only set here, if set twice will cause mingw32 to break. */
       
    58 #include "SDL_dxjoystick_c.h"
       
    59 
       
    60 #ifdef __MINGW32__
       
    61 /* And now that we've included wbemcli.h we need to declare these interfaces */
       
    62 typedef struct IWbemLocatorVtbl {
       
    63   BEGIN_INTERFACE
       
    64     HRESULT (WINAPI *QueryInterface)(IWbemLocator *This,REFIID riid,void **ppvObject);
       
    65     ULONG (WINAPI *AddRef)(IWbemLocator *This);
       
    66     ULONG (WINAPI *Release)(IWbemLocator *This);
       
    67     HRESULT (WINAPI *ConnectServer)(IWbemLocator *This,const BSTR strNetworkResource,const BSTR strUser,const BSTR strPassword,const BSTR strLocale,__LONG32 lSecurityFlags,const BSTR strAuthority,IWbemContext *pCtx,IWbemServices **ppNamespace);
       
    68   END_INTERFACE
       
    69 } IWbemLocatorVtbl;
       
    70 struct IWbemLocator {
       
    71   CONST_VTBL struct IWbemLocatorVtbl *lpVtbl;
       
    72 };
       
    73 #define IWbemLocator_ConnectServer(This,strNetworkResource,strUser,strPassword,strLocale,lSecurityFlags,strAuthority,pCtx,ppNamespace) (This)->lpVtbl->ConnectServer(This,strNetworkResource,strUser,strPassword,strLocale,lSecurityFlags,strAuthority,pCtx,ppNamespace)
       
    74 #endif /* __MINGW32__ */
    50 
    75 
    51 #ifndef DIDFT_OPTIONAL
    76 #ifndef DIDFT_OPTIONAL
    52 #define DIDFT_OPTIONAL      0x80000000
    77 #define DIDFT_OPTIONAL      0x80000000
    53 #endif
    78 #endif
    54 
    79 
   371     }                                               \
   396     }                                               \
   372 }
   397 }
   373 
   398 
   374 
   399 
   375 DEFINE_GUID(CLSID_WbemLocator,   0x4590f811,0x1d3a,0x11d0,0x89,0x1F,0x00,0xaa,0x00,0x4b,0x2e,0x24);
   400 DEFINE_GUID(CLSID_WbemLocator,   0x4590f811,0x1d3a,0x11d0,0x89,0x1F,0x00,0xaa,0x00,0x4b,0x2e,0x24);
   376 #ifdef _MSC_VER
       
   377 /* The Windows SDK doesn't define this GUID */
   401 /* The Windows SDK doesn't define this GUID */
   378 DEFINE_GUID(IID_IWbemLocator,    0xdc12a687,0x737f,0x11cf,0x88,0x4d,0x00,0xaa,0x00,0x4b,0x2e,0x24);
   402 DEFINE_GUID(IID_IWbemLocator,    0xdc12a687,0x737f,0x11cf,0x88,0x4d,0x00,0xaa,0x00,0x4b,0x2e,0x24);
   379 #endif /* _MSC_VER */
       
   380 
   403 
   381 /*-----------------------------------------------------------------------------
   404 /*-----------------------------------------------------------------------------
   382  *
   405  *
   383  * code from MSDN: http://msdn.microsoft.com/en-us/library/windows/desktop/ee417014(v=vs.85).aspx
   406  * code from MSDN: http://msdn.microsoft.com/en-us/library/windows/desktop/ee417014(v=vs.85).aspx
   384  *
   407  *