src/core/windows/SDL_windows.c
changeset 6031 2cb2f3c56573
parent 5598 4d05ee9088b1
child 6044 35448a5ea044
equal deleted inserted replaced
6030:50560ca58f80 6031:2cb2f3c56573
    40 }
    40 }
    41 
    41 
    42 HRESULT
    42 HRESULT
    43 WIN_CoInitialize(void)
    43 WIN_CoInitialize(void)
    44 {
    44 {
       
    45     const HRESULT hr = CoInitialize(NULL);
       
    46 
    45     /* S_FALSE means success, but someone else already initialized. */
    47     /* S_FALSE means success, but someone else already initialized. */
    46     /* You still need to call CoUninitialize in this case! */
    48     /* You still need to call CoUninitialize in this case! */
    47     const HRESULT hr = CoInitialize(NULL);
    49     if (hr == S_FALSE) {
    48     if ((hr == S_OK) || (hr == S_FALSE)) {
       
    49         return S_OK;
    50         return S_OK;
    50     }
    51     }
    51 
    52 
    52     return hr;
    53     return hr;
    53 }
    54 }