#include <qstring.h>
#include <qdatetime.h>
-#ifdef Q_OS_WIN32
+#ifdef Q_OS_WIN
#include <qmutex.h>
#include <private/qmutexpool_p.h>
#include <rpc.h>
static QByteArray qNtlmPhase1();
static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phase2data);
-#ifdef Q_OS_WIN32
+#ifdef Q_OS_WIN
static QByteArray qNtlmPhase1_SSPI(QAuthenticatorPrivate *ctx);
static QByteArray qNtlmPhase3_SSPI(QAuthenticatorPrivate *ctx, const QByteArray& phase2data);
#endif
return !d;
}
-#ifdef Q_OS_WIN32
+#ifdef Q_OS_WIN
class QNtlmWindowsHandles
{
public:
QAuthenticatorPrivate::~QAuthenticatorPrivate()
{
-#ifdef Q_OS_WIN32
+#ifdef Q_OS_WIN
if (ntlmWindowsHandles)
delete ntlmWindowsHandles;
#endif
case QAuthenticatorPrivate::Ntlm:
methodString = "NTLM ";
if (challenge.isEmpty()) {
-#ifdef Q_OS_WIN32
+#ifdef Q_OS_WIN
QByteArray phase1Token;
if (user.isEmpty()) // Only pull from system if no user was specified in authenticator
phase1Token = qNtlmPhase1_SSPI(this);
phase = Phase2;
}
} else {
-#ifdef Q_OS_WIN32
+#ifdef Q_OS_WIN
QByteArray phase3Token;
if (ntlmWindowsHandles)
phase3Token = qNtlmPhase3_SSPI(this, QByteArray::fromBase64(challenge));
return rc;
}
-#ifdef Q_OS_WIN32
+#ifdef Q_OS_WIN
// See http://davenport.sourceforge.net/ntlm.html
// and libcurl http_ntlm.c
if (pSecurityFunctionTable == NULL) {
securityDLLHandle = LoadLibrary(L"secur32.dll");
if (securityDLLHandle != NULL) {
+#if defined(Q_OS_WINCE)
+ INIT_SECURITY_INTERFACE pInitSecurityInterface =
+ (INIT_SECURITY_INTERFACE)GetProcAddress(securityDLLHandle,
+ L"InitSecurityInterfaceW");
+#else
INIT_SECURITY_INTERFACE pInitSecurityInterface =
(INIT_SECURITY_INTERFACE)GetProcAddress(securityDLLHandle,
"InitSecurityInterfaceW");
+#endif
if (pInitSecurityInterface != NULL)
pSecurityFunctionTable = pInitSecurityInterface();
}
return true;
}
-
+#ifdef Q_OS_WIN
// Phase 1:
static QByteArray qNtlmPhase1_SSPI(QAuthenticatorPrivate *ctx)
{
return result;
}
+#endif // Q_OS_WIN
+
#endif
QT_END_NAMESPACE