Merge pull request #5297 from akallabeth/nla_server_functions
Exposing NLA functions to impersonate and revert context.
This commit is contained in:
commit
6e2cfef5a3
@ -479,6 +479,9 @@ FREERDP_API const char* freerdp_get_logon_error_info_data(UINT32 data);
|
||||
FREERDP_API ULONG freerdp_get_transport_sent(rdpContext* context,
|
||||
BOOL resetCount);
|
||||
|
||||
FREERDP_API BOOL freerdp_nla_impersonate(rdpContext* context);
|
||||
FREERDP_API BOOL freerdp_nla_revert_to_self(rdpContext* context);
|
||||
|
||||
FREERDP_API void clearChannelError(rdpContext* context);
|
||||
FREERDP_API HANDLE getChannelErrorEventHandle(rdpContext* context);
|
||||
FREERDP_API UINT getChannelError(rdpContext* context);
|
||||
|
@ -1001,6 +1001,40 @@ ULONG freerdp_get_transport_sent(rdpContext* context, BOOL resetCount)
|
||||
return written;
|
||||
}
|
||||
|
||||
BOOL freerdp_nla_impersonate(rdpContext* context)
|
||||
{
|
||||
rdpNla* nla;
|
||||
|
||||
if (!context)
|
||||
return FALSE;
|
||||
|
||||
if (!context->rdp)
|
||||
return FALSE;
|
||||
|
||||
if (!context->rdp->transport)
|
||||
return FALSE;
|
||||
|
||||
nla = context->rdp->transport->nla;
|
||||
return nla_impersonate(nla);
|
||||
}
|
||||
|
||||
BOOL freerdp_nla_revert_to_self(rdpContext* context)
|
||||
{
|
||||
rdpNla* nla;
|
||||
|
||||
if (!context)
|
||||
return FALSE;
|
||||
|
||||
if (!context->rdp)
|
||||
return FALSE;
|
||||
|
||||
if (!context->rdp->transport)
|
||||
return FALSE;
|
||||
|
||||
nla = context->rdp->transport->nla;
|
||||
return nla_revert_to_self(nla);
|
||||
}
|
||||
|
||||
HANDLE getChannelErrorEventHandle(rdpContext* context)
|
||||
{
|
||||
return context->channelErrorEvent;
|
||||
|
@ -2468,3 +2468,25 @@ BOOL nla_set_service_principal(rdpNla* nla, LPSTR principal)
|
||||
nla->ServicePrincipalName = principal;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL nla_impersonate(rdpNla* nla)
|
||||
{
|
||||
if (!nla)
|
||||
return FALSE;
|
||||
|
||||
if (!nla->table || !nla->table->ImpersonateSecurityContext)
|
||||
return FALSE;
|
||||
|
||||
return (nla->table->ImpersonateSecurityContext(&nla->context) == SEC_E_OK);
|
||||
}
|
||||
|
||||
BOOL nla_revert_to_self(rdpNla* nla)
|
||||
{
|
||||
if (!nla)
|
||||
return FALSE;
|
||||
|
||||
if (!nla->table || !nla->table->RevertSecurityContext)
|
||||
return FALSE;
|
||||
|
||||
return (nla->table->RevertSecurityContext(&nla->context) == SEC_E_OK);
|
||||
}
|
||||
|
@ -61,6 +61,9 @@ FREERDP_LOCAL BOOL nla_set_state(rdpNla* nla, NLA_STATE state);
|
||||
|
||||
FREERDP_LOCAL BOOL nla_set_service_principal(rdpNla* nla, LPSTR principal);
|
||||
|
||||
FREERDP_LOCAL BOOL nla_impersonate(rdpNla* nla);
|
||||
FREERDP_LOCAL BOOL nla_revert_to_self(rdpNla* nla);
|
||||
|
||||
FREERDP_LOCAL rdpNla* nla_new(freerdp* instance, rdpTransport* transport,
|
||||
rdpSettings* settings);
|
||||
FREERDP_LOCAL void nla_free(rdpNla* nla);
|
||||
|
Loading…
x
Reference in New Issue
Block a user