equal
deleted
inserted
replaced
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 } |