mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2024-11-27 11:54:44 +08:00
libwinpr-sspi: fix compilation on Windows
This commit is contained in:
parent
ce08f3a6d0
commit
5ed9796e96
@ -25,6 +25,7 @@
|
||||
#cmakedefine WITH_PROFILER
|
||||
#cmakedefine WITH_SSE2
|
||||
#cmakedefine WITH_NEON
|
||||
#cmakedefine WITH_NATIVE_SSPI
|
||||
|
||||
/* Debug */
|
||||
#cmakedefine WITH_DEBUG_CERTIFICATE
|
||||
|
@ -22,8 +22,6 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
//#define NATIVE_SSPI
|
||||
|
||||
#include <wchar.h>
|
||||
#include <winpr/winpr.h>
|
||||
#include <winpr/wtypes.h>
|
||||
@ -34,7 +32,7 @@
|
||||
#include <tchar.h>
|
||||
#include <winerror.h>
|
||||
|
||||
#ifdef NATIVE_SSPI
|
||||
#ifdef WITH_NATIVE_SSPI
|
||||
#define SECURITY_WIN32
|
||||
#include <sspi.h>
|
||||
#include <security.h>
|
||||
|
@ -30,10 +30,10 @@
|
||||
|
||||
#ifdef UNICODE
|
||||
typedef WCHAR TCHAR;
|
||||
#define tprintf wprintf
|
||||
#define _tprintf wprintf
|
||||
#else
|
||||
typedef CHAR TCHAR;
|
||||
#define tprintf printf
|
||||
#define _tprintf printf
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -38,7 +38,7 @@ boolean ntlm_client_init(rdpNtlm* ntlm, boolean confidentiality, char* user, cha
|
||||
|
||||
ntlm->confidentiality = confidentiality;
|
||||
|
||||
#ifdef NATIVE_SSPI
|
||||
#ifdef WITH_NATIVE_SSPI
|
||||
{
|
||||
HMODULE hSSPI;
|
||||
INIT_SECURITY_INTERFACE InitSecurityInterface;
|
||||
|
@ -155,7 +155,7 @@ int credssp_client_authenticate(rdpCredssp* credssp)
|
||||
if (credssp_ntlm_client_init(credssp) == 0)
|
||||
return 0;
|
||||
|
||||
#ifdef NATIVE_SSPI
|
||||
#ifdef WITH_NATIVE_SSPI
|
||||
{
|
||||
HMODULE hSSPI;
|
||||
INIT_SECURITY_INTERFACE InitSecurityInterface;
|
||||
@ -396,7 +396,7 @@ int credssp_server_authenticate(rdpCredssp* credssp)
|
||||
if (credssp_ntlm_server_init(credssp) == 0)
|
||||
return 0;
|
||||
|
||||
#ifdef NATIVE_SSPI
|
||||
#ifdef WITH_NATIVE_SSPI
|
||||
{
|
||||
HMODULE hSSPI;
|
||||
INIT_SECURITY_INTERFACE InitSecurityInterface;
|
||||
|
@ -147,7 +147,7 @@ RegVal* reg_load_value(Reg* reg, RegKey* key)
|
||||
{
|
||||
p[4] = strchr(data, '"');
|
||||
p[4][0] = '\0';
|
||||
value->data.string = strdup(data);
|
||||
value->data.string = _strdup(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -50,8 +50,6 @@ if(NOT WITH_NATIVE_SSPI)
|
||||
${WINPR_SSPI_NEGOTIATE_SRCS}
|
||||
${WINPR_SSPI_SCHANNEL_SRCS}
|
||||
${WINPR_SSPI_SRCS})
|
||||
else()
|
||||
add_definitions(-DNATIVE_SSPI)
|
||||
endif()
|
||||
|
||||
add_library(winpr-sspi ${WINPR_SSPI_SRCS})
|
||||
|
@ -353,7 +353,7 @@ void sspi_GlobalFinish()
|
||||
sspi_ContextBufferAllocTableFree();
|
||||
}
|
||||
|
||||
#ifndef NATIVE_SSPI
|
||||
#ifndef WITH_NATIVE_SSPI
|
||||
|
||||
SecurityFunctionTableA* sspi_GetSecurityFunctionTableByNameA(const SEC_CHAR* Name)
|
||||
{
|
||||
|
@ -28,7 +28,9 @@ add_library(winpr-synch ${WINPR_SYNCH_SRCS})
|
||||
|
||||
set_target_properties(winpr-synch PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
|
||||
|
||||
target_link_libraries(winpr-synch winpr-handle)
|
||||
if(NOT WIN32)
|
||||
target_link_libraries(winpr-synch winpr-handle)
|
||||
endif()
|
||||
|
||||
install(TARGETS winpr-synch DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
|
||||
|
@ -21,5 +21,7 @@ add_executable(winpr-reg
|
||||
reg.c)
|
||||
|
||||
target_link_libraries(winpr-reg winpr-utils)
|
||||
target_link_libraries(winpr-reg winpr-registry)
|
||||
|
||||
if(NOT WIN32)
|
||||
target_link_libraries(winpr-reg winpr-registry)
|
||||
endif()
|
||||
|
@ -41,7 +41,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
if (status != ERROR_SUCCESS)
|
||||
{
|
||||
tprintf(_T("RegOpenKeyEx error: 0x%08lX\n"), status);
|
||||
_tprintf(_T("RegOpenKeyEx error: 0x%08lX\n"), status);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
if (status != ERROR_SUCCESS)
|
||||
{
|
||||
tprintf(_T("RegQueryValueEx error: 0x%08lX\n"), status);
|
||||
_tprintf(_T("RegQueryValueEx error: 0x%08lX\n"), status);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
if (status != ERROR_SUCCESS)
|
||||
{
|
||||
tprintf(_T("RegQueryValueEx error: 0x%08lX\n"), status);
|
||||
_tprintf(_T("RegQueryValueEx error: 0x%08lX\n"), status);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
if (status != ERROR_SUCCESS)
|
||||
{
|
||||
tprintf(_T("RegQueryValueEx error: 0x%08lX\n"), status);
|
||||
_tprintf(_T("RegQueryValueEx error: 0x%08lX\n"), status);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,9 @@ set(WINPR_UTILS_SRCS
|
||||
|
||||
add_library(winpr-utils ${WINPR_UTILS_SRCS})
|
||||
|
||||
include_directories(${ZLIB_INCLUDE_DIRS})
|
||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||
|
||||
set_target_properties(winpr-utils PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
|
||||
|
||||
if (NOT WIN32)
|
||||
|
Loading…
Reference in New Issue
Block a user