diff --git a/win/rfb_win32/TsSessions.cxx b/win/rfb_win32/TsSessions.cxx
index b02f619..6d16adb 100644
--- a/win/rfb_win32/TsSessions.cxx
+++ b/win/rfb_win32/TsSessions.cxx
@@ -17,50 +17,28 @@
  */
 
 #include <rfb_win32/TsSessions.h>
-#include <rfb_win32/DynamicFn.h>
 #include <rfb/LogWriter.h>
 #include <rdr/Exception.h>
 #include <tchar.h>
-
-#ifdef ERROR_CTX_WINSTATION_BUSY
-#define RFB_HAVE_WINSTATION_CONNECT
-#else
-#pragma message("  NOTE: Not building WinStationConnect support.")
-#endif
+#include <wtsapi32.h>
 
 static rfb::LogWriter vlog("TsSessions");
 
 namespace rfb {
 namespace win32 {
 
-  // Windows XP (and later) functions used to handle session Ids
-  typedef BOOLEAN (WINAPI *_WinStationConnect_proto) (HANDLE,ULONG,ULONG,PCWSTR,ULONG);
-  DynamicFn<_WinStationConnect_proto> _WinStationConnect(_T("winsta.dll"), "WinStationConnectW");
-  typedef DWORD (WINAPI *_WTSGetActiveConsoleSessionId_proto) ();
-  DynamicFn<_WTSGetActiveConsoleSessionId_proto> _WTSGetActiveConsoleSessionId(_T("kernel32.dll"), "WTSGetActiveConsoleSessionId");
-  typedef BOOL (WINAPI *_ProcessIdToSessionId_proto) (DWORD, DWORD*);
-  DynamicFn<_ProcessIdToSessionId_proto> _ProcessIdToSessionId(_T("kernel32.dll"), "ProcessIdToSessionId");
-  typedef BOOL (WINAPI *_LockWorkStation_proto)();
-  DynamicFn<_LockWorkStation_proto> _LockWorkStation(_T("user32.dll"), "LockWorkStation");
-
-
   ProcessSessionId::ProcessSessionId(DWORD processId) {
     id = 0;
-    if (!_ProcessIdToSessionId.isValid())
-      return;
     if (processId == (DWORD)-1)
       processId = GetCurrentProcessId();
-    if (!(*_ProcessIdToSessionId)(GetCurrentProcessId(), &id))
+    if (!ProcessIdToSessionId(GetCurrentProcessId(), &id))
       throw rdr::SystemException("ProcessIdToSessionId", GetLastError());
   }
 
   ProcessSessionId mySessionId;
 
   ConsoleSessionId::ConsoleSessionId() {
-    if (_WTSGetActiveConsoleSessionId.isValid())
-      id = (*_WTSGetActiveConsoleSessionId)();
-    else
-      id = 0;
+    id = WTSGetActiveConsoleSessionId();
   }
 
   bool inConsoleSession() {
@@ -69,24 +47,17 @@
   }
 
   void setConsoleSession(DWORD sessionId) {
-#ifdef RFB_HAVE_WINSTATION_CONNECT
-    if (!_WinStationConnect.isValid())
-      throw rdr::Exception("WinSta APIs missing");
     if (sessionId == (DWORD)-1)
       sessionId = mySessionId.id;
 
     // Try to reconnect our session to the console
     ConsoleSessionId console;
     vlog.info("Console session is %lu", console.id);
-    if (!(*_WinStationConnect)(0, sessionId, console.id, L"", 0))
+    if (!WTSConnectSession(sessionId, console.id, (PTSTR)_T(""), 0))
       throw rdr::SystemException("Unable to connect session to Console", GetLastError());
 
     // Lock the newly connected session, for security
-    if (_LockWorkStation.isValid())
-      (*_LockWorkStation)();
-#else
-    throw rdr::Exception("setConsoleSession not implemented");
-#endif
+    LockWorkStation();
   }
 
 };
