mirror of https://github.com/FreeRDP/FreeRDP
Merge pull request #3620 from mfleisz/wtsapi_fix
wtsapi: Fix issue with setting custom API table
This commit is contained in:
commit
3550d0cb43
|
@ -695,7 +695,12 @@ const CHAR* WTSSessionStateToString(WTS_CONNECTSTATE_CLASS state)
|
|||
|
||||
BOOL WTSRegisterWtsApiFunctionTable(PWtsApiFunctionTable table)
|
||||
{
|
||||
g_WtsApi = table;
|
||||
/* Use InitOnceExecuteOnce here as well - otherwise a table set with this
|
||||
function is overriden on the first use of a WTS* API call (due to
|
||||
wtsapiInitOnce not being set). */
|
||||
InitOnceExecuteOnce(&wtsapiInitOnce, InitializeWtsApiStubs, (PVOID)table, NULL);
|
||||
if (!g_WtsApi)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -787,6 +792,12 @@ static void InitializeWtsApiStubs_FreeRDS()
|
|||
|
||||
static BOOL CALLBACK InitializeWtsApiStubs(PINIT_ONCE once, PVOID param, PVOID *context)
|
||||
{
|
||||
if (param)
|
||||
{
|
||||
g_WtsApi = (PWtsApiFunctionTable)param;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
InitializeWtsApiStubs_Env();
|
||||
|
||||
#ifdef _WIN32
|
||||
|
|
Loading…
Reference in New Issue