Merge branch 'master' of github.com:awakecoding/FreeRDP into xkeys

This commit is contained in:
Marc-André Moreau 2014-03-22 17:43:02 -04:00
commit 28ab490164
2 changed files with 41 additions and 49 deletions

View File

@ -229,6 +229,7 @@ FREERDP_API extern int connectErrorCode;
#define FREERDP_ERROR_AUTHENTICATION_FAILED MAKE_FREERDP_ERROR(CONNECT, 9)
#define FREERDP_ERROR_INSUFFICIENT_PRIVILEGES MAKE_FREERDP_ERROR(CONNECT, 10)
#define FREERDP_ERROR_CONNECT_CANCELLED MAKE_FREERDP_ERROR(CONNECT, 11)
#ifdef __cplusplus
}
#endif

View File

@ -189,7 +189,6 @@ BOOL freerdp_connect(freerdp* instance)
if (rdp->errorInfo == ERRINFO_SERVER_INSUFFICIENT_PRIVILEGES)
{
connectErrorCode = INSUFFICIENTPRIVILEGESERROR;
freerdp_set_last_error(instance->context, FREERDP_ERROR_INSUFFICIENT_PRIVILEGES);
}
@ -198,16 +197,6 @@ BOOL freerdp_connect(freerdp* instance)
connectErrorCode = UNDEFINEDCONNECTERROR;
}
if (!freerdp_get_last_error(rdp->context))
{
freerdp_set_last_error(instance->context, FREERDP_ERROR_CONNECT_UNDEFINED);
}
if (!freerdp_get_last_error(rdp->context))
{
freerdp_set_last_error(instance->context, FREERDP_ERROR_CONNECT_UNDEFINED);
}
SetEvent(rdp->transport->connectedEvent);
freerdp_connect_finally:
@ -489,6 +478,19 @@ UINT32 freerdp_error_info(freerdp* instance)
return instance->context->rdp->errorInfo;
}
UINT32 freerdp_get_last_error(rdpContext* context)
{
return context->LastError;
}
void freerdp_set_last_error(rdpContext* context, UINT32 lastError)
{
if (lastError)
fprintf(stderr, "freerdp_set_last_error 0x%04X\n", lastError);
context->LastError = lastError;
}
/** Allocator function for the rdp_freerdp structure.
* @return an allocated structure filled with 0s. Need to be deallocated using freerdp_free()
*/
@ -520,14 +522,3 @@ void freerdp_free(freerdp* instance)
free(instance);
}
}
FREERDP_API UINT32 freerdp_get_last_error(rdpContext* context)
{
return context->LastError;
}
FREERDP_API void freerdp_set_last_error(rdpContext* context, UINT32 lastError)
{
fprintf(stderr, "freerdp_set_last_error 0x%x\n", lastError);
context->LastError = lastError;
}