Commit 9b58a461 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Win32: use CoInitializeEx() instead of CoInitialize()

That is recommended by MSDN. Also, do not use 0 for NULL.
parent 32bfb8dc
...@@ -409,7 +409,7 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys, ...@@ -409,7 +409,7 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys,
bool b_use_video = true; bool b_use_video = true;
/* Initialize OLE/COM */ /* Initialize OLE/COM */
CoInitialize( 0 ); CoInitializeEx( NULL, COINIT_APARTMENTTHREADED );
var_Create( p_this, CFG_PREFIX "config", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); var_Create( p_this, CFG_PREFIX "config", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Create( p_this, CFG_PREFIX "tuner", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); var_Create( p_this, CFG_PREFIX "tuner", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
......
...@@ -369,9 +369,7 @@ BDAGraph::BDAGraph( vlc_object_t *p_this ): ...@@ -369,9 +369,7 @@ BDAGraph::BDAGraph( vlc_object_t *p_this ):
p_scanning_tuner = NULL; p_scanning_tuner = NULL;
p_grabber = NULL; p_grabber = NULL;
/* Initialize COM - MS says to use CoInitializeEx in preference to CoInitializeEx( NULL, COINIT_APARTMENTTHREADED );
* CoInitialize */
CoInitializeEx( 0, COINIT_APARTMENTTHREADED );
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -379,7 +379,7 @@ static int DecOpen( decoder_t *p_dec ) ...@@ -379,7 +379,7 @@ static int DecOpen( decoder_t *p_dec )
ldt_fs_t *ldt_fs = Setup_LDT_Keeper(); ldt_fs_t *ldt_fs = Setup_LDT_Keeper();
#else #else
/* Initialize OLE/COM */ /* Initialize OLE/COM */
CoInitialize( 0 ); CoInitializeEx( NULL, COINIT_APARTMENTTHREADED );
#endif /* LOADER */ #endif /* LOADER */
if( LoadDMO( VLC_OBJECT(p_dec), &hmsdmo_dll, &p_dmo, &p_dec->fmt_in, false ) if( LoadDMO( VLC_OBJECT(p_dec), &hmsdmo_dll, &p_dmo, &p_dec->fmt_in, false )
......
...@@ -935,7 +935,7 @@ bool SPrefsPanel::addType( const char * psz_ext, QTreeWidgetItem* current, ...@@ -935,7 +935,7 @@ bool SPrefsPanel::addType( const char * psz_ext, QTreeWidgetItem* current,
void SPrefsPanel::assoDialog() void SPrefsPanel::assoDialog()
{ {
IApplicationAssociationRegistrationUI *p_appassoc; IApplicationAssociationRegistrationUI *p_appassoc;
CoInitialize( 0 ); CoInitializeEx( NULL, COINIT_APARTMENTTHREADED );
if( S_OK == CoCreateInstance(CLSID_ApplicationAssociationRegistrationUI, if( S_OK == CoCreateInstance(CLSID_ApplicationAssociationRegistrationUI,
NULL, CLSCTX_INPROC_SERVER, NULL, CLSCTX_INPROC_SERVER,
......
...@@ -79,7 +79,7 @@ void MainInterface::createTaskBarButtons() ...@@ -79,7 +79,7 @@ void MainInterface::createTaskBarButtons()
FIXME:the play button's picture doesn't changed to pause when clicked FIXME:the play button's picture doesn't changed to pause when clicked
*/ */
CoInitialize( 0 ); CoInitializeEx( NULL, COINIT_APARTMENTTHREADED );
if( S_OK == CoCreateInstance( CLSID_TaskbarList, if( S_OK == CoCreateInstance( CLSID_TaskbarList,
NULL, CLSCTX_INPROC_SERVER, NULL, CLSCTX_INPROC_SERVER,
......
...@@ -274,7 +274,7 @@ static void CommonChangeThumbnailClip(vout_display_t *vd, bool show) ...@@ -274,7 +274,7 @@ static void CommonChangeThumbnailClip(vout_display_t *vd, bool show)
if (!GetVersionEx(&winVer) || winVer.dwMajorVersion <= 5) if (!GetVersionEx(&winVer) || winVer.dwMajorVersion <= 5)
return; return;
CoInitialize(0); CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
void *ptr; void *ptr;
if (S_OK == CoCreateInstance(&CLSID_TaskbarList, if (S_OK == CoCreateInstance(&CLSID_TaskbarList,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment