Skip to content

Commit

Permalink
#1527: run the shadow server via LsaLogonUser + CreateProcessWithTokenW
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@15980 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed May 28, 2017
1 parent 9eee87f commit 648d39f
Show file tree
Hide file tree
Showing 5 changed files with 1,273 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,7 @@ def add_service_exe(script, icon, base_name):
add_console_exe("xpra/server/auth/sqlite_auth.py", "sqlite.ico", "SQLite_auth_tool")
add_console_exe("xpra/server/auth/win32_auth.py", "authentication.ico", "System-Auth-Test")
add_console_exe("win32/service/proxy.py", "xpra_txt.ico", "Xpra-Proxy")
add_console_exe("xpra/platform/win32/lsa_logon_lib.py", "xpra_txt.ico", "System-Logon-Test")
if client_ENABLED:
add_console_exe("xpra/codecs/loader.py", "encoding.ico", "Encoding_info")
add_console_exe("xpra/platform/paths.py", "directory.ico", "Path_info")
Expand Down
32 changes: 30 additions & 2 deletions src/xpra/platform/win32/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import ctypes

from ctypes import WinDLL, Structure, c_ulong, c_ushort, c_ubyte, c_int, c_long, c_void_p
from ctypes import WinDLL, Structure, c_ulong, c_ushort, c_ubyte, c_int, c_long, c_void_p, c_size_t
from ctypes.wintypes import HWND, DWORD, WPARAM, LPARAM, HDC, HMONITOR, HMODULE, SHORT, ATOM, POINTER, RECT
from ctypes.wintypes import HANDLE, LPCWSTR, UINT, INT, WINFUNCTYPE, BOOL, HGDIOBJ, LONG, LPVOID, HBITMAP, LPCSTR, LPWSTR
from ctypes.wintypes import HANDLE, LPCWSTR, UINT, INT, WINFUNCTYPE, BOOL, HGDIOBJ, LONG, LPVOID, HBITMAP, LPCSTR, LPWSTR, HWINSTA

LRESULT = c_long
DEVMODE = c_void_p
Expand All @@ -25,6 +25,13 @@
GetComputerNameW.argtypes = [LPWSTR, LPDWORD]
GetCurrentProcess = kernel32.GetCurrentProcess
GetCurrentProcess.restype = HANDLE
HeapAlloc = kernel32.HeapAlloc
HeapAlloc.restype = LPVOID
HeapAlloc.argtypes = [HANDLE, DWORD, c_size_t]
GetProcessHeap = kernel32.GetProcessHeap
GetProcessHeap.restype = HANDLE
GetProcessHeap.argtypes = []


user32 = WinDLL("user32", use_last_error=True)
RegisterClassExW = user32.RegisterClassExW
Expand Down Expand Up @@ -94,6 +101,27 @@
GetDC.restype = HDC
ReleaseDC = user32.ReleaseDC
PostQuitMessage = user32.PostQuitMessage
OpenWindowStationW = user32.OpenWindowStationW
OpenWindowStationW.restype = HWINSTA
ACCESS_MASK = DWORD
OpenWindowStationW.argtypes = [LPWSTR, BOOL, ACCESS_MASK]
GetProcessWindowStation = user32.GetProcessWindowStation
GetProcessWindowStation.restype = HWINSTA
GetProcessWindowStation.argtypes = []
SetProcessWindowStation = user32.SetProcessWindowStation
SetProcessWindowStation.restype = BOOL
SetProcessWindowStation.argtypes = [HWINSTA]
CloseWindowStation = user32.CloseWindowStation
CloseWindowStation.restype = BOOL
CloseWindowStation.argtypes = [HWINSTA]
HDESK = HANDLE
OpenDesktopW = user32.OpenDesktopW
OpenDesktopW.restype = HDESK
OpenDesktopW.argtypes = [LPWSTR, DWORD, BOOL, ACCESS_MASK]
CloseDesktop = user32.CloseDesktop
CloseDesktop.restype = BOOL
CloseDesktop.argtypes = [HDESK]


gdi32 = WinDLL("gdi32", use_last_error=True)
CreateCompatibleDC = gdi32.CreateCompatibleDC
Expand Down
Loading

0 comments on commit 648d39f

Please sign in to comment.