windows: Fix calls to CoCreateInstance() so last parameter is a LPVOID *.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 20 May 2020 16:58:33 -0400
changeset 1383802e41b30186f
parent 13837 c18c3084bd77
child 13839 52dbeb97b294
windows: Fix calls to CoCreateInstance() so last parameter is a LPVOID *.
src/audio/wasapi/SDL_wasapi_win32.c
src/haptic/windows/SDL_dinputhaptic.c
src/joystick/windows/SDL_dinputjoystick.c
src/sensor/windows/SDL_windowssensor.c
     1.1 --- a/src/audio/wasapi/SDL_wasapi_win32.c	Wed May 20 16:43:02 2020 -0400
     1.2 +++ b/src/audio/wasapi/SDL_wasapi_win32.c	Wed May 20 16:58:33 2020 -0400
     1.3 @@ -247,7 +247,7 @@
     1.4          return SDL_SetError("WASAPI: CoInitialize() failed");
     1.5      }
     1.6  
     1.7 -    ret = CoCreateInstance(&SDL_CLSID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &SDL_IID_IMMDeviceEnumerator, (LPVOID) &enumerator);
     1.8 +    ret = CoCreateInstance(&SDL_CLSID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &SDL_IID_IMMDeviceEnumerator, (LPVOID *) &enumerator);
     1.9      if (FAILED(ret)) {
    1.10          WIN_CoUninitialize();
    1.11          return WIN_SetErrorFromHRESULT("WASAPI CoCreateInstance(MMDeviceEnumerator)", ret);
     2.1 --- a/src/haptic/windows/SDL_dinputhaptic.c	Wed May 20 16:43:02 2020 -0400
     2.2 +++ b/src/haptic/windows/SDL_dinputhaptic.c	Wed May 20 16:58:33 2020 -0400
     2.3 @@ -87,7 +87,7 @@
     2.4      coinitialized = SDL_TRUE;
     2.5  
     2.6      ret = CoCreateInstance(&CLSID_DirectInput8, NULL, CLSCTX_INPROC_SERVER,
     2.7 -        &IID_IDirectInput8, (LPVOID)& dinput);
     2.8 +        &IID_IDirectInput8, (LPVOID *) &dinput);
     2.9      if (FAILED(ret)) {
    2.10          SDL_SYS_HapticQuit();
    2.11          return DI_SetError("CoCreateInstance", ret);
     3.1 --- a/src/joystick/windows/SDL_dinputjoystick.c	Wed May 20 16:43:02 2020 -0400
     3.2 +++ b/src/joystick/windows/SDL_dinputjoystick.c	Wed May 20 16:58:33 2020 -0400
     3.3 @@ -509,7 +509,7 @@
     3.4      coinitialized = SDL_TRUE;
     3.5  
     3.6      result = CoCreateInstance(&CLSID_DirectInput8, NULL, CLSCTX_INPROC_SERVER,
     3.7 -        &IID_IDirectInput8, (LPVOID)&dinput);
     3.8 +        &IID_IDirectInput8, (LPVOID *)&dinput);
     3.9  
    3.10      if (FAILED(result)) {
    3.11          return SetDIerror("CoCreateInstance", result);
     4.1 --- a/src/sensor/windows/SDL_windowssensor.c	Wed May 20 16:43:02 2020 -0400
     4.2 +++ b/src/sensor/windows/SDL_windowssensor.c	Wed May 20 16:58:33 2020 -0400
     4.3 @@ -351,7 +351,7 @@
     4.4          SDL_windowscoinit = SDL_TRUE;
     4.5      }
     4.6  
     4.7 -    hr = CoCreateInstance(&CLSID_SensorManager, NULL, CLSCTX_INPROC_SERVER, &IID_SensorManager, &SDL_sensor_manager);
     4.8 +    hr = CoCreateInstance(&CLSID_SensorManager, NULL, CLSCTX_INPROC_SERVER, &IID_SensorManager, (LPVOID *) &SDL_sensor_manager);
     4.9      if (FAILED(hr)) {
    4.10          return SDL_SetError("Couldn't create the sensor manager: 0x%.4x", hr);
    4.11      }