diff --git a/libfreerdp/crypto/nla.c b/libfreerdp/crypto/nla.c index e81e030f2..169f5ac11 100644 --- a/libfreerdp/crypto/nla.c +++ b/libfreerdp/crypto/nla.c @@ -396,20 +396,10 @@ int credssp_server_authenticate(rdpCredssp* credssp) return 0; #ifdef WITH_NATIVE_SSPI - { - HMODULE hSSPI; - INIT_SECURITY_INTERFACE pInitSecurityInterface; - - hSSPI = LoadLibrary(_T("secur32.dll")); - -#ifdef UNICODE - pInitSecurityInterface = (INIT_SECURITY_INTERFACE) GetProcAddress(hSSPI, "InitSecurityInterfaceW"); -#else - pInitSecurityInterface = (INIT_SECURITY_INTERFACE) GetProcAddress(hSSPI, "InitSecurityInterfaceA"); + if (!credssp->SspiModule) + credssp->SspiModule = _tcsdup(_T("secur32.dll")); #endif - credssp->table = (*pInitSecurityInterface)(); - } -#else + if (credssp->SspiModule) { HMODULE hSSPI; @@ -431,6 +421,7 @@ int credssp_server_authenticate(rdpCredssp* credssp) credssp->table = (*pInitSecurityInterface)(); } +#ifndef WITH_NATIVE_SSPI else { credssp->table = InitSecurityInterface(); @@ -1269,28 +1260,30 @@ rdpCredssp* credssp_new(freerdp* instance, rdpTls* tls, rdpSettings* settings) ZeroMemory(&credssp->pubKeyAuth, sizeof(SecBuffer)); ZeroMemory(&credssp->authInfo, sizeof(SecBuffer)); - status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\FreeRDP\\Server"), - 0, KEY_READ | KEY_WOW64_64KEY, &hKey); - - if (status == ERROR_SUCCESS) + if (credssp->server) { - status = RegQueryValueEx(hKey, _T("SspiModule"), NULL, &dwType, NULL, &dwSize); + status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\FreeRDP\\Server"), + 0, KEY_READ | KEY_WOW64_64KEY, &hKey); if (status == ERROR_SUCCESS) { - credssp->SspiModule = (LPTSTR) malloc(dwSize + sizeof(TCHAR)); - - status = RegQueryValueEx(hKey, _T("SspiModule"), NULL, &dwType, - (BYTE*) credssp->SspiModule, &dwSize); + status = RegQueryValueEx(hKey, _T("SspiModule"), NULL, &dwType, NULL, &dwSize); if (status == ERROR_SUCCESS) { - _tprintf(_T("Using SSPI Module: %s\n"), credssp->SspiModule); - RegCloseKey(hKey); + credssp->SspiModule = (LPTSTR) malloc(dwSize + sizeof(TCHAR)); + + status = RegQueryValueEx(hKey, _T("SspiModule"), NULL, &dwType, + (BYTE*) credssp->SspiModule, &dwSize); + + if (status == ERROR_SUCCESS) + { + _tprintf(_T("Using SSPI Module: %s\n"), credssp->SspiModule); + RegCloseKey(hKey); + } } } } - } return credssp; diff --git a/server/Windows/wf_peer.c b/server/Windows/wf_peer.c index cc0a5d94c..7df93f057 100644 --- a/server/Windows/wf_peer.c +++ b/server/Windows/wf_peer.c @@ -35,13 +35,17 @@ void wf_peer_context_new(freerdp_peer* client, wfPeerContext* context) { +#ifndef WITH_WIN8 wfInfoSingleton = wf_info_init(wfInfoSingleton); wf_info_mirror_init(wfInfoSingleton, context); +#endif } void wf_peer_context_free(freerdp_peer* client, wfPeerContext* context) { +#ifndef WITH_WIN8 wf_info_subscriber_release(wfInfoSingleton, context); +#endif } static DWORD WINAPI wf_peer_mirror_monitor(LPVOID lpParam) @@ -184,6 +188,7 @@ void wf_peer_init(freerdp_peer* client) client->ContextFree = (psPeerContextFree) wf_peer_context_free; freerdp_peer_context_new(client); +#ifndef WITH_WIN8 if (!wf_info_get_thread_count(wfInfoSingleton)) { _tprintf(_T("Trying to create a monitor thread...\n")); @@ -193,6 +198,7 @@ void wf_peer_init(freerdp_peer* client) wf_info_set_thread_count(wfInfoSingleton, wf_info_get_thread_count(wfInfoSingleton) + 1 ); } +#endif } boolean wf_peer_post_connect(freerdp_peer* client) diff --git a/server/Windows/wfreerdp.c b/server/Windows/wfreerdp.c index 9b89fce0f..cb214b75f 100644 --- a/server/Windows/wfreerdp.c +++ b/server/Windows/wfreerdp.c @@ -91,8 +91,10 @@ static DWORD WINAPI wf_peer_main_loop(LPVOID lpParam) break; } +#ifndef WITH_WIN8 if(client->activated) wf_peer_send_changes(client->update); +#endif } printf("Client %s disconnected.\n", client->local ? "(local)" : client->hostname); diff --git a/server/Windows/wfreerdp.h b/server/Windows/wfreerdp.h index 11f402e60..f1cb2f1ef 100644 --- a/server/Windows/wfreerdp.h +++ b/server/Windows/wfreerdp.h @@ -20,6 +20,8 @@ #ifndef WFREERDP_H #define WFREERDP_H +//#define WITH_WIN8 1 + #include #include #include "wf_info.h"