Update apps

This commit is contained in:
binarymaster 2015-07-16 23:17:41 +03:00
parent eca971de03
commit adabe322c3
6 changed files with 52 additions and 28 deletions

View File

@ -1,5 +1,5 @@
{
Copyright 2014 Stas'M Corp.
Copyright 2015 Stas'M Corp.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -282,32 +282,45 @@ var
hSvc: THandle;
Code: DWORD;
pch: PWideChar;
procedure ExitError(Func: String; ErrorCode: DWORD);
begin
if hSC > 0 then
CloseServiceHandle(hSC);
if hSvc > 0 then
CloseServiceHandle(hSvc);
Writeln('[-] ', Func, ' error (code ', ErrorCode, ').');
end;
begin
hSC := 0;
hSvc := 0;
Writeln('[*] Starting ', SvcName, '...');
hSC := OpenSCManager(nil, SERVICES_ACTIVE_DATABASE, SC_MANAGER_CONNECT);
if hSC = 0 then
begin
Code := GetLastError;
Writeln('[-] OpenSCManager error (code ', Code, ').');
ExitError('OpenSCManager', GetLastError);
Exit;
end;
hSvc := OpenService(hSC, PWideChar(SvcName), SERVICE_START);
if hSvc = 0 then
begin
CloseServiceHandle(hSC);
Code := GetLastError;
Writeln('[-] OpenService error (code ', Code, ').');
ExitError('OpenService', GetLastError);
Exit;
end;
pch := nil;
if not StartService(hSvc, 0, pch) then begin
CloseServiceHandle(hSvc);
CloseServiceHandle(hSC);
Code := GetLastError;
Writeln('[-] StartService error (code ', Code, ').');
Exit;
if Code = 1056 then begin // Service already started
Sleep(2000); // or SCM hasn't registered killed process
if not StartService(hSvc, 0, pch) then begin
ExitError('StartService', Code);
Exit;
end;
end else begin
ExitError('StartService', Code);
Exit;
end;
end;
CloseServiceHandle(hSvc);
CloseServiceHandle(hSC);

View File

@ -41,14 +41,14 @@
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<ProjectExtensions>

Binary file not shown.

View File

@ -1,5 +1,5 @@
{
Copyright 2014 Stas'M Corp.
Copyright 2015 Stas'M Corp.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -50,7 +50,7 @@ begin
RDP.ConnectingText := 'Connecting...';
RDP.ConnectedStatusText := 'Connected.';
RDP.UserName := '';
RDP.Server := '127.0.0.1';
RDP.Server := '127.0.0.2';
Reg := TRegistry.Create;
Reg.RootKey := HKEY_LOCAL_MACHINE;
@ -133,7 +133,7 @@ begin
$2207: ErrStr := 'The smart card is blocked.';
$1C07: ErrStr := 'An incorrect PIN was presented to the smart card.';
$B09: ErrStr := 'Network Level Authentication is required.';
$708: ErrStr := 'The RDP seems to work, but your client doesn''t support loopback connections. Try to connect to your PC from another device in the network.';
$708: ErrStr := 'RDP is working, but the client doesn''t allow loopback connections. Try to connect to your PC from another device in the network.';
else ErrStr := 'Unknown code 0x'+IntToHex(discReason, 1);
end;
if (discReason > 2) then

View File

@ -3,7 +3,7 @@ object MainForm: TMainForm
Top = 0
BorderStyle = bsDialog
Caption = 'RDP Wrapper Configuration'
ClientHeight = 326
ClientHeight = 352
ClientWidth = 351
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
@ -27,7 +27,7 @@ object MainForm: TMainForm
end
object bOK: TButton
Left = 10
Top = 293
Top = 319
Width = 75
Height = 25
Caption = 'OK'
@ -37,7 +37,7 @@ object MainForm: TMainForm
end
object bCancel: TButton
Left = 91
Top = 293
Top = 319
Width = 75
Height = 25
Caption = 'Cancel'
@ -47,7 +47,7 @@ object MainForm: TMainForm
end
object bApply: TButton
Left = 172
Top = 293
Top = 319
Width = 75
Height = 25
Caption = 'Apply'
@ -66,7 +66,7 @@ object MainForm: TMainForm
end
object rgNLA: TRadioGroup
Left = 8
Top = 135
Top = 132
Width = 335
Height = 73
Caption = 'Security Mode'
@ -88,14 +88,16 @@ object MainForm: TMainForm
end
object rgShadow: TRadioGroup
Left = 8
Top = 214
Top = 208
Width = 335
Height = 73
Height = 105
Caption = 'Session Shadowing Mode'
Items.Strings = (
'Disable Shadowing'
'Shadowing will request user'#39's permission'
'Shadow sessions immediately')
'Full access with user'#39's permission'
'Full access without permission'
'View only with user'#39's permission'
'View only without permission')
TabOrder = 6
OnClick = cbAllowTSConnectionsClick
end
@ -112,7 +114,7 @@ object MainForm: TMainForm
end
object bLicense: TButton
Left = 253
Top = 293
Top = 319
Width = 87
Height = 25
Caption = 'View license...'

View File

@ -1,5 +1,5 @@
{
Copyright 2014 Stas'M Corp.
Copyright 2015 Stas'M Corp.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -439,6 +439,15 @@ begin
end;
end;
Reg.CloseKey;
Reg.OpenKey('\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services', True);
if rgShadow.ItemIndex >= 0 then begin
try
Reg.WriteInteger('Shadow', rgShadow.ItemIndex);
except
end;
end;
Reg.CloseKey;
Reg.Free;
end;