summaryrefslogtreecommitdiff
path: root/vcl/win/dtrans
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-01-07 13:42:20 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-01-07 18:21:42 +0100
commitb5d9fefe0e3ac56eef247c90b137d4b6d7a667c6 (patch)
tree880fcb65a477f057dc3f1527b272e7d49c503099 /vcl/win/dtrans
parent7cdae23d690921349737c5da30ea7bc125ad2d2e (diff)
Use CreateThread instead of _beginthreadex
Change-Id: I7c272880d6567bc669d4c3c2684aa2e0daeca1b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128120 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl/win/dtrans')
-rw-r--r--vcl/win/dtrans/MtaOleClipb.cxx14
-rw-r--r--vcl/win/dtrans/MtaOleClipb.hxx14
2 files changed, 12 insertions, 16 deletions
diff --git a/vcl/win/dtrans/MtaOleClipb.cxx b/vcl/win/dtrans/MtaOleClipb.cxx
index 4faba21367f2..6f7304fe3828 100644
--- a/vcl/win/dtrans/MtaOleClipb.cxx
+++ b/vcl/win/dtrans/MtaOleClipb.cxx
@@ -246,8 +246,8 @@ CMtaOleClipboard::CMtaOleClipboard( ) :
s_theMtaOleClipboardInst = this;
- m_hOleThread = reinterpret_cast<HANDLE>(_beginthreadex(
- nullptr, 0, CMtaOleClipboard::oleThreadProc, this, 0, &m_uOleThreadId ));
+ m_hOleThread = CreateThread(
+ nullptr, 0, CMtaOleClipboard::oleThreadProc, this, 0, &m_uOleThreadId );
OSL_ASSERT( nullptr != m_hOleThread );
// setup the clipboard changed notifier thread
@@ -258,9 +258,9 @@ CMtaOleClipboard::CMtaOleClipboard( ) :
m_hClipboardChangedNotifierEvents[1] = CreateEventW( nullptr, MANUAL_RESET, INIT_NONSIGNALED, nullptr );
OSL_ASSERT( nullptr != m_hClipboardChangedNotifierEvents[1] );
- unsigned uThreadId;
- m_hClipboardChangedNotifierThread = reinterpret_cast<HANDLE>(_beginthreadex(
- nullptr, 0, CMtaOleClipboard::clipboardChangedNotifierThreadProc, this, 0, &uThreadId ));
+ DWORD uThreadId;
+ m_hClipboardChangedNotifierThread = CreateThread(
+ nullptr, 0, CMtaOleClipboard::clipboardChangedNotifierThreadProc, this, 0, &uThreadId );
OSL_ASSERT( nullptr != m_hClipboardChangedNotifierThread );
}
@@ -680,7 +680,7 @@ unsigned int CMtaOleClipboard::run( )
return nRet;
}
-unsigned int WINAPI CMtaOleClipboard::oleThreadProc( LPVOID pParam )
+DWORD WINAPI CMtaOleClipboard::oleThreadProc( _In_ LPVOID pParam )
{
osl_setThreadName("CMtaOleClipboard::run()");
@@ -691,7 +691,7 @@ unsigned int WINAPI CMtaOleClipboard::oleThreadProc( LPVOID pParam )
return pInst->run( );
}
-unsigned int WINAPI CMtaOleClipboard::clipboardChangedNotifierThreadProc( LPVOID pParam )
+DWORD WINAPI CMtaOleClipboard::clipboardChangedNotifierThreadProc( _In_ LPVOID pParam )
{
osl_setThreadName("CMtaOleClipboard::clipboardChangedNotifierThreadProc()");
CMtaOleClipboard* pInst = static_cast< CMtaOleClipboard* >( pParam );
diff --git a/vcl/win/dtrans/MtaOleClipb.hxx b/vcl/win/dtrans/MtaOleClipb.hxx
index c406f81aafd3..a76b85e3b059 100644
--- a/vcl/win/dtrans/MtaOleClipb.hxx
+++ b/vcl/win/dtrans/MtaOleClipb.hxx
@@ -75,15 +75,15 @@ private:
LRESULT onClipboardUpdate();
static LRESULT CALLBACK mtaOleReqWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
- static unsigned int WINAPI oleThreadProc( LPVOID pParam );
+ static DWORD WINAPI oleThreadProc( _In_ LPVOID pParam );
- static unsigned int WINAPI clipboardChangedNotifierThreadProc( LPVOID pParam );
+ static DWORD WINAPI clipboardChangedNotifierThreadProc( _In_ LPVOID pParam );
bool WaitForThreadReady( ) const;
private:
HANDLE m_hOleThread;
- unsigned m_uOleThreadId;
+ DWORD m_uOleThreadId;
HANDLE m_hEvtThrdReady;
HWND m_hwndMtaOleReqWnd;
HANDLE m_hEvtWndDisposed;
@@ -103,12 +103,8 @@ private:
static CMtaOleClipboard* s_theMtaOleClipboardInst;
-// not allowed
-private:
- CMtaOleClipboard( const CMtaOleClipboard& );
- CMtaOleClipboard& operator=( const CMtaOleClipboard& );
-
- friend LRESULT CALLBACK mtaOleReqWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
+ CMtaOleClipboard( const CMtaOleClipboard& ) = delete;
+ CMtaOleClipboard& operator=( const CMtaOleClipboard& ) = delete;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */